Skip to main content
All list endpoints return paginated results. Use the page and page_size query parameters to control which page of results you receive.

Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
page_sizeinteger25Number of items per page (max 100)

Response shape

Every paginated response includes these fields:
{
  "items": [],
  "total": 142,
  "page": 1,
  "page_size": 25,
  "total_pages": 6
}
FieldTypeDescription
itemsarrayThe records for the current page
totalintegerTotal number of matching records
pageintegerCurrent page number
page_sizeintegerItems per page
total_pagesintegerTotal number of pages

Iterating through all pages

import requests

headers = {"X-API-Key": "sk_your_api_key_here"}
page = 1
all_contacts = []

while True:
    response = requests.get(
        "https://api.socrateslabs.io/api/contacts",
        headers=headers,
        params={"page": page, "page_size": 100},
    )
    data = response.json()
    all_contacts.extend(data["items"])

    if page >= data["total_pages"]:
        break
    page += 1

print(f"Fetched {len(all_contacts)} contacts")

Tips

  • Use page_size=100 for bulk fetching to minimize the number of requests
  • The default page_size is 25 if not specified
  • An empty items array with total: 0 means no records match your query