Sample from Agents in a Country (CSV)

Select a quantity of agents from the given country at random, and return the results as a CSV file.

GET /batch/(int: quantity)/country/(string: country_code)/sample.csv
Query Parameters:
 
  • quantity – an integer > 0 and ≤ 500
  • country_code – an ISO 3166 country code
Request Headers:
 
Status Codes:
  • 200 OK – no error
  • 404 Not Found – either that quantity is bad, the country code is bad, or both

Try it:

In this example, sample a quantity of 5 agents from Canada. The ISO 3166 country code for Canada is “ca” so that is added to the URL.

http://pplapi.com/batch/5/country/ca/sample.csv

Example request:

GET /batch/5/country/ca/sample.csv HTTP/1.1
Host: pplapi.com

Example response:

HTTP/1.1 200 OK
Content-Type: text/csv; charset=utf-8
Content-Length: 479

language,country_tld,age,income,sex,religion,date_of_birth,id_str,internet,country_name,id
English,ca,31,6739,Male,Catholic,1984-03-28,Nbg-Qtk,True,Canada,6371564063
English,ca,82,49153,Female,none,1933-04-25,Dnu-AWm,True,Canada,6385453666
French,ca,57,42043,Male,Catholic,1958-04-22,9AZ-44P,True,Canada,6355873557
English,ca,60,25304,Female,Protestant,1955-08-15,2fe-7Ho,True,Canada,6384326251
English,ca,15,40007,Female,Catholic,2000-02-21,9Uu-oHA,True,Canada,6358742349