Reputation: 739
I am trying the following
https://data.gov.in/api/datastore/resource.json/?resource_id=e16c75b6-7ee6-4ade-8e1f-2cd3043ff4c9&api-key=APIKEY&limit=200
I still get only 100 records. If I change the limit to 50 it gives me 50 records. How do I get the records from 101 - 200 and beyond?
I also tried using the offset parameter like so :
&offset=50
expecting it to give me record number 50-150, but it doesn't.
Does anyone have an Idea?
Upvotes: 1
Views: 347
Reputation: 46
Try this query from OGD Platform.
you will find total_records = 2947
and count=100
.
Here, you have total of 2947 records and maximum of 100 records can be fetched in one query. If you want next 200 result, set offset=2
which will give results from 201 to 300 and so on. You need to increase your offset by 1 in each query till 2947/100 = 29 (29th query will give 47 records) to get all data.
Parameter limit is used to fetch total number of records in each query and that will be between 0 to 100 (max). That's why when you set limit=50
, you got 50 records but if you set limit=110
, still you will get 100 records only.
Hope I my answer is clear enough. Good luck.
Upvotes: 3