API setup
Pagination
Searches answer up to 100 results a page, 10,000 deep for one set of filters.
Pages
- page
- Which page, from 1
- per_page
- 1 to 100, default 25
- Reach
- The first 10,000 results: at per_page 100 the last page is 100. A page past it answers 400
request.invalid
Search people and Search companies answer { data, pagination }. total is every match, which can be more than you can page to; total_is_estimate is true when it is a floor (over a million). total_pages and has_more count only pages you can read. Loop while has_more is true.
Python
import os
import requests
url = "https://app.leadlayer.com/v1/people/search"
headers = {"x-api-key": os.environ["LEADLAYER_KEY"]}
filters = {"titles": {"include": ["Head of Sales"]}, "person_locations": {"include": {"countries": ["Germany"]}}}
page, people = 1, []
while True:
res = requests.post(url, headers=headers, json={"filters": filters, "page": page, "per_page": 100})
res.raise_for_status()
answer = res.json()
people += answer["data"]
if not answer["pagination"]["has_more"]:
break
page += 1More than 10,000
Split the search so each part has fewer than 10,000 matches, for example by person_locations, employee_ranges or seniorities, and page through each part. Every row read counts toward the seat's daily allowance.
Job results
Get a job takes limit (up to 1,000) and offset. Page while results_page.has_more is true. See Jobs.