The API will return a maximum of 500 agents at once. Using a language like R, it is possible to repeatedly call the API while accumilating the results. In this manner, it is possible to build a data set of almost any size.

The above example will issue 10 API requests in order to accumulate n=5000 agents. The last line of this example will save the samples as a CSV called sample_5000.csv. Notice the usage of system("sleep10"), which ensures our script will not exceed the API rate limits. If you do not include a pause like this, then the API will automatically block your requests until your quota replenishes.