Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am calling a restapi in c# the api has more than 15000 records.
But when i make a call it calls only first 20 records.

Is there any way to call all the records using some attributes in addheader method in code


the records will get increase every day and i cant keep 15000 as constant .

What I have tried:

I am calling a restapi in c# the api has more than 15000 records.
But when i make a call it calls only first 20 records.

Is there any way to call all the records using some attributes in addheader method in code
Posted
Updated 20-Dec-21 3:04am
v3
Comments
Chris Copeland 20-Dec-21 6:26am    
It sounds like you need to consult the documentation on the API. I think many REST APIs support some sort of "maximum results" parameter, it'd be down to whatever API you're calling. They might use paging, in which case you can make repeat API calls until you receive a page that has no results.
[no name] 20-Dec-21 12:26pm    
Sounds like your calling an API that isn't yours; and it's throttling because it isn't yours.

1 solution

An API does not "contain 15,000 records". The API is the interface to get at those records and manipulate them.

Having said that, the only people who can tell you how to get more than 20 records are the people who wrote the API. There is no standard for API's that says you must return 20 record to all of them. It's entirely up to the people who wrote the API as to how it works and how many records it can return in a single request, or how to get the "next page" of them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900