Firmographic market sizing with real counts
https://api.handlesapi.com/v1/leads/linkedin/segmentsThe GET /v1/leads/linkedin/segments endpoint of Handles API (Leads): Firmographic market sizing with real counts. One call costs 1 credit (a catalog read) and needs the leads:read scope. A success returns JSON as { data, meta }.
How many companies exist in a slice of the catalog, and how reachable that slice is. Group by industry, country, size band or founding decade, filter on any of the others, and get true counts rather than a facet list with no numbers behind it. Every row is an aggregate over companies, so nothing here identifies a person and the surface is aggregate by construction rather than by a filter somebody has to remember.
This is a sensitive scope. Keys are not granted it by default, and calls are audited.
- Counts are exact, not sampled. Measured on production: 452ms for the widest grouping and 386ms with an industry filter, cached for two minutes on top because a segment count does not move in seconds.
- '(unknown)' is a real bucket and is never hidden. country_code is populated on 82.32 percent of rows and founded_year on 70.70 percent. In the worked example above, grouping Software Development by country puts 1,422 of 7,776 companies - 18.3 percent - in the unknown bucket, so a chart that drops it is understating the market by nearly a fifth.
- crawl_succeeded is enrich_status 'ok': the website contact crawl completed. It is NOT 'has an email address'. 49,813 companies are 'ok' and 37,896 of them - 76.1 percent - actually yielded one. The exact email-holding count was measured at 2,425ms and dropped as too slow for a synchronous endpoint.
- hq_country is not offered as a dimension. At 1.51 percent populated it would report a market of 1,418 companies out of 93,677 while looking like an answer.
- min_staff and max_staff filter on the exact headcount, which is present on 91.82 percent of rows. A company with no headcount is excluded by either bound rather than assumed to be small.
- This is aggregate data about organisations. No row identifies a person, and no contact data is returned at any bucket size.
Request
curl "https://api.handlesapi.com/v1/leads/linkedin/segments" \
-H "Authorization: Bearer $HANDLES_API_KEY"const res = await fetch("https://api.handlesapi.com/v1/leads/linkedin/segments", {
headers: { Authorization: `Bearer ${process.env.HANDLES_API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error.code);
const { data, meta } = await res.json();
console.log(data);import os
import requests
res = requests.get(
"https://api.handlesapi.com/v1/leads/linkedin/segments",
headers={"Authorization": f"Bearer {os.environ['HANDLES_API_KEY']}"},
)
res.raise_for_status()
print(res.json()["data"])Set HANDLES_API_KEY to a key from your dashboard. Keys start with hk_live_.
Parameters
| Name | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| by | query | enum | Optional | Dimension to group on.industrycountrysize_bandfounded_decadedefault: industry | country |
| industry | query | string | Optional | Restrict to one industry, exactly as LinkedIn writes it. | Software Development |
| country | query | string | Optional | ISO 3166-1 alpha-2. Matched against country_code, never the free text. | DE |
| size_band | query | string | Optional | LinkedIn size band, e.g. '51-200 employees'. | 51-200 employees |
| min_staff | query | integer | Optional | Lower bound on exact headcount. Companies with no headcount are excluded. | 50 |
| max_staff | query | integer | Optional | Upper bound on exact headcount. Companies with no headcount are excluded. | 500 |
Response
Success is always { data, meta }.
{
"data": {
"dimension": "country",
"filters": {
"industry": "Software Development"
},
"buckets": [
{
"bucket": "US",
"companies": 3094,
"with_domain": 3041,
"crawl_succeeded": 1580,
"with_staff_count": 2975,
"median_staff": 110,
"active_last_90d": 2247
},
{
"bucket": "(unknown)",
"companies": 1422,
"with_domain": 1315,
"crawl_succeeded": 680,
"with_staff_count": 1213,
"median_staff": 42,
"active_last_90d": 846
},
{
"bucket": "IN",
"companies": 512,
"with_domain": 493,
"crawl_succeeded": 294,
"with_staff_count": 474,
"median_staff": 58,
"active_last_90d": 304
}
],
"totals": {
"companies": 7776,
"with_domain": 7518,
"crawl_succeeded": 4088
},
"coverage": {
"measured_at": "2026-08-31",
"rows": 93677
}
},
"meta": {
"request_id": "req_9f2c41a8b3d5",
"generated_at": "2026-08-23T09:14:02.317Z",
"took_ms": 42
}
}Response headers
Every successful response carries these headers.
| Header | Type | Description |
|---|---|---|
| X-Request-Id | string | Quote this to support. |
| X-RateLimit-Limit | integer | Requests allowed in the current one-minute window. |
| X-RateLimit-Remaining | integer | Requests left in the current one-minute window. |
| X-RateLimit-Reset | integer | Unix seconds at which the current window resets. |
| X-Credits-Cost | integer | Credits this call used. |
| X-Credits-Remaining | integer | Plan credits left in the current period. |
| X-Credits-Period-End | string | When the current period ends (ISO 8601). |
Errors
| Status | Error code | When |
|---|---|---|
| 401 | unauthorized | No key was sent, or the key is unknown or revoked. |
| 402 | quota_exceeded | Your plan's credits for this period are used up and overage is off (or its cap is reached). Waiting does not help: upgrade, or turn on overage in the dashboard. |
| 422 | invalid_request | A parameter is malformed, out of range or mutually exclusive with another. details names the offending fields. |
| 429 | rate_limitedlive_limit_reached | Too many requests. rate_limited clears when the minute window resets (see Retry-After); live_limit_reached (Free plan) clears at 00:00 UTC.Also sends Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. |
| 500 | internal_error | Something failed on our side. The call was not charged; quote the request_id to support. |
| 503 | upstream_timeoutupstream_errorplatform_unavailableservice_unavailable | The call could not be served right now and was not charged. upstream_timeout / upstream_error: a data source was slow or failed, retry with backoff. platform_unavailable: live reads for that platform are paused. service_unavailable: retry shortly. |
Failures use the error envelope. Branch on error.code, never on the message.