Forum Discussion
Extracting Data from API and transform into tables
- 7 years ago
Hi nnouchi,
there is a very easy way to retrieve the TS-data from Quandl:
let Source = Json.Document(Web.Contents("https://www.quandl.com/api/v3/datasets/LME/PR_NI.json?api_key=xxxxxxxx")), dataset = Source[dataset], ExpandAllQuandl = Table.FromRows(dataset[data], dataset[column_names]) in ExpandAllQuandlWorks with all sources and will definitely refresh in the service as well.
Hi nnouchi,
there is a very easy way to retrieve the TS-data from Quandl:
let
Source = Json.Document(Web.Contents("https://www.quandl.com/api/v3/datasets/LME/PR_NI.json?api_key=xxxxxxxx")),
dataset = Source[dataset],
ExpandAllQuandl = Table.FromRows(dataset[data], dataset[column_names])
in
ExpandAllQuandl
Works with all sources and will definitely refresh in the service as well.
- hannahgrobinson3 years agoFrequent Visitor
Hi nnouchi ImkeF could you please help me understand where the solution script should be written? I am trying to achieve a similar result with an API data source. Thank you so much.
- hannahgrobinson3 years agoFrequent Visitor
Hi again 🙂 I have adjusted the code you shared to include the API URL I am working with within the query editor. My apologies for the very novice questions, but I am not sure how to troubleshoot the error I'm recieving "The field 'dataset' of the record wasn't found." Thank you so much for any guidance!
let Source = Json.Document(Web.Contents("https://clinicaltrials.gov/api/query/study_fields?&max_rnk=1000&fmt=json&fields=BriefTitle,InterventionName,InterventionType,LastKnownStatus,LeadSponsorName")), dataset = Source[dataset], ExpandAll = Table.FromRows(dataset[data], dataset[column_names]) in ExpandAll