Forum Discussion
API JSON URL 10,000 row limitation
If your API has the option to include a $skip or $skiptoken in the url, you can generate a list of numbers increasing by 10,000 up to the # of rows you have in the data, and then concatenate the value on that row into the web call. Then expand the column of Tables to combine all the results.
List.Numbers(0,10, 10000) //for example
Convert to table, then add a custom column with the web.contents step (embedding the new number column in for the skip value.
Regards,
Pat
- PhilipTreacy5 years agoSuper User
Hi Anonymous
I've modified my original code to more closely match yours but you will still have to make some modifications.
let url= "https://jsonplaceholder.typicode.com/todos/1", GetPage = (Page) => let Source = Json.Document(Web.Contents(url, [ Query = [ StartDate = Date.ToText(Date.AddDays(Date.From(DateTime.LocalNow()), - Page),"yyyy-MM-dd"), EndDate = Date.ToText(Date.AddDays(Date.From(DateTime.LocalNow()), - 0),"yyyy-MM-dd") ] ] )) in Source, PageIndices = { 1 .. 5 }, Pages = List.Transform(PageIndices, each GetPage(_)) in PagesYou originally said you have to specify StartDate and EndDate so these parameters are included as part of the Query record. Add your token parameter name and value into this record and the entier query string is built for you, no messing about with "" and &
I'm not sure of the exact syntax you're using to get data for other days e.g. Source = "source"& Today -1 but you could also add this into the Query record.
PageIndices is the list that holds the number of days that you want to get data for. In my code it holds values from 1 to 5, change the 5 to however many days you need.
This query will get all responses from the website and store them in Pages where you can do subsequent transformations like convert the list to a table.
The above query will get dummy JSON replies from the typicode.com website so you can get an idea of what your results will look like.
If you need more assitance with this just post back and @ mention me so I see the reply.
Cheers
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up. - Anonymous5 years agoNot applicable
mahoneypat
Okay i will ask the vendor if they allow skip
PhilipTreacy
I will test this out if it works.
Sometimes if i pull per day, the problem is sometimes 1 day of data is too much and sometims exceed the 10,000 limit. thats the one im concern. But ill get back to you, i will test it out.