Guides

Make your first API call

Authenticate with your LeadX API key and retrieve a focused company record.

Use the company endpoint to verify your API key, confirm your base URL, and inspect the standard paginated response shape.

This example requires access to the Company API. Your documentation login does not replace the X-API-KEY header used for API requests.

Prerequisites

  • A LeadX API key with Company API access
  • A terminal, Python 3.9+, or Node.js 18+
  • A company domain you can use for testing

Request a company record

Store your API key

Keep the key outside your source code:

export LEADX_API_KEY="your_api_key_here"

Send the request

The include_fields array keeps the response focused on the fields needed by this example.

curl --fail-with-body "https://api.leadx.com/v1/companies" \
  -H "X-API-KEY: $LEADX_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "url": "leadx.com",
    "include_fields": [
      "company_id",
      "company_name",
      "url",
      "industry",
      "naics_code",
      "estimated_number_employees"
    ]
  }'

Inspect the response

A successful lookup returns a records array plus pagination metadata:

{
  "success": true,
  "records": [
    {
      "company_id": "EXAMPLECOMPANYID123",
      "company_name": "LeadX",
      "url": "leadx.com",
      "industry": "Software Development",
      "naics_code": "513210",
      "estimated_number_employees": 25
    }
  ],
  "page_number": 1,
  "per_page": 50,
  "total_pages": 1,
  "total_records": 1
}

Response values vary as source data changes. Treat the example as a shape reference rather than a fixed fixture.

Troubleshoot the first call

StatusMeaningWhat to check
401The API key is missing, invalid, or inactiveConfirm the X-API-KEY header and key status
403The key does not have Company API accessAsk an administrator to review the key's entitlements
422The request body is invalidSend at least one supported company filter
429The request exceeded an applicable limitBack off before retrying

Exact URL and phone lookups are the best starting point. Company-name and address searches are fuzzy and can return multiple records.

Continue building