# Firmographic market sizing with real counts

`GET https://api.handlesapi.com/v1/leads/linkedin/segments`

The 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

```bash
curl "https://api.handlesapi.com/v1/leads/linkedin/segments" \
  -H "Authorization: Bearer $HANDLES_API_KEY"
```

`HANDLES_API_KEY` is a key from your dashboard; send it as `Authorization: Bearer` or `x-api-key`.

## Parameters

- `by` (query, enum, optional): Dimension to group on. (values: industry, country, size_band, founded_decade; default: industry; example: country)
- `industry` (query, string, optional): Restrict to one industry, exactly as LinkedIn writes it. (example: Software Development)
- `country` (query, string, optional): ISO 3166-1 alpha-2. Matched against country_code, never the free text. (example: DE)
- `size_band` (query, string, optional): LinkedIn size band, e.g. '51-200 employees'. (example: 51-200 employees)
- `min_staff` (query, integer, optional): Lower bound on exact headcount. Companies with no headcount are excluded. (example: 50)
- `max_staff` (query, integer, optional): Upper bound on exact headcount. Companies with no headcount are excluded. (example: 500)

## Response

```json
{
  "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
  }
}
```

## Errors

- 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_limited, live_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.
- 500 internal_error: Something failed on our side. The call was not charged; quote the request_id to support.
- 503 upstream_timeout, upstream_error, platform_unavailable, service_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 `{ error: { code, message, request_id } }`: https://handlesapi.com/docs/errors

Source: https://handlesapi.com/docs/reference/leads-linkedin-segments
