Quickstart
This guide walks you through your first successful GET /api/company/search in about five minutes. You need a CompanyData account and an API key.
New accounts include a free trial with 150 lookups (no credit card). For rate limits (50 requests/second) and monthly quotas, see Authentication.
Comparing B2B data APIs? See Choosing a company data API before you integrate.
For machine-readable API definitions (OpenAPI 3.0), use the spec at /openapi.json.
1. Get your API key
- Create an account and pick a plan (trial included on signup).
- Open your dashboard and copy your API key.
2. Set your API key
Store the key in your environment. Every request sends it in the x-api-key header (see Authentication).
Terminal
export COMPANYDATA_API_KEY="your_key_here"
.env (Node)
COMPANYDATA_API_KEY=your_key_here
Do not commit API keys to git or client-side code. Use environment variables or a secrets manager in production.
3. Search companies (first request)
This example searches companies in the Netherlands (countryCode=NL) matching Heineken.
Recommended: npm SDK
Use the official JavaScript/TypeScript package @companydata/protool-sdk:
npm install @companydata/protool-sdk
import { ApiClient } from '@companydata/protool-sdk'
const client = new ApiClient({
baseUrl: 'https://app.companydata.com',
auth: { type: 'apiKey', apiKey: process.env.COMPANYDATA_API_KEY ?? '' },
})
const result = await client.company.search({
countryCode: 'NL',
search: 'Heineken',
page: 1,
pageSize: 25,
})
console.log(result.data)
Or use any HTTP client. See the JavaScript SDK for retries, timeouts, and export helpers.
cURL / HTTP
curl -G "https://app.companydata.com/api/company/search" \
--data-urlencode "countryCode=NL" \
--data-urlencode "search=Heineken" \
-H "x-api-key: $COMPANYDATA_API_KEY"
4. Confirm it worked
A successful search returns HTTP 200 with records under data.records (standard pagination envelope):
{
"data": {
"records": [
{
"ID": "330114331",
"Company Name": "Heineken N.V.",
"Country": "Netherlands",
"City": "AMSTERDAM"
}
],
"totalCount": 3
},
"page": 1,
"pageSize": 25,
"totalPages": 1
}
Search uses standard pagination (default pageSize 25; up to 50 records total across pages). See Company search & export and Pagination.
Common errors
- 401 Unauthorized - missing or invalid
x-api-key. Check the key and Authentication. - 429 Too Many Requests - rate limit exceeded (default 50 requests/second).
- 4xx / 5xx with message - see the response body; confirm query parameters in query parameters.