Pull List Of Companies
Example of how to pull a large list of companies
The Company Search Endpoint allows for users to pull large lists of companies that are in the Particl Database. Using these companies and their associated company_id
's gives access to getting their Company Sales and Product Sales once paired with a product_id
.
Each request made to the Company Search endpoint returns a sort
value which can be used to paginate through results until all companies are pulled.
import requests
companies = []
url = "https://api.particl.com/companies/list"
payload={
"page_size": 1000
# Insert more search params here if wanted
}
headers = {
"Authorization": "INSERT KEY HERE"
}
response = requests.get(url, headers=headers, params=payload)
response = response.json()
meta = response["meta"]
body = response["companies"]
companies.extend(body)
while meta["sort"]:
payload["sort"] = meta["sort"]
response = requests.get(url, headers=headers, params=payload)
response = response.json()
meta = response["meta"]
body = response["companies"]
companies.extend(body)
See all possible company search params here
Updated over 1 year ago