# Headcount Labs documentation, full text > Every Headcount Labs docs page in one file, generated from the same pages as https://headcountlabs.com/docs/. Index: https://headcountlabs.com/llms.txt # API reference URL: https://headcountlabs.com/docs/ # API reference Routes, filters, fields, code samples and release notes for the Jobs API. - [Get started with Headcount Labs](https://headcountlabs.com/docs/getting-started/): Create a key, make a first request, read a full real job record, and fix the common errors. - [Authentication](https://headcountlabs.com/docs/authentication/): Create a key, send it as a bearer token, keep it safe, and read the 401 error. - [Code samples](https://headcountlabs.com/docs/code-samples/): Request code in Python, Node.js, Ruby, PHP and curl for listing, counting, searching, syncing and exporting jobs. - [Which route should I use?](https://headcountlabs.com/docs/which-route/): A decision guide for choosing between list, count, single-job, search, export and changes requests. - [Bulk download walkthrough](https://headcountlabs.com/docs/bulk-download/): Count, create, wait for and download an export of up to 100,000 jobs, then keep the copy up to date. - [API reference](https://headcountlabs.com/docs/api-reference/): Every public API route, with its method, purpose and requirements. - [Jobs endpoints](https://headcountlabs.com/docs/jobs/): Methods, query behavior, response differences, and change retrieval for jobs. - [Companies endpoints](https://headcountlabs.com/docs/companies/): List and search the registry, read a company, and page jobs by canonical company ID. - [Job filters](https://headcountlabs.com/docs/filters/): The text, location, posting, date, pay and representation filters for a jobs request, with types and defaults. - [Query language](https://headcountlabs.com/docs/query-language/): The Boolean title and description syntax and the Elasticsearch-style query body, with the exact rules and real examples. - [Search and location filters](https://headcountlabs.com/docs/search-and-location/): Search by text and place, including metropolitan area, county and ZIP code filters. - [Pagination and cursors](https://headcountlabs.com/docs/pagination/): Understand the distinct continuation rules for jobs, companies, and usage reports. - [Errors and response headers](https://headcountlabs.com/docs/errors/): Interpret structured errors, status mappings, usage headers, and conditional rate-limit metadata. - [Rate limits and free allowance](https://headcountlabs.com/docs/rate-limits/): The free monthly allowance, per-record prices, the request rate, what counts and the headers that report it. - [Field dictionary](https://headcountlabs.com/docs/fields/): Every field in a job record, with a complete real example, the states a value can be in, and the value lists behind the filters. - [Job and posting fields](https://headcountlabs.com/docs/data-fields/): Combined job IDs, posting IDs, field states, and the list and single-job responses. - [Currentness, status, and changes](https://headcountlabs.com/docs/job-lifecycle/): Currentness, stale, source posting status, application checks and change-feed events. - [Timestamps and currentness](https://headcountlabs.com/docs/freshness/): Source dates, observation dates and projection timestamps, which date filter to use, and how fresh a job is. - [Company data](https://headcountlabs.com/docs/company-data/): The company registry, canonical IDs, merge redirects, identifiers, industries and company-scoped job listing. - [ATS pages and job boards](https://headcountlabs.com/docs/ats-vs-job-boards/): Source identity in the API, without treating platform names or posting URLs as company IDs. - [Source values and derived values](https://headcountlabs.com/docs/enrichment/): Field states, and how source-preserved posting data differs from normalized public fields. - [Counts and returned records](https://headcountlabs.com/docs/job-counts/): Result rows, distinct jobs and requests, and how counts are charged. - [Supported platforms](https://headcountlabs.com/docs/platforms/): Every applicant tracking system and job-board platform Headcount Labs reads, with the exact source filter value for each. - [Plan a safe data sync](https://headcountlabs.com/docs/sync-strategy/): Stable request scope, idempotent writes and explicit restart behavior with the changes feed. - [Ingestion strategy](https://headcountlabs.com/docs/ingestion-strategy/): First load with GET /v1/jobs, incremental sync with GET /v1/jobs/changes, polling cadence, outage recovery and expired jobs. - [Usage reporting endpoints](https://headcountlabs.com/docs/usage/): Read the authenticated request ledger and daily aggregates; understand their filters, cursors, and time basis. - [Usage and limits](https://headcountlabs.com/docs/usage-and-limits/): Request limits, how requests are counted, and where to see your usage. - [MCP tools](https://headcountlabs.com/docs/mcp-tools/): All 28 MCP tools, the scope each needs, which ones count as records, and a tested answer key of which call to make for common requests. - [OpenAPI reference](https://headcountlabs.com/docs/openapi-reference/): Every route, parameter, request body, response and schema in the live OpenAPI specification, including overage billing. - [API release notes](https://headcountlabs.com/docs/changelog/): Dated changes to the Headcount Labs API and its documentation, newest first. ## Developers, MCP and guides - [Developer overview](https://headcountlabs.com/developers/) - [Connect to Claude and Codex](https://headcountlabs.com/mcp/) - [Use Headcount Labs in ChatGPT](https://headcountlabs.com/mcp/chatgpt/) - [Use Headcount Labs in Grok](https://headcountlabs.com/mcp/grok/) - [Guides](https://headcountlabs.com/resources/) - [Backfill a job board](https://headcountlabs.com/resources/backfill-a-job-board/) - [Planning a job-board backfill](https://headcountlabs.com/resources/job-board-backfill/) - [Choose the job fields your product needs](https://headcountlabs.com/resources/job-data-fields/) - [Evaluate a jobs data API](https://headcountlabs.com/resources/evaluating-a-jobs-api/) - [Plan a job data integration](https://headcountlabs.com/resources/planning-your-job-data-integration/) - [Build or buy job data](https://headcountlabs.com/resources/build-vs-buy-job-data/) - [Evaluating ATS job sources](https://headcountlabs.com/resources/ats-api-guide/) - [OpenAPI specification (JSON)](https://api.headcountlabs.com/openapi) - [llms.txt](https://headcountlabs.com/llms.txt) - [All docs in one file](https://headcountlabs.com/llms-full.txt) Source: https://headcountlabs.com/docs/ --- # API reference URL: https://headcountlabs.com/docs/api-reference/ # API reference Index of public API routes and their current implementation status. ## Read operations | Method and path | Purpose | Notes | |---|---|---| | `GET /v1/jobs` | Page through the combined jobs projection. | Requires an API key. | | `POST /v1/jobs/search` | Search jobs with the list filters sent as a JSON body. | Requires an API key. Same results, paging and cost as `GET /v1/jobs`. | | `POST /v1/jobs/search/es_dsl` | Search jobs with an Elasticsearch-style `query` body. | Requires an API key. Supports a subset of clauses; anything else returns `400`. | | `GET /v1/jobs/count` | Count distinct included job IDs at a projection watermark. | Requires an API key. | | `GET /v1/jobs/changes` | Read created, updated, and expired events from a change cursor or timestamp. | Requires an API key. | | `GET /v1/jobs/{jobId}` | Read one combined job. | Route is implemented; merged, withdrawn, and missing IDs have distinct outcomes. | | `POST /v1/jobs/exports` | Start a bulk export of a search to gzipped JSON-lines files. | Requires an API key. Up to 100,000 jobs; one export at a time per account. | | `GET /v1/jobs/exports` | List your 20 most recent exports. | Requires an API key. | | `GET /v1/jobs/exports/{exportId}` | Read one export: status, record count and files. | Requires an API key. | | `GET /v1/jobs/exports/{exportId}/files/{n}` | Download one export file. | Requires an API key. Files are kept for 24 hours. | | `GET /v1/companies` | List the pinned company release. | Requires an API key. | | `POST /v1/companies/search` | Search that company projection with JSON criteria. | Requires an API key. | | `GET /v1/companies/{companyId}` | Read one registry company. | Route is implemented; merged IDs redirect. | | `GET /v1/companies/{companyId}/jobs` | List jobs scoped to a canonical company ID. | Requires an API key. | | `GET /v1/usage/requests` | Read the authenticated customer request ledger. | Requires an API key. | | `GET /v1/usage/analytics` | Read daily request and returned-record aggregates. | Requires an API key. | | `GET /v1/insights` | Answer one of ten job-market questions (top employers, pay, work arrangement, top metros, jobs by state, top roles, new postings, pay transparency, posting age, multi-state employers) from the latest checked snapshot. | Requires an API key; a free key is enough and the free tier is counted per key. No jobs are charged. Without a key, use the `market_insights` tool on the keyless MCP endpoint `https://api.headcountlabs.com/mcp/public`. | ## Account operations | Method and path | Purpose | Notes | |---|---|---| | `PUT /v1/account/overage` | Turn overage billing on or off and set its monthly limit in dollars. | Requires an API key. An account without an active paid subscription answers `403 upgrade_required` or `403 no_active_subscription`. Not counted against request windows or your allowance. Full description in the [OpenAPI reference](https://headcountlabs.com/docs/openapi-reference/#put-v1-account-overage). | ## Conditional availability The API can return `503` when the public catalog, projection metadata, cursor secret, or a required company representation is unavailable. An HTML description request also returns an unavailable error until confirmed source HTML is provided. ## Request examples ### jobs list ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs?currentness=current&limit=50" --header 'Authorization: Bearer ' ``` ### jobs search ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/jobs/search" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"title":"nurse","country":["US","CA"],"employment_type":"full_time","fields":["job_id","title","locations"],"limit":50}' ``` ### jobs search, Elasticsearch-style ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/jobs/search/es_dsl" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"query":{"bool":{"must":[{"match":{"title":"nurse"}},{"terms":{"country":["US","CA"]}}],"filter":[{"range":{"created_at":{"gte":"2026-10-01"}}}]}},"limit":50}' ``` ### jobs export ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/jobs/exports" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"country":"CA","title":"nurse","fields":["job_id","title","locations"],"max_records":20000}' ``` ### jobs count ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/count?company_id=12345678-1234-4234-8234-123456789abc¤tness=current" --header 'Authorization: Bearer ' ``` ### job detail ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/12345678-1234-4234-8234-123456789abc" --header 'Authorization: Bearer ' ``` ### job changes ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/changes?after=opaque_cursor_example&limit=100" --header 'Authorization: Bearer ' ``` ### company list ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/companies?name=Acme&limit=20" --header 'Authorization: Bearer ' ``` ### company search ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/companies/search" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"name":"Acme","country":"US","status":"active","limit":20}' ``` ### company id ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/companies/12345678-1234-4234-8234-123456789abc" --header 'Authorization: Bearer ' ``` ## Guides for the reference - [Field dictionary](https://headcountlabs.com/docs/fields/) with a complete real record. - [Query language](https://headcountlabs.com/docs/query-language/) for `title_advanced` and es_dsl. - [Code samples](https://headcountlabs.com/docs/code-samples/) in Python, Node.js, Ruby, PHP and curl. - [Which route should I use?](https://headcountlabs.com/docs/which-route/) and the [bulk download walkthrough](https://headcountlabs.com/docs/bulk-download/). - [API release notes](https://headcountlabs.com/docs/changelog/) with dated changes. Source: https://headcountlabs.com/docs/api-reference/ --- # ATS pages and job boards URL: https://headcountlabs.com/docs/ats-vs-job-boards/ # ATS pages and job boards How sources, platforms and postings relate to jobs and companies, and how to filter and credit them. ## Three kinds of source A job posting can come from an applicant tracking system (ATS), from a job-board platform, or from the employer’s own career site. An ATS such as Greenhouse, Lever, Ashby or Workday hosts career pages for many employers at once. A job-board platform lists jobs for many employers and often shows the same job another site already shows. An employer site is the company’s own page. Headcount Labs reads all three and calls each one a *source*. Each posting records its source in `postings[].source`, for example `greenhouse` or `oracle_hcm`. Company-run career sites appear as `employer_site` or `custom`. The [supported platforms](https://headcountlabs.com/docs/platforms/) page lists every value you can use in the `source` filter. ## One job, several postings The same opening is often posted in more than one place. Headcount Labs merges those postings into one job with one `job_id` and keeps each posting under `postings`, with its own `source`, `posting_url` and `application_url`. Filtering with `source=greenhouse` finds jobs that have a posting on Greenhouse. The returned job still lists all of its postings, including those on other sources. Decide early whether your product shows one card per job or one per posting, and label the unit clearly in your interface. ## Source filters | Filter | What it does | |---|---| | `source` | Keeps jobs with a posting on a named platform, such as `workday`, `oracle_hcm`, `greenhouse`, `lever` or `ashby`. | | `exclude_source` | Drops jobs whose postings come from the named platforms. Up to 10 values. | | `source_class` | Groups platforms by kind, for example ATS boards versus employer sites. | | `source_type` | Matches the kind of source a posting came from. | | `posting_id`, `source_posting_id` | Find one posting by Headcount Labs ID or by the source’s own ID. | The coverage page shows how many jobs each platform contributes. ## A platform name is not an employer Thousands of employers use the same ATS, so a source name tells you where a posting lives, not who posted it. The employer is in `employer_name`. When Headcount Labs has matched it to a company record, `company_id` holds that record’s ID; otherwise `company_id` is null and `employer_name` keeps the name the source published. Do not treat a platform name, a domain or a display string as proof of a company match. ## Keep the evidence for each posting - Store `postings[].posting_url` and `source` with every job you save, so a person can open the original page. - Check `attribution` on each posting. When `required` is true, show the credit `text` and `link` next to the job. - Use `posting_status` and `latest_application_check` to tell whether a posting is still listed and whether an application can still be started. - Read the [data rights](https://headcountlabs.com/data-rights/) page before you copy or redisplay source content. Source: https://headcountlabs.com/docs/ats-vs-job-boards/ --- # Authentication URL: https://headcountlabs.com/docs/authentication/ # Authentication Create an API key, send it as a bearer token, keep it safe and read the 401 error. ## Bearer API key Every request to the API carries your key in the `Authorization` header: ``` Authorization: Bearer ``` New keys look like `jc_live_.<43-character secret>`. Keys issued before October 2026 start with `ar_live_` and still work, so keep using an older key if you have one. Send the whole key, including the part after the dot. ## Create a key Sign in at [api.headcountlabs.com/data/login](https://api.headcountlabs.com/data/login) and create keys at [api.headcountlabs.com/data/keys](https://api.headcountlabs.com/data/keys). Every key includes the free monthly allowance described on the [pricing page](https://headcountlabs.com/pricing/). All keys on an account share one set of limits, so a second key does not give you more room. Headcount Labs stores a digest of each key, not the key itself. The full key is shown once when you create it, so copy it then. If you lose it, create a new key. ## Make your first authenticated call Count some jobs. A count returns one number, so it is a cheap way to check that your key works. ``` export HEADCOUNTLABS_API_KEY="..." # paste your key here, in your own shell curl --fail-with-body -sS \ "https://api.headcountlabs.com/v1/jobs/count?country=US&work_arrangement=remote" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` A good key returns `{"count": ..., "snapshot_watermark": "..."}`. The [code samples](https://headcountlabs.com/docs/code-samples/) show the same call in Python, Node.js, Ruby and PHP. ## Keep the key safe - Store it in a secret manager or a protected environment variable on your server. - Never put it in browser code, mobile app bundles, URLs, source control, client-side logs or analytics events. - Never send it, or your password, by email. Support will not ask for either. - If a key may have leaked, open the [keys page](https://api.headcountlabs.com/data/keys) and press **Rotate** to give that key a new secret, or **Revoke** to switch it off. The old secret stops working at once and a revoked key returns `401`. The new secret is shown once. - Give each system its own key, so you can replace one without touching the others. ## Authentication errors A missing, malformed, unknown or disabled key returns `401` with `WWW-Authenticate: Bearer` (and `error="invalid_token"` when the key was well formed but not accepted). A typical body looks like this: ``` { "error": { "code": "missing_api_key", "message": "No API key was sent. Send the header \"Authorization: Bearer \" with a key from https://headcountlabs.com/data/keys.", "request_id": "", "alias": "invalid_api_key" } } ``` A request refused with 401 is not counted against your allowance or your request limit. Check the key for a missing character, a stray space or newline, and the header name. The `code` is specific: `missing_api_key`, `wrong_auth_header`, `malformed_authorization`, or `invalid_or_expired_api_key`. Each of these also has `alias` `invalid_api_key` so older clients can still branch on that. A `403 insufficient_scope` means the key or sign-in is valid but is missing a permission such as `jobs:read` or `companies:read`; reconnect and approve it. Overage, spend caps and used-up allowances return `429` (`data_limit_exceeded` or `rate_limited`), not `403`. A `402 card_required` means a payment method is needed before paid usage can continue. ## MCP uses sign-in, not a key The MCP server at `https://api.headcountlabs.com/mcp` signs you in with OAuth in your browser, so there is no key to copy into your AI client. Each connection appears on your keys page as a key labeled `MCP: `; delete it to disconnect. The sign-in asks for scopes: `jobs:read` (the default), `companies:read`, `usage:read` and `overage:write`. The API key is for direct REST calls. The [MCP tools page](https://headcountlabs.com/docs/mcp-tools/) lists the scope each tool needs. Keys from an MCP sign-in (OAuth) expire after one hour; the client should refresh the token or sign in again. See [the MCP page](https://headcountlabs.com/mcp/) for setup. Source: https://headcountlabs.com/docs/authentication/ --- # Companies endpoints URL: https://headcountlabs.com/docs/companies/ # Companies endpoints List, search and read companies, and page the jobs of one company by its ID. ## List companies `GET /v1/companies` returns `{data, next_cursor}`. Optional query fields are `name` (a 1 to 200 character substring), `limit` (1 to 100, default 50) and `cursor`. Unknown or repeated fields return 400. Companies come back in order of normalized name, then ID. ``` curl --fail-with-body -sS "https://api.headcountlabs.com/v1/companies?name=cloudflare&limit=20" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` ## Search companies `POST /v1/companies/search` takes a JSON body with optional `name`, two-letter `country`, `status` (`active`, `retired` or `merged`), `limit` (1 to 100, default 50) and `cursor`. The body can be up to 16,384 bytes and unknown fields are rejected. ``` curl --fail-with-body -sS -X POST "https://api.headcountlabs.com/v1/companies/search" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"cloudflare","country":"US","status":"active","limit":3}' ``` The response is `{data: [company], next_cursor}`. ## Read one company `GET /v1/companies/{companyId}` returns `{data: company}`. A merged ID answers `308` with a `Location` header and no body; an unknown ID answers `404`. ``` { "company_id": "3483b509-5f22-4535-a907-19c285f3b460", "name": "Cloudflare", "country": "US", "status": "active", "region": "CA", "address_source": "sec", "identifiers": [{"scheme": "ticker", "value": "NET", "exchange": null, "source": "sec"}, ...], "industries": [{"system": "naics", "code": "541519", "source": "sam_gov"}, ...] } ``` See [company data](https://headcountlabs.com/docs/company-data/) for every field. ## List the jobs of one company `GET /v1/companies/{companyId}/jobs` pages the jobs of one company. It accepts the job filters, `fields` and `include`, and returns the same envelope as `GET /v1/jobs`. A merged company redirects to its replacement. If you send `company_id` as well, it must equal the path. ``` curl --fail-with-body -sS "https://api.headcountlabs.com/v1/companies/3483b509-5f22-4535-a907-19c285f3b460/jobs?limit=50&fields=job_id,title,locations" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` ## Cursors A company cursor is tied to the filters and page size that produced it and reads the company release it started on, so paging stays steady while the registry updates. Company list responses do not carry `snapshot_watermark`; the jobs list for a company does. Treat every cursor as opaque. ## Errors you may see - `400 invalid_request` for an unknown or repeated field, a `limit` outside 1 to 100, or a cursor that does not belong to the request. - `401 invalid_api_key` for a missing or invalid key. - `404` for an unknown company ID. - `429` when you are over your request rate or allowance. Wait for `Retry-After`. - `503` while the company data is being updated. Retry shortly. ## Choosing between list and search Use `GET /v1/companies` for a quick name lookup. Use `POST /v1/companies/search` when you also filter by country or status. Company routes count as ordinary requests. See [rate limits](https://headcountlabs.com/docs/rate-limits/). Source: https://headcountlabs.com/docs/companies/ --- # Company data URL: https://headcountlabs.com/docs/company-data/ # Company data The company record, its public identifiers and industry codes, merged companies and how jobs link to them. ## What a company record holds The company registry covers the employers behind the published jobs. Each company has these fields: | Field | Holds | |---|---| | `company_id` | The stable UUID of the company record. | | `name` | The company’s canonical name. | | `country` | Two-letter country code from a government address, or null when unknown. | | `status` | `active`, `retired` or `merged`. | | `region` | State or province code from the same government address, or null. | | `address_source` | `sec` (SEC business address), `dol_form5500` (Form 5500 plan sponsor address) or null. | | `identifiers` | Public registry IDs: `sec_cik`, `ein`, `uei` and `ticker`, each with its source. Empty when none is known. | | `industries` | NAICS and SIC codes with their source. Empty when none is known. | ## A real company record This is the record for Cloudflare, returned on October 14, 2026. The identifiers and industry codes come from US government public sources. ``` { "company_id": "3483b509-5f22-4535-a907-19c285f3b460", "name": "Cloudflare", "country": "US", "status": "active", "region": "CA", "address_source": "sec", "identifiers": [ { "scheme": "ein", "value": "270805829", "exchange": null, "source": "sec" }, { "scheme": "sec_cik", "value": "0001477333", "exchange": null, "source": "sec" }, { "scheme": "ticker", "value": "NET", "exchange": null, "source": "sec" }, { "scheme": "uei", "value": "JV9YXS9MLA48", "exchange": null, "source": "sam_gov" } ], "industries": [ { "system": "naics", "code": "541519", "source": "sam_gov" }, { "system": "sic", "code": "7372", "source": "sec" } ] } ``` ## Company ID versus employer name A job has two ways to name its employer. `employer_name` is the text the source published. `company_id` points to a company record when Headcount Labs matched the two, and is null when it did not. Group by `company_id` when you need one company across many jobs, and fall back to `employer_name` for the jobs that have no match. A company ID is a registry ID. It is not a domain name and does not promise that every spelling of the employer was matched. ## Merged companies redirect When two records turn out to be one company, the old ID is marked `merged`. Reading it returns `308` with a `Location` header pointing to the current ID and an empty body. Follow the redirect and store the new ID. An unknown ID returns `404`. In rare cases a merge chain cannot be resolved, or the company data is being updated, and the route returns `503`; retry shortly. ## Jobs for one company `GET /v1/companies/{companyId}/jobs` pages the jobs of one company with the same filters and response as `GET /v1/jobs`. A merged ID redirects to its replacement. If you also send `company_id` it must match the path. ## What is not in the registry The registry holds identity, location of record, public identifiers and industry codes. It does not hold headcount, revenue, contacts or corporate hierarchy. Source: https://headcountlabs.com/docs/company-data/ --- # Job and posting fields URL: https://headcountlabs.com/docs/data-fields/ # Job and posting fields Understand combined job IDs, posting IDs, state-bearing values, and the difference between list and detail DTOs. ## Combined job and posting identities | Field | Meaning | |---|---| | `job_id` | UUID for a combined job record in the public projection. | | `postings[].posting_id` | Identifier for one posting associated with the combined job. | | `postings[].source_posting_id` | Identifier supplied by the underlying source. | | `company_id` | Nullable canonical company UUID; it is not an employer domain or discovery key. | ## Five field-state envelopes | State | Serialized shape | Meaning | |---|---|---| | `known` | `{"state":"known","value":"Engineer"}` | A value is available. | | `source_omitted` | `{"state":"source_omitted"}` | The source did not provide this value; there is no `value` key. | | `source_unmapped` | `{"state":"source_unmapped","value":null,"evidence":["source label"]}` | Evidence exists, but no normalized value was mapped. Here `value` is explicitly null. | | `extraction_failed` | `{"state":"extraction_failed"}` | Extraction did not produce a value; there is no `value` key. | | `derived` | `{"state":"derived","value":"hybrid","evidence":["source text"]}` | A derived value includes its evidence. | These states are not interchangeable with a nullable field. The public serializer does not emit the internal `inferred` state. ## Job-level fields A job includes `job_id`, `currentness`, `stale`, nullable `company_id`, state-bearing `employer_name`, `title`, `description`, and `work_arrangement`, a `locations` array, and timestamps `job_first_seen_at`, `curated_at`, and `job_updated_at`. ## Posting-level fields Postings include `posting_id`, source board ID, `source_posting_id`, `posting_status`, posting/application URL, location and pay values, nullable `source_posted_at`, `first_seen_at`, nullable `last_completed_fetch_at`, and nullable `latest_application_check`. Every posting also carries attribution. The [getting-started page](https://headcountlabs.com/docs/getting-started/) and the [field dictionary](https://headcountlabs.com/docs/fields/) show one complete real job. ## The list and detail responses differ | Behavior | Jobs list | Job detail | |---|---|---| | Company include | `include=company` can add a company object or null. | `include=company` can add a company object or null. | | Attribution | Included on each posting. | Included on each posting. | | Source data | With `include=source_data`, stored source_data and source_rights pass through. | Optional source_data is normalized to named snake_case properties. | | Description format | HTML format request can return 503 until confirmed source HTML is available. | HTML format request can return 503 until confirmed source HTML is available. | ## Posting attribution ``` {"required":null,"text":null,"link":null} ``` Every posting, in a list or in a single-job response, includes `attribution` with nullable `required`, `text`, and `link`. All three are null when the source’s rights record says nothing. ## Not every source value becomes a normalized field Benefits, hours, education or experience requirements, skills, responsibilities, qualifications, and hiring-team contacts are not separate normalized fields in this DTO. Optional posting `source_data` preserves source-dependent values; list and detail representations differ. ## Full field list The [field dictionary](https://headcountlabs.com/docs/fields/) lists every job, posting, location, pay and company field with its type, the allowed values of the enumerated fields, and one complete real record. The [source values and derived values](https://headcountlabs.com/docs/enrichment/) page explains the field states. Source: https://headcountlabs.com/docs/data-fields/ --- # Source values and derived values URL: https://headcountlabs.com/docs/enrichment/ # Source values and derived values Which values are copied from the source, which Headcount Labs adds, and how to keep them apart. ## Every value says where it came from Title, employer, description, work arrangement, locations, URLs and pay are returned as small objects with a `state`. A `known` value is usable as is. `source_omitted` means the source did not publish it. `source_unmapped` means the source published something that did not map to a defined value, and `evidence` shows it. `extraction_failed` means a reading attempt failed. `derived` means Headcount Labs worked the value out, and `evidence` quotes the text it used. The [field dictionary](https://headcountlabs.com/docs/fields/) shows each state in a real record. ## What Headcount Labs adds | Addition | Where | How it is built | |---|---|---| | Work arrangement | `work_arrangement` | Taken from the source label when there is one. Otherwise derived from the posting text, with the matching text in `evidence`, for example `"location: In-Office; In-Office"`. | | County and metro area | `locations[].value.county_fips`, `msa` | Added when the location can be placed. The metro area is a US Census CBSA (metropolitan or micropolitan area). | | ZIP code | `locations[].value.zip` | Only when the posting itself states a real ZIP inside the stated state. Never guessed from a city. | | Company link | `company_id` | Set when the employer matches a company record. Otherwise null. | | Company identifiers | `company.identifiers` | SEC CIK, EIN, UEI and ticker, copied from US government public sources. | | Company industries | `company.industries` | NAICS and SIC codes from US government public sources. | | Merged job | `job_id` | Postings of the same opening are combined into one job. | ## What stays as published Pay, employment type, posted dates and the source’s labels are returned as the source wrote them. Pay is not converted between currencies or time periods, and employment type is free text with many spellings. With `include=source_data`, each posting adds a `source_data` object holding the source’s own work-location label, posted and updated times, employment type, source type and availability. The raw source payload is not published. ## What is not a field Benefits, hours, education or experience requirements, skills, responsibilities, qualifications and hiring-team contacts are not separate fields today. They remain inside the description text. ## Keep your interpretation separate If you classify jobs, extract skills or assign your own categories, store the result in your own columns and keep the original `state` and `value` beside it. That lets you see when a source changed its wording, and it keeps a `derived` value from being mistaken for something the employer wrote. Preserve `evidence` when you show a derived or unmapped value to a user. Source: https://headcountlabs.com/docs/enrichment/ --- # Errors and response headers URL: https://headcountlabs.com/docs/errors/ # Errors and response headers Interpret structured errors, status mappings, usage headers, and conditional rate-limit metadata. ## Structured errors ``` { "error": { "code": "query_too_broad", "message": "The search was stopped before it finished (searches are limited to 90 seconds). Do not retry the same call: it would be stopped again. The query is too broad: broad q= text searches are the slowest. For job titles use title= (or title_advanced=) instead of q=, add filters such as state, city, company or source, or use a smaller limit.", "request_id": "", "alias": "service_unavailable", "retryable": false } } ``` Every error body has `code`, `message` and `request_id`. Branch on `code`, not on the message. New codes may also include `alias` (the previous code string, so older clients can still key off it), `limit_scope` on a `429`, and `retryable` when waiting and repeating the same call will not help. ## Common status codes | HTTP | Meaning | |---|---| | 400 | A parameter, body, identifier or cursor is wrong. Fix the request or restart from the first page; do not retry it unchanged. | | 401 | The bearer key is missing, in the wrong header, malformed, unknown, revoked or expired. See the specific `code` (below). Not counted against your allowance. | | 402 | A payment method is required before paid usage can continue (`card_required`). | | 403 | The key or sign-in is valid but is missing a permission (`insufficient_scope`). This is not an overage or spend-cap error; those are `429`. | | 404 | A requested job, company, export, file, usage key or route was not found. | | 405 | This route does not accept that HTTP method. The `Allow` header lists the methods it does accept. | | 410 | The job or company ID was withdrawn or merged. A merged company may also include a successor id. | | 308 | A merged job or company ID redirects to a canonical ID; job and company response bodies differ. | | 422 | A usage report exceeds source-row or group limits. Narrow the period. | | 429 | A request window, concurrency cap, or data allowance was reached. Wait `Retry-After` seconds. The body's `limit_scope` says which limit you hit. | | 503 | The catalog is unavailable, the service is temporarily down or busy, HTML descriptions are not published, or a search was stopped at the 90-second cap (`query_too_broad`: do not retry the same call). Follow `Retry-After` when it is present; its absence on `query_too_broad` means do not replay the search. | | 504 | The query could not start, or did not finish within the request budget. A couldn't-start error is retryable; wait `Retry-After` seconds. A search stopped at the 90-second cap is `503 query_too_broad`, not `504`. | ## Usage response headers After usage admission, responses can include `X-Request-Id`, `X-Data-API-Usage-Mode`, `X-Data-Records-Used`, and `X-Data-Records-Reset`. Enforced request windows add `RateLimit-*`; a configured returned-record cap can add `X-Data-Records-Limit` and `X-Data-Records-Remaining`. Daily request counters use `X-Data-Requests-*` with `X-Data-Requests-Window: day` when a 24-hour window is in the policy. Headers depend on policy and usage-snapshot availability; they are not guaranteed on every response. Retryable 429, 503 and 504 answers set `Retry-After` in seconds. ## Recover deliberately Read the structured `error.code`, and `limit_scope` or `retryable` when present, before retrying. Correct a 400 request rather than retrying it unchanged. Follow `Retry-After` on a 429 and on a busy or generic 503. Do not retry a `query_too_broad` (or a 503 whose message says the search was stopped) with the same filters: narrow it, for job titles with `title=` or `title_advanced=` instead of `q=`. Quote the `request_id` when you contact support. ## Error codes | Code | HTTP | What to do | |---|---|---| | `invalid_request` | 400 | A parameter, body or cursor is wrong, or a cursor belongs to an older catalog snapshot. Fix the request or restart from the first page; do not retry it unchanged. | | `invalid_api_key` | 401 | Kept as `alias` on the more specific 401 codes below, and used when a key becomes invalid mid-request. Send `Authorization: Bearer ` with a key from https://headcountlabs.com/data/keys. | | `missing_api_key` | 401 | No API key was sent. Send the header `Authorization: Bearer ` with a key from the keys page. Alias: `invalid_api_key`. | | `wrong_auth_header` | 401 | The key was sent in a header such as `X-API-Key`. This API reads only `Authorization`. Alias: `invalid_api_key`. | | `malformed_authorization` | 401 | The `Authorization` header is missing `Bearer `, uses a different scheme, is empty, holds a placeholder such as `${HEADCOUNTLABS_API_KEY}`, or the value is not a Headcount Labs key (those start with `jc_live_` or `ar_live_`). Alias: `invalid_api_key`. | | `invalid_or_expired_api_key` | 401 | The key was well formed but was not accepted: it is unknown, revoked or expired. `WWW-Authenticate` includes `error="invalid_token"`. A 401 is not counted against your allowance. Alias: `invalid_api_key`. | | `insufficient_scope` | 403 | The key or MCP sign-in is valid but is missing a required permission (for example `jobs:read` or `companies:read`). Reconnect and approve that permission. This is not an overage or spend-cap error. | | `card_required` | 402 | A payment method is required before paid usage can continue. Add a card on the Billing page (`/data/billing`). | | `not_found` | 404 | There is no such API route. | | `job_not_found` | 404 | No job has this ID. | | `company_not_found` | 404 | No company has this ID. | | `export_not_found` | 404 | The requested export or export file was not found or is no longer available. Older clients may still see `alias` `job_not_found`. Alias: `job_not_found`. | | `file_not_found` | 404 | An MCP download link is invalid or has expired. Call `read_file` for a new link. The body includes `request_id`. | | `api_key_not_found` | 404 | A usage report named an `api_key_id` that is not one of your keys. | | `method_not_allowed` | 405 | This route does not accept that method. Use one of the methods in the `Allow` header. | | `job_withdrawn` | 410 | The job was withdrawn. | | `company_withdrawn` | 410 | The company ID was merged or is no longer in the current public release. The body may include a successor company id. | | `report_too_large` | 422 | A usage report covers more than 100,000 events or 1,000 groups. Narrow the period. | | `rate_limited` | 429 | A request window (per minute, UTC day or month), a per-key concurrency cap, a search already in progress, or too many unrecognised keys from this address was reached. Wait `Retry-After` seconds. See `limit_scope` for which limit you hit. | | `data_limit_exceeded` | 429 | This response would go past your records allowance, daily data allowance, spend cap, free records or overage limit, so no data was sent. Wait `Retry-After` seconds, or raise the cap on the Billing page. See `limit_scope`. | | `query_timeout` | 504 | The query could not start within a few seconds, or did not finish within the request budget. A couldn't-start error is retryable: wait `Retry-After` seconds (a few seconds) and try again, or narrow the filters. This is not the 90-second stopped-search cap; that is `query_too_broad`. | | `query_too_broad` | 503 | The search was stopped at the 90-second cap and no records were charged. There is no `Retry-After` header. Do not retry the same call: it would be stopped again. For job titles use `title=` (or `title_advanced=`) instead of `q=`, add filters such as state, city, company or source, or use a smaller limit. Older clients can still key off `alias` `service_unavailable`. On MCP, `retryable` is false and the message also names `filters.title`. Alias: `service_unavailable`. | | `catalog_unavailable` | 503 | The versioned jobs catalog is being published or is not available yet. Retry after `Retry-After` seconds (typically 30). | | `service_unavailable` | 503 | A temporary failure, or the catalog changed during the request: retry after `Retry-After` seconds. When the message says the search service is busy (long-running queries already running), `Retry-After` is 60 seconds, matching “retry in a minute.” A search stopped at the 90-second cap is `query_too_broad`, not this code. | | `html_unavailable` | 503 | `description_format=html` was requested; confirmed source HTML is not published yet. Use `description_format=text`. On list and export, `alias` is `invalid_request` (the previous list code). Alias: `invalid_request`. | ## The `limit_scope` field Every `429` body includes `limit_scope`, so you can tell which limit you hit: | `limit_scope` | Meaning | |---|---| | `minute` | The short request window (for example 60 requests per 60 seconds) is full. | | `day` | The UTC-day request window or the daily records allowance is full. | | `month` | The monthly request allowance or monthly records allowance is full. | | `concurrency` | This API key already has the maximum number of requests running at once (10). Wait for one to finish. | | `search_in_progress` | This API key already has a search running. Wait for it to finish, then retry. | | `bad_key` | Too many unrecognised API keys came from this address. Wait and try again. | | `overage` | The monthly overage limit has been reached. Raise it with the `set_overage` tool or with `PUT /v1/account/overage`. | | `spend_cap` | The monthly spend cap has been reached. See the Billing page (`/data/billing`). | | `free_records` | This month's free records are used up. Turn on paid usage on the Billing page to continue. | ## MCP errors MCP tool errors use the same `code`, `message` and `request_id` in the tool result's `error` object, plus `http_status` and often `retryable`. JSON-RPC authorization failures use the same key-error codes (`missing_api_key`, `wrong_auth_header`, `malformed_authorization`, `invalid_or_expired_api_key`). Keys from an MCP sign-in (OAuth) expire after one hour; the client should refresh or sign in again. Further MCP tool codes are on the [MCP tools page](https://headcountlabs.com/docs/mcp-tools/). ## Handling errors in code The [code samples](https://headcountlabs.com/docs/code-samples/) check the status, read the `error.code` and print the `request_id` in Python, Node.js, Ruby, PHP and curl. Quote the `request_id` when you contact support. The [rate limits page](https://headcountlabs.com/docs/rate-limits/) says when to retry a `429`. Source: https://headcountlabs.com/docs/errors/ --- # Job filters URL: https://headcountlabs.com/docs/filters/ # Job filters The text, location, posting, date, pay and representation filters for a jobs request, with types and defaults. ## List filters | Query fields | Type, default, or range | Applied behavior | |---|---|---| | `q`, `title`, `description` | Text; 1–200 characters. | Phrase-style matching over job title and/or description. `q` does not search company or location. | | `title_advanced`, `description_advanced` | Validated Boolean search expression. | Advanced text matching against the named field. | | `company`, `company_id` | Text substring; canonical lowercase UUID. | Matches employer text or canonical company identity. | | `location`, `city`, `state`, `country` | Text; `country` accepts a two-letter code, or up to 10 codes separated by commas. | Location predicates. Combined conditions apply to a matching indexed location row. A list of countries matches jobs in any of them. | | `work_arrangement` or `remote_type` | Enum: `remote`, `hybrid`, `in_person`. | Aliases cannot be combined. | | `employment_type`, `source`, `exclude_source`, `source_type`, `source_class` | Text or source-class enum; `employment_type` accepts up to 10 values separated by commas; exclude up to 10 sources. | Match or exclude permitted posting sources and source classes. A list of employment types matches jobs with any of them. | | `job_id`, `posting_id`, `source_posting_id`, `posting_status` | Canonical lowercase job UUID; text posting IDs; status enum. | Restrict results by matching job/posting identity and listed status. | | `currentness` or `active` | CSV enum defaults to `current`; boolean alias is lowercase true/false. | `active=true` maps to current; false maps to not_current. | | `posted_since`/`published_since`, `posted_until` | RFC 3339 timestamp or YYYY-MM-DD date. | Publisher date range. The two “since” aliases cannot be combined. | | `first_seen_since/until`, `updated_since/until`, `curated_since/until` | RFC 3339 timestamp or YYYY-MM-DD date. | Job timestamp ranges. | | `msa` | 5-digit CBSA code. | Matches any job location whose metropolitan or micropolitan statistical area code equals it, for example `12420` for Austin-Round Rock-San Marcos, TX. | | `stale`, `company_linked`, `has_description/location/pay/posting_url/application_url` | Lowercase boolean. | Match published presence and status fields. | | `pay_currency`, `pay_min`, `pay_max` | Supported ISO 4217 code; amount 0–1,000,000,000. | Match known pay values; minimum cannot exceed maximum. | | `last_fetch_since/until`, `application_check`, `application_check_since` | RFC 3339 timestamp; application-check enum. | Filter by posting fetch and application-check fields. | ## Representation options `include=company` adds a company object or `null` to list results when the company projection can be resolved. `include=source_data` adds stored source payload and rights to postings. `description_format=text` is the default; `description_format=html` returns an unavailable error until confirmed source HTML is provided. The count route rejects `include` and `description_format`. `fields` chooses which job properties come back, as a comma-separated list such as `fields=job_id,title,locations`. `job_id` is always included, and an unknown property name is rejected. It works on `GET /v1/jobs`, `POST /v1/jobs/search`, `GET /v1/jobs/{jobId}` and `GET /v1/companies/{companyId}/jobs`. When `fields` is exactly `job_id`, a page can hold up to 1,000 jobs instead of 250. `POST /v1/jobs/search` takes the same filters as a JSON body, where `country`, `employment_type` and `fields` can also be arrays. ## Strict request parsing Unknown or repeated query fields are rejected. Boolean values use lowercase `true` or `false`; list-valued fields are comma-separated with no duplicates. `work_arrangement` and `remote_type` cannot be combined, nor can `active` with `currentness` or `posted_since` with `published_since`. ## Validation and representation options | Parameter group | Type and accepted values | Execution | |---|---|---| | `currentness` | Unique comma-separated values: `current`, `uncertain`, `not_current`. No spaces or repeated values. Defaults to `current`. | List and count. | | `active` | Lowercase boolean. `true` maps to current; `false` maps to not_current. | Cannot be combined with `currentness`. | | `include` | Unique comma-separated values: `company`, `source_data`. | List adds company or source data when requested. Count rejects this parameter. | | `description_format` | `text` or `html`. Defaults to text. | List and detail HTML requests can return unavailable until confirmed source HTML is available. Count rejects it. | | Pay bounds | Nonnegative decimal from 0 to 1,000,000,000; at most two decimals; `pay_min <= pay_max`. `pay_currency` is a supported ISO 4217 code. | List and count use the shared public-jobs filter builder. A pay range uses known pay values; no currency conversion or pay-period filter is applied. | | Dates and aliases | RFC 3339 timestamps require a timezone. `posted_since` and `published_since` are aliases; only one may appear. | Both. `work_arrangement` and `remote_type` are also mutually exclusive aliases. | Unknown and repeated query keys are rejected. Text filters accept 1–200 characters; booleans are lowercase `true` or `false`. ## Combining filters Every filter above works in `GET /v1/jobs`, in the JSON body of `POST /v1/jobs/search` and, by name, inside `POST /v1/jobs/search/es_dsl`. The [query language](https://headcountlabs.com/docs/query-language/) page covers the Boolean syntax of `title_advanced` and `description_advanced` and the supported es_dsl clauses. The [route guide](https://headcountlabs.com/docs/which-route/) says when to use each. Source: https://headcountlabs.com/docs/filters/ --- # Timestamps and currentness URL: https://headcountlabs.com/docs/freshness/ # Timestamps and currentness Interpret source dates, observation dates, projection timestamps, and currentness without implying a refresh SLA. ## Each timestamp answers a different question | Field | What the source field represents | |---|---| | `source_posted_at` | Timestamp attributed to the source posting; it can be null. | | `first_seen_at` / `job_first_seen_at` | Observation timestamps at posting or combined-job level. | | `last_completed_fetch_at` | Last completed fetch timestamp on a posting, nullable. | | `curated_at` | Projection curation timestamp on the combined job. | | `job_updated_at` | Combined-job update timestamp used in jobs list ordering. | ## Currentness and stale `currentness` is `current`, `uncertain` or `not_current`. `stale` is a separate boolean label published with the job. A stale job stays in results; `stale=false` leaves stale jobs out. Filter on `currentness` for whether a job is still open, and read [currentness, status and changes](https://headcountlabs.com/docs/job-lifecycle/) for what each value means. ## How fresh is a job Headcount Labs says it re-checks every job daily. The API does not promise how soon a change at the source appears, so there is no freshness guarantee to build on. To see how recent a job’s data is, read `last_completed_fetch_at` on its postings, which says when the source was last read completely, and `job_updated_at`, which says when the job record last changed. To follow changes as they land, poll the [changes feed](https://headcountlabs.com/docs/ingestion-strategy/). ## Use explicit time boundaries Date filters require RFC 3339 values with a timezone. Usage-report periods specifically use UTC-Z timestamps and a from-inclusive, to-exclusive interval. Jobs filters use each parameter’s own timestamp parser; the usage-report interval rules apply to usage reports. ## Which date to filter on Each date filter reads a different field. Pick the one that matches your question. | You want | Filter | Field it reads | |---|---|---| | Jobs the employer published in a period | `posted_since`, `posted_until` | `postings[].source_posted_at`, the date the source says the posting was published. It can be null; a job without one does not match. | | Jobs that are new to Headcount Labs | `first_seen_since`, `first_seen_until` | `job_first_seen_at`, when any posting of the job was first collected. | | Everything that changed since your last pull | `updated_since`, `updated_until` | `job_updated_at`, when the job record last changed. For ongoing sync, the changes feed is better. | | Jobs that entered the final dataset in a period | `curated_since`, `curated_until` | `curated_at`. | | Jobs whose source was read recently | `last_fetch_since`, `last_fetch_until` | `postings[].last_completed_fetch_at`, when the posting's source was last read completely. | | Jobs you can still apply to | `application_check=available`, `application_check_since` | `postings[].latest_application_check`, the result and time of the latest application check. | Dates take an RFC 3339 timestamp with a time zone (`2026-09-21T00:00:00Z`) or a plain date (`2026-09-21`). For `posted_since` a plain date means the start of that day in UTC; for `posted_until` it means the end of that day in UTC. Common choices: a job board showing new openings uses `posted_since`; a pipeline that must not miss anything uses the [changes feed](https://headcountlabs.com/docs/ingestion-strategy/); a check of what is still open uses the default `currentness=current` with `application_check=available`. Source: https://headcountlabs.com/docs/freshness/ --- # Get started with Headcount Labs URL: https://headcountlabs.com/docs/getting-started/ # Get started with Headcount Labs Create a key, make a first request, read a full real job record, and fix the common errors. ## 1. Choose one useful result Start with a small task: find a page of roles, count matching jobs, or inspect one known combined job ID. Write down the title, region, source needs and required fields. The [jobs reference](https://headcountlabs.com/docs/jobs/) explains which route supports each task; filter support can differ between list and count routes. The [public sample explorer](https://headcountlabs.com/sample-data/) is useful for inspecting dated source snapshots without an account. ## 2. Open your account and create a key [Create an account](https://api.headcountlabs.com/data/signup) or [sign in](https://api.headcountlabs.com/data/login) on the separate API host, then open [API key management](https://api.headcountlabs.com/data/keys). Create an API key there; you send it as a bearer token. Every organization gets 100,000 records free each UTC calendar month, shared by all its keys. Past that you pay per record; see [pricing](https://headcountlabs.com/pricing/) and [rate limits](https://headcountlabs.com/docs/rate-limits/). ## 3. Prepare a safe request environment Use your own server or protected terminal, with credentials kept server-side. Set `HEADCOUNTLABS_BASE_URL` to `https://api.headcountlabs.com`. The request below contains a placeholder, not a usable key. Replace it only in your protected environment with a credential issued for your account; check [authentication](https://headcountlabs.com/docs/authentication/) first. This public website never asks you to enter a key and does not run API requests for you. Never send a password or API key by email, in a URL, or through the contact form. ## 4. Request a page of jobs ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs?currentness=current&limit=50" --header 'Authorization: Bearer ' ``` Set `HEADCOUNTLABS_BASE_URL` to `https://api.headcountlabs.com` and replace `` with your credential. A request without a valid key returns JSON `401`. The [code samples](https://headcountlabs.com/docs/code-samples/) show the same call in Python, Node.js, Ruby, PHP and curl, and [Which route should I use?](https://headcountlabs.com/docs/which-route/) helps you choose between a list, a search and an export. ## 5. Check the response before continuing This is a real job from the live API, as a list returns it. A list response also has `next_cursor` and `snapshot_watermark` next to `data`. The `company` and `source_data` objects appear only when you ask for them with `include=company,source_data`, and the description is shortened here. ``` { "data": [ { "job_id": "9f70ad16-ab51-49fe-b964-62067a7946b3", "currentness": "current", "stale": false, "company_id": "3483b509-5f22-4535-a907-19c285f3b460", "employer_name": { "state": "known", "value": "Cloudflare" }, "title": { "state": "known", "value": "Senior Customer Engineer, Strategic - San Francisco" }, "description": { "state": "known", "value": "(plain-text job description, left out here for length)" }, "work_arrangement": { "state": "known", "value": "hybrid" }, "locations": [ { "state": "known", "value": { "city": "San Francisco", "region": "US-CA", "country": "US", "county_fips": "06075", "msa": { "type": "metro", "cbsa_code": "41860", "cbsa_title": "San Francisco-Oakland-Fremont, CA" } } } ], "job_first_seen_at": "2026-10-07T19:31:45.114Z", "curated_at": "2026-10-13T07:33:18.049Z", "job_updated_at": "2026-10-14T23:30:26.947Z", "postings": [ { "posting_id": "79de47fa11a25e23ad485762a9a0fb1c09cca32f3ae3c108b7788734134d504c", "source": "greenhouse", "source_posting_id": "8246078", "posting_status": "listed", "posting_url": { "state": "known", "value": "https://boards.greenhouse.io/cloudflare/jobs/8246078?gh_jid=8246078" }, "application_url": { "state": "known", "value": "https://boards.greenhouse.io/cloudflare/jobs/8246078?gh_jid=8246078" }, "location": { "state": "known", "value": { "city": "San Francisco", "state": "CA", "remote": false, "country": "US" } }, "pay": { "state": "known", "value": { "max": 336000, "min": 214000, "currency": "USD", "interval": "year" } }, "source_posted_at": "2026-10-06T14:22:31.000Z", "first_seen_at": "2026-10-07T19:31:45.114Z", "last_completed_fetch_at": "2026-10-14T14:04:07.098Z", "latest_application_check": null, "attribution": { "required": null, "text": null, "link": null }, "source_data": { "job_location_type": "hybrid", "source_posted_at": "2026-10-06T14:22:31.000Z", "source_updated_at": "2026-10-14T00:57:01.000Z", "employment_type": null, "source_type": "greenhouse", "availability": "listed" } } ], "company": { "company_id": "3483b509-5f22-4535-a907-19c285f3b460", "name": "Cloudflare", "country": "US", "status": "active", "region": "CA", "address_source": "sec", "identifiers": [ { "scheme": "ein", "value": "270805829", "exchange": null, "source": "sec" }, { "scheme": "sec_cik", "value": "0001477333", "exchange": null, "source": "sec" }, { "scheme": "ticker", "value": "NET", "exchange": null, "source": "sec" }, { "scheme": "uei", "value": "JV9YXS9MLA48", "exchange": null, "source": "sam_gov" } ], "industries": [ { "system": "naics", "code": "541519", "source": "sam_gov" }, { "system": "sic", "code": "7372", "source": "sec" } ] } } ], "next_cursor": "", "snapshot_watermark": "2026-10-14T01:43:41.000Z" } ``` Check the HTTP status and content type before reading `data`. A successful empty `data` array is different from an error. Read `state` before `value` on every wrapped field, and keep `source_omitted` apart from a known value. Follow `next_cursor` as the [pagination guide](https://headcountlabs.com/docs/pagination/) describes; do not invent one. Every posting carries `attribution`. The [field dictionary](https://headcountlabs.com/docs/fields/) explains each field of this record. ## 6. Troubleshoot without sharing secrets For `401`, check that you sent a valid bearer key to the intended API host. For `403`, confirm the account entitlement. For `429`, follow returned retry guidance and the account policy rather than repeatedly retrying. A `503` can indicate unavailable source data or a service dependency. Route-specific meanings and recovery details are in [errors and response headers](https://headcountlabs.com/docs/errors/). If you need help, [prepare a support email](https://headcountlabs.com/contact/?topic=API%20documentation) to [support@headcountlabs.com](mailto:support@headcountlabs.com). Include the method and path, UTC time, status code, request ID if present, and redacted error text. Remove the Authorization header, credentials and private record content. The contact form opens a draft in your email app; you review it and choose whether to send. It does not submit a ticket or confirm delivery. ## Choose the route that matches the task [Jobs](https://headcountlabs.com/docs/jobs/) covers combined job records, counts, detail, and a changes feed. [Companies](https://headcountlabs.com/docs/companies/) covers the company registry and company job listing. [Usage reports](https://headcountlabs.com/docs/usage/) describe request and returned-record reporting. Source: https://headcountlabs.com/docs/getting-started/ --- # Recommended ingestion strategy URL: https://headcountlabs.com/docs/ingestion-strategy/ # Recommended ingestion strategy Load once, then sync with the changes feed: polling, catching up after an outage, and closed jobs. ## The short version - Load the jobs you want once with `GET /v1/jobs`. - From then on, read only what changed with `GET /v1/jobs/changes`. - Store the `resume_cursor` after every page you save, and write each job by its `job_id` so that reading an event twice does no harm. ## 1. First load Note the time, then page through `GET /v1/jobs` with your filters and `limit=250`, passing each `next_cursor` back as `cursor`. Without a search term the list is sorted by `job_updated_at`, newest first. Save each job under its `job_id`. ``` GET https://api.headcountlabs.com/v1/jobs?country=US&limit=250 GET https://api.headcountlabs.com/v1/jobs?country=US&limit=250&cursor= ``` Every page of one listing reads the same catalog snapshot (`snapshot_watermark`). If a new snapshot is published during your load, the next cursor returns `400`. Start that listing again from the first page. Jobs you already saved are simply written again, but you pay for the request again, so split a large load into smaller slices (for example one country, or one `updated_since` / `updated_until` range, at a time). Then a restart only repeats one slice. ## 2. Incremental sync with the changes feed Start the feed with `since` set to the time you began the first load, so nothing that changed during the load is missed. After that, pass the `resume_cursor` from each response as `after`. Keep reading while `has_more` is true. ``` GET https://api.headcountlabs.com/v1/jobs/changes?since=2026-10-07T00:00:00Z&limit=1000 GET https://api.headcountlabs.com/v1/jobs/changes?after=&limit=1000 ``` Each event has `event_id`, `job_id`, `type` (`created`, `updated` or `expired`) and `occurred_at`. Created and updated events carry the full `job`; replace your copy with it. Events come in order. `types` limits the feed to some event types and `company_id` to one company. Each event counts as one record. ## 3. How often to poll Every job is re-checked daily, so polling the changes feed every 15 to 60 minutes is enough for most products. A poll that finds no events uses one request and no jobs. Your request window (60 requests a minute, see [rate limits](https://headcountlabs.com/docs/rate-limits/)) is far above what polling needs. ## 4. Catching up after an outage Keep the last `resume_cursor` you stored and continue with `after`; the feed returns every event since that point, in order, so there is no gap. A cursor from an older catalog snapshot returns `400`. Then restart with `since` set a little before the `occurred_at` of the last event you saved, because `since` returns events strictly after that time. Skip events whose `event_id` you already applied. Because you write by `job_id`, an event applied twice leaves the same result, so there are no duplicates. On `503` with `service_unavailable` (the catalog changed during the request) or `catalog_unavailable`, retry shortly. On `429`, wait for `Retry-After`. ## 5. How closed jobs are signalled An `expired` event means the job left the open set: every posting of it is no longer listed, or it was withdrawn, or it was merged into another job. Expired events carry no `job` object. Mark the job closed in your copy. If you need the reason, call `GET /v1/jobs/{job_id}`: `308` means it merged into the job in `merged_into_job_id`, and `410` with `job_withdrawn` means it was withdrawn. On each job, `currentness` (`current`, `uncertain`, `not_current`), each posting's `posting_status` (`listed` or `no_longer_listed`), `latest_application_check` and the `stale` flag tell you how open it is. List and count routes return only `current` jobs unless you pass `currentness` or `active`. ## Checklist - Write jobs by `job_id`; never append blindly. - Store `resume_cursor` only after the page it came with is saved. - Keep the `occurred_at` and `event_id` of the last applied event as a fallback. - Handle 400 (restart), 429 (wait) and 503 (retry). - Pick the right date filter for the first load; see [which date to filter on](https://headcountlabs.com/docs/freshness/#which-date). ## Loading a large set as files For a first load of up to 100,000 jobs, an export can be simpler than paging. The [bulk download walkthrough](https://headcountlabs.com/docs/bulk-download/) shows the whole flow, and [Which route should I use?](https://headcountlabs.com/docs/which-route/) compares paging, the changes feed and exports. Source: https://headcountlabs.com/docs/ingestion-strategy/ --- # Counts and returned records URL: https://headcountlabs.com/docs/job-counts/ # Counts and returned records What a count returns, how it relates to list results, and how to use counts to plan a load. ## A count is one number `GET /v1/jobs/count` returns `{"count": 125432, "snapshot_watermark": "2026-10-14T01:43:41.000Z"}`. It counts distinct combined jobs, not postings, and takes the same filters as a list. It does not take paging, `fields`, `include`, `description_format` or change-feed parameters, and rejects them with `400`. ``` GET /v1/jobs/count?title_advanced=nurse%20AND%20NOT%20manager ``` ## Counts, rows, jobs and postings | Unit | What it is | Where you see it | |---|---|---| | Job | One combined opening with its own `job_id`. | The count, and each item in `data`. | | Posting | One listing of a job on one source. | Items inside `postings`. A job has one or more. | | Request | One call to the API. | Your free allowance, your bill and your per-minute limit. | | Returned job | A job in a successful list, search or detail response. | The size of `data`. | ## Why a count and your pages can differ Each count is computed at a catalog version, shown as `snapshot_watermark`. A list walk also reads one version, but if you page for a long time or run a count at another moment, a new version may have been published in between. Jobs can be added, updated or withdrawn between versions. Compare a count with a list only when they report the same watermark and use the same filters. The default `currentness=current` applies to both. ## Use counts to plan - Before a first load, count the slice you want to know how many pages or which route to use. A count over 100,000 is a sign to split the work or use [an export](https://headcountlabs.com/docs/bulk-download/). - Count each country, state or source in turn to see where the jobs are, then load them one slice at a time. - Count with `has_pay=true`, `has_location=false` and similar filters to measure how complete a field is before you build on it. - Use a count with `posted_since` to watch how many new jobs appear each day. ## What a count costs A count is one request. Filtered counts are billed at the filtered-list price and counts of keyword searches at the keyword-search price, after your free monthly allowance. They return no jobs, so they never use up job records. See the [pricing page](https://headcountlabs.com/pricing/) for the rate, and [rate limits](https://headcountlabs.com/docs/rate-limits/) for how the free allowance works. ## Slow counts A count that takes longer than 90 seconds is stopped and returns `503 query_too_broad`. It uses no allowance. Broad `q` text searches and long lists of common values are the usual cause. Use `title` instead of `q` for job titles, add a country, state, source or date range, and try again. Source: https://headcountlabs.com/docs/job-counts/ --- # Currentness, status, and changes URL: https://headcountlabs.com/docs/job-lifecycle/ # Currentness, status, and changes How currentness, posting status, application checks and the changes feed tell you whether a job is still open. ## Four fields describe whether a job is open | Field | Where | Values and meaning | |---|---|---| | `currentness` | Job | `current` while a linked posting is listed and accepting applications. `uncertain` when that cannot be confirmed. `not_current` when every linked posting is no longer listed. Searches return `current` jobs unless you ask otherwise. | | `posting_status` | Posting | `listed` while the source still shows the posting. `no_longer_listed` once a completed read of the source no longer finds it. This does not by itself prove that applications are open. | | `latest_application_check` | Posting | The result and time of the latest check of whether an application can be started: `available`, `closed`, `broken` or `inconclusive`. Null when the posting has not been checked. | | `stale` | Job | A boolean label published with the job. A stale job stays in results. Filter with `stale=true` or `stale=false`. | ## Choose the filter that matches your question | You want | Use | |---|---| | Open jobs only | The default, `currentness=current` | | Jobs that may be open | `currentness=current,uncertain` | | Closed jobs | `currentness=not_current` | | Jobs where you can start an application | `application_check=available` | | Jobs not flagged stale | `stale=false` | `active=true` is a shorter way to say `currentness=current`, and `active=false` means `not_current`. You cannot send `active` and `currentness` together. ## The changes feed `GET /v1/jobs/changes` returns events in order. Each has an `event_id`, the `job_id`, a `type` and `occurred_at`. | Type | Meaning | Carries the job? | |---|---|---| | `created` | The job entered the catalog. | Yes | | `updated` | Something about the job changed. | Yes | | `expired` | The job left the open set: all postings are no longer listed, it was withdrawn, or it was merged into another job. | No, only the ID and time | Start with `since`, then pass each `resume_cursor` back as `after` while `has_more` is true. The route can answer `503` while a new catalog version is being published; retry shortly. ## What a closed job looks like in the API - `GET /v1/jobs/{jobId}` on a job that was merged returns `308` with a `Location` header to the surviving job and a body with `merged_into_job_id`. - On a withdrawn job it returns `410` with code `job_withdrawn` and `no_longer_listed_at` in the body. - An unknown ID returns `404` with code `job_not_found`. ## Timestamps are different events `source_posted_at` is when the source says it published a posting. `first_seen_at` and `job_first_seen_at` are when Headcount Labs first collected it. `last_completed_fetch_at` is the last time a posting’s source was read completely. `curated_at` is when the job entered the final dataset, and `job_updated_at` is when it last changed. The [timestamps page](https://headcountlabs.com/docs/freshness/) explains which date filter reads which field. ## Show uncertainty to users Keep `currentness` and `posting_status` as separate values in your own data. Show `uncertain` jobs differently from `current` ones, keep the posting link so a person can verify, and do not treat a missing application check as a closed job. Source: https://headcountlabs.com/docs/job-lifecycle/ --- # Jobs endpoints URL: https://headcountlabs.com/docs/jobs/ # Jobs endpoints Methods, query behavior, response differences, and change retrieval for jobs. ## List jobs | Method | Path | Success envelope | Pagination | |---|---|---|---| | GET | `/v1/jobs` | `{data, next_cursor, snapshot_watermark}` | `limit` defaults to 50; valid range 1–250, or 1–1,000 when `fields` is exactly `job_id`. | One result is a combined `job_id` with its associated postings. By default, results sort by `job_updated_at` descending, then `job_id` descending; text-search requests default to relevance, and `sort=updated` selects updated order explicitly. The REST page limit is at most 250 (1,000 when `fields` is exactly `job_id`), while the MCP `search_jobs` tool takes pages of 10 to 100 jobs (default 50), or 10 to 25 with `descriptions: "full"`. For job titles use `title` rather than `q`: `q` is a broad full-text search of titles and descriptions and the slowest filter, and with narrow filters it can run past the 90-second limit (`503 query_too_broad`, no records used). The response serializer is list-specific; see [field shapes](https://headcountlabs.com/docs/data-fields/). ## Count jobs | Method | Path | Success envelope | Pagination | |---|---|---|---| | GET | `/v1/jobs/count` | `{count, snapshot_watermark}` | None. The route rejects pagination and change-feed parameters. | The count uses a distinct included-job count at a projection watermark. It is a separate request from list paging; a changing projection or query scope can make totals differ from a client’s accumulated pages. ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/count?company_id=12345678-1234-4234-8234-123456789abc¤tness=current" --header 'Authorization: Bearer ' ``` ## Read one job | Method | Path | Result | |---|---|---| | GET | `/v1/jobs/{jobId}` | One `{data: job}` envelope when found. Merged IDs return 308 and a merge envelope; withdrawn IDs return 410; unknown IDs return 404. | The identifier is a canonical lowercase UUID for the combined job. A posting identifier and source posting identifier refer to different records. Detail serialization differs from list serialization. ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/12345678-1234-4234-8234-123456789abc" --header 'Authorization: Bearer ' ``` ## Search with a JSON body `POST /v1/jobs/search` takes the same filters as `GET /v1/jobs` in a JSON body and returns the same envelope, with the same paging and the same cost. `country`, `employment_type` and `fields` can be arrays. Send `cursor` in the body to read the next page. ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/jobs/search" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"title":"nurse","country":["US","CA"],"employment_type":"full_time","fields":["job_id","title","locations"],"limit":50}' ``` ## Elasticsearch-style search `POST /v1/jobs/search/es_dsl` takes `{"query": ...}` in Elasticsearch query syntax, plus the usual `limit`, `cursor`, `sort`, `fields`, `include` and `description_format`. The query is translated to the list filters and run as the same search, so results, paging and cost match `POST /v1/jobs/search`. Supported clauses: `match_all`; `bool` with `must` and `filter`; `bool.should` over one field that accepts a list (`country`, `employment_type`); `bool.must_not` for `source` and for `exists`; `term`, `terms`, `match` and `match_phrase` on any list filter name; `range` on date and pay fields (`gt` and `lt` are treated as `gte` and `lte`); `exists` on a field with a `has_*` filter; and `query_string` or `simple_query_string` over title or description. These field names are also accepted: `created_at` (first seen), `last_updated` (updated), `keyword_description` (description), `company_name` (company), `application_active` and `deleted`. A clause or field outside this list returns `400` `invalid_request` and names it. ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/jobs/search/es_dsl" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"query":{"bool":{"must":[{"match":{"title":"nurse"}},{"terms":{"country":["US","CA"]}}],"filter":[{"range":{"created_at":{"gte":"2026-10-01"}}}]}},"limit":50}' ``` ## Bulk export to files `POST /v1/jobs/exports` writes every job matching a search to files, so you do not page through it. The body is a `POST /v1/jobs/search` body without `limit` and `cursor`, plus an optional `max_records` from 1 to 100,000 (the default). The response is `202` with an export object: `export_id`, `status` (`queued`, `running`, `completed`, `failed` or `expired`), `record_count`, `snapshot_watermark` and `files`. ``` curl --request POST "$HEADCOUNTLABS_BASE_URL/v1/jobs/exports" --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{"country":"CA","title":"nurse","fields":["job_id","title","locations"],"max_records":20000}' ``` Poll `GET /v1/jobs/exports/{exportId}` until `status` is `completed`, then download each entry in `files` from its `url`. A file is gzipped JSON lines: one job per line, shaped as the search would return it, with up to 10,000 jobs per file. Files are kept for 24 hours after the export completes. `GET /v1/jobs/exports` lists your 20 most recent exports. ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/exports/12345678-1234-4234-8234-123456789abc" --header 'Authorization: Bearer ' ``` ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/exports/12345678-1234-4234-8234-123456789abc/files/1" --header 'Authorization: Bearer ' --output jobs-1.jsonl.gz ``` An export is counted when it completes, as one list request for every 100 jobs written (at least one). A failed export uses nothing, and export requests do not count toward the per-minute rate limit. The [bulk download walkthrough](https://headcountlabs.com/docs/bulk-download/) shows the steps. An account can run one export at a time; a second request returns `409` `export_in_progress`. A job that changes while an export runs can be missing from it: to catch up, read `GET /v1/jobs/changes` with `since` set to the export's `created_at`. If the whole catalog is republished while an export runs, the export fails with a message asking you to create it again. ## Read job changes `GET /v1/jobs/changes` is available with an API key. Start with a `since` timestamp or continue with the opaque `after` cursor. The response contains `data`, `resume_cursor`, `has_more`, and `snapshot_watermark`; created and updated events can include a job, while expired events identify the job and event time. The route can return 503 if the projection is unavailable or changes during the request. ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs/changes?after=opaque_cursor_example&limit=100" --header 'Authorization: Bearer ' ``` ## Request example ``` curl --request GET "$HEADCOUNTLABS_BASE_URL/v1/jobs?currentness=current&limit=50" --header 'Authorization: Bearer ' ``` The list response contains combined jobs and their postings. Source: https://headcountlabs.com/docs/jobs/ --- # MCP tools URL: https://headcountlabs.com/docs/mcp-tools/ # MCP tools Every tool on the Headcount Labs MCP server (28 after sign-in, 9 keyless), what it does, the scope it needs, whether it uses records, and which call to make for common requests. ## Tools The MCP server at `https://api.headcountlabs.com/mcp` has 28 tools after you sign in; the ChatGPT and Claude directory listings show 27 (they leave out `set_overage`). Without signing in, only `search_docs` works on that URL. A separate keyless endpoint, `https://api.headcountlabs.com/mcp/public`, has nine read-only tools: `search_docs`, `search_jobs`, `get_job`, `count_jobs`, `market_lookup`, `market_breakdown`, `salary_range`, `market_dimensions` and `list_fields`. `market_insights` is no longer served. Tools that return jobs, companies or change events count one record for each item returned, against your free monthly allowance and then the [per-record prices](https://headcountlabs.com/pricing/); the Uses records column says which. Counts, field lists, docs, usage and file reads are free. The Access column gives the OAuth scope each tool needs. The Class column labels each tool the way AI assistant directories do: Read tools only return information, Write tools change a setting or create something on your account, and the one Sensitive write tool, `set_overage`, can lead to charges, so your assistant should ask you every time before it calls it. Every tool on `/mcp/public` is Read. **Paging.** `search_jobs`, `search_jobs_json`, `search_jobs_dsl`, `list_company_jobs`, `list_companies`, `search_companies` and `list_job_changes` take two paging inputs. `limit` is the page size, a whole number from 10 to 100 (default 50). `max_results` is the most results one search returns across all its pages, a whole number from 10 to 1,000 (default 250). Set both on the first call and keep them the same on every page: the cursor carries them. A value outside the range is refused with a message that names the range. A search that reaches `max_results` returns `next_cursor: null` and a note; to read more, start a new search with a larger `max_results` or narrower filters. Each page is its own request and is charged for the results it returns, so spend caps and the confirmation level apply page by page. The keyless `/mcp/public` endpoint pages differently (see Endpoints and profiles). Bulk downloads of the full job dataset are coming soon. Public subsets of it (ODbL 1.0) are at https://huggingface.co/HeadcountLabs. | Tool | Uses records | Access | Class | What it does | Example prompts | |---|---|---|---|---|---| | `search_docs` | No | No sign-in needed. Also on `/mcp/public`. | Read | Answers a question about Headcount Labs (filters, limits, pricing, MCP setup, errors) with the best-matching sections of the headcountlabs.com docs, each with its URL. Input: `question` (up to 500 characters) and `limit` (1 to 10, default 5). It is the one tool that works before you sign in. | “How do I filter Headcount Labs jobs by pay?”“What happens when I use up my free records?” | | `search_jobs` | Yes. One record per job it returns, including every job written to a file. | `jobs:read`. A smaller version is on `/mcp/public`. | Read | Searches jobs with any `/v1/jobs` filter (about 55 names; `list_fields` lists them), passed in `filters`; `remote: true` is shorthand for `work_arrangement: "remote"`. Other inputs: `fields` (top-level job properties, `job_id` is always included), `limit` (the page size, 10 to 100, default 50), `max_results` (the most jobs one search returns across all its pages, 10 to 1,000, default 250; set it on the first call, the cursor keeps it; with `descriptions: "full"` the page size is 10 to 25), `cursor`, `sort` (`relevance`, `updated` or `random`), `seed` (repeat a random order), `descriptions` (`snippet` by default, cut to 400 characters with `description_truncated: true`; `full` returns the whole text), `view` (`compact` by default; `full` returns every field, see Compact results below) and `confirmed`. Each result has a `usage` object with `jobs_used_this_call` and the jobs you have left. For a large result set, pass `deliver_file: true` and `max_jobs` (1 to 5,000, default 1,000): the jobs are written to a JSONL file with a download link that works for one hour, a `file_id` for `read_file`, and a 25-job preview. If one search would return more than your confirmation level (25% by default), the call stops with `confirmation_required` and your agent asks you first. On `/mcp/public` the inputs are `filters`, `fields`, `limit` (1 to 50, default 10; 1 to 10 when `descriptions` is `full`), `cursor`, `sort` (`relevance` or `updated`) and `descriptions`, and one search returns at most 250 jobs. | “Find remote data engineer jobs in Germany posted this week.”“Get every open nursing job in Texas as a file.” | | `get_job` | Yes. One record. | `jobs:read`. Also on `/mcp/public`. | Read | Returns one job by its `job_id`, with every linked posting and its source URLs. `include_source_data: true` adds each posting's source data, and `fields` selects top-level properties. A merged job is followed to the job it merged into (up to 5 hops). | “Show me the full record for job 0b7c…, including every source posting.” | | `count_jobs` | No. It returns a number, not records. | `jobs:read`. Also on `/mcp/public`. | Read | Counts jobs that match the same `filters` as `search_jobs`. Use it to size a search before fetching it. `group_by: "employer"` also returns the top 25 employers behind the matching jobs, each with `employer_name`, `company_id` and `jobs`. | “How many software engineer jobs in Canada were posted since October 1?”“Which companies are hiring the most nurses in Ohio?” | | `list_fields` | No | Any sign-in. Also on `/mcp/public`. | Read | Lists the `search_jobs` filters and the job fields whose name or description contains your keywords (up to 20 words; none lists everything), with each one's type and a short description. A field state says whether the source published the value, we derived it, the source left it out, or extraction failed. | “Which filters can I use for pay and remote work?” | | `read_file` | No. The jobs were counted when the file was made. | `jobs:read` | Read | Reads jobs from a file that `search_jobs` delivered, by `file_id`, `offset` and `limit` (1 to 100, default 25), and returns a fresh one-hour download link. Descriptions are cut to 400 characters unless `descriptions: "full"`; the downloaded file always has them in full. Files last 24 hours. | “Show me jobs 100 to 200 from the file you just made.” | | `market_lookup` | No | Keyless `/mcp/public` only. Signed in, use `market_insights`. | Read | Job count, pay percentiles, share of jobs showing pay, remote/hybrid/in-person shares, posting age, new postings or top employers for up to two of title, place, company, seniority, employment type and remote. Leave `metric` out for every figure. Answers come from a daily snapshot of open US jobs and include an `as_of` date. For a current job count or who is hiring right now, use `count_jobs`. Cells with fewer than 30 jobs are left out. Inputs: `title`, `role`, `place`, `company`, `seniority`, `employment_type`, `remote`, `metric`. | “What is the median pay for registered nurses in Texas?” | | `market_breakdown` | No | Keyless `/mcp/public` only. Signed in, use `market_insights`. | Read | Ranks one dimension (`by`: title, state, city, company, seniority, employment type or remote) by jobs, pay or another figure, for all open US jobs or inside one filter. Same daily snapshot and `as_of` date as `market_lookup`. Inputs: `by`, `sort`, `limit`, `title`, `role`, `place`, `company`, `seniority`, `employment_type`, `remote`. | “Which states pay software engineers the most?” | | `salary_range` | No | Keyless `/mcp/public` only. Signed in, use `market_insights`. | Read | Posted-pay percentiles (25th, 50th, 75th, 90th) and a recommendation for a title, a place (US if omitted) and an optional seniority. Same daily snapshot and `as_of` date. Cells with fewer than 30 jobs are left out. Inputs: `title`, `role`, `place`, `seniority`. | “What salary should I ask for as a software engineer in Austin?” | | `market_dimensions` | No | Keyless `/mcp/public` only. Signed in, use `market_insights`. | Read | Lists what `market_lookup`, `market_breakdown` and `salary_range` accept: the dimensions, how many values each has, and the metrics. Pass `dimension` and optionally `q` for the values of one dimension. Inputs: `dimension`, `q`, `limit`. | “Which seniority values can I ask about?” | | `verify_jobs` | Yes. Each sampled job counts as one record. | `jobs:read` | Read | Spot-checks Headcount Labs data against the original postings. Picks `sample_size` random current jobs (1 to 50, default 20) that match optional `filters`, opens each posting page once (at most 2 pages a second, 10-second timeout, user agent `HeadcountLabsVerifier`) and reports whether the link works, whether the job is still open, and whether title, employer, location and pay match the page. A check is `null` when it could not be made. `seed` draws the same sample again; `confirmed` answers a confirmation prompt. Only the postings' own pages are fetched. | “Spot-check 20 random jobs against their original postings.” | | `compare_sources` | Yes. Each matched job counts as one record. | `jobs:read` | Read | Compares your own job list with Headcount Labs. Pass `rows` (up to 500, each with `url`, or `company`, `title` and `location`) or `text` (up to 200,000 characters of CSV, TSV or one posting URL per line). Each row is matched by posting URL first, then by company, title and location, and gets a status: `have_current`, `have_closed`, `have_unpublished` or `missing` with a likely reason. Rows without a URL are matched for the first 50 different company and title pairs in a call. The list is used for this call only and is not stored. | “Compare this CSV of our open roles with Headcount Labs.” | | `get_usage` | No | `jobs:read` or `usage:read` | Read | Reports your plan, records used, limits and windows, what remains of your allowance, when it resets, API requests used and left, your confirmation level and (on the full server) your overage status. It works when the allowance is used up. | “How much of my Headcount Labs allowance is left?” | | `set_confirmation_level` | No | `overage:write` | Write | Sets the percent of your allowance that one search may return before `search_jobs`, `verify_jobs` or `compare_sources` asks you to confirm. Input: `percent`, a whole number from 0 to 100. The default is 25; 0 turns the question off; 100 asks only when a search would pass the whole allowance. Agents change it only when you ask. | “Don't ask me before large searches any more.”“Ask me before any search that uses more than 10% of my allowance.” | | `set_overage` | No | `overage:write`. Not on the ChatGPT and Claude directory listings. | Sensitive write | Turns overage on or off and sets an optional monthly limit in dollars. Inputs: `enabled` and `monthlyLimitUsd` (the most overage may cost in a month, in dollars; `null` clears it). With overage off (the default), searches stop when your allowance is used up; with it on, usage past the allowance is billed at month end, until the limit is reached. Only accounts on older monthly billing have overage; pay-per-use accounts pay per record up to their spend cap instead. Agents change it only when you ask. | “Turn on overage so my searches keep working past my free records.”“Don't let overage cost more than $25 a month.” | | `get_overage` | No | `usage:read` | Read | Reads whether overage is on, and the current usage and limit fields. It is a status read and costs nothing. | “Is overage turned on for my account?” | | `search_jobs_json` | Yes. One record per job returned (REST rules). | `jobs:read` | Read | Sends the public job filters as a JSON body to `POST /v1/jobs/search`: each filter is a top-level input, not nested in `filters`. Also takes `limit` (10 to 100, default 50), `max_results` (10 to 1,000, default 250), `cursor`, `sort` (`relevance`, `updated` or `random`), `seed`, `fields`, `include` (`company`, `source_data`) and `description_format` (`text` or `html`). Cursors and errors match the REST route; the page size and the per-search cap follow the paging rules above. | “Search jobs with title nurse in Ohio and include the company record.” | | `search_jobs_dsl` | Yes. One record per job returned (REST rules). | `jobs:read` | Read | Runs the supported Elasticsearch-style clauses through `POST /v1/jobs/search/es_dsl`. Inputs: `query` (the clause object), `limit`, `max_results`, `cursor`, `sort` (`relevance` or `updated`), `fields`, `include` and `description_format`. Unsupported clauses return `invalid_request`. See the [query language](https://headcountlabs.com/docs/query-language/). | “Run this Elasticsearch-style query against the jobs.” | | `list_job_changes` | Yes. One record per change event returned (REST rules). | `jobs:read` | Read | Reads the public change feed (`GET /v1/jobs/changes`): jobs that are new, updated or expired. Inputs: `since` or `after` (resume with the cursor from the last page, unchanged), `type` (any of `new`, `updated`, `expired`), `company_id`, `limit` (10 to 100, default 50), `max_results` (10 to 1,000, default 250; it counts changes while the feed has more, then the plain `resume_cursor` comes back with a note) and `include` (`source_data`). A stale or invalid cursor returns `invalid_request`. | “What jobs expired since yesterday?” | | `list_companies` | Yes. One record per company returned. | `companies:read` | Read | Browses published company records. Inputs: `name`, `format` (`json` or `csv`), `limit` (10 to 100, default 50), `max_results` (10 to 1,000, default 250) and `cursor` (pass `next_cursor` unchanged). | “List companies whose name starts with Sales.” | | `search_companies` | Yes. One record per company returned. | `companies:read` | Read | Searches published companies by `name`, `country` (two letters) and `status` (`active`, `retired` or `merged`), with `limit` (10 to 100, default 50), `max_results` (10 to 1,000, default 250) and `cursor`. | “Find active companies in Germany with data in the name.” | | `get_company` | Yes. One record. | `companies:read` | Read | Reads one company record by `company_id`. A merged company ID returns the API's redirect response. | “Look up Salesforce's company record.” | | `list_company_jobs` | Yes. One record per job returned. | `companies:read` | Read | Lists the published jobs of one company by `company_id`, with the same `filters`, `limit`, `max_results`, `cursor`, `sort` and `fields` as `search_jobs_json`. | “Show open jobs at this company.” | | `create_job_export` | Yes. A completed export counts one record for every job it writes. | `jobs:read` | Write | Starts an asynchronous gzip JSONL export through `POST /v1/jobs/exports`. Takes the job filters as top-level inputs plus `max_records` (1 to 100,000), `fields`, `include`, `description_format` and `sort`. `limit` and `cursor` are rejected. Signed download links are never returned; read the files with `read_job_export_file`. To download the whole dataset instead, use the bulk download linked above. | “Export every open nursing job in Texas.” | | `list_job_exports` | No | `jobs:read` | Read | Lists up to 20 recent exports for the account. File links and signed secrets are left out. | “Show my recent exports.” | | `get_job_export` | No | `jobs:read` | Read | Reads the status and file list of one export by `export_id`. | “Is export 7f3c… finished?” | | `read_job_export_file` | No. The jobs were counted when the export was made. | `jobs:read` | Read | Reads one file of a finished export, `export_id` and `file_number`, and returns the decompressed job records. A file holds up to 10,000 jobs. | “Read file 1 of that export.” | | `get_usage_requests` | No | `usage:read` | Read | Lists the account's API requests for a UTC window of at most 31 days: `from` and `to` (ISO times), `limit` (1 to 100, default 50), `cursor`, and filters `route_class` and `api_key_id`. Oversized reports return `report_too_large`. | “Show my API requests from the last 24 hours.” | | `get_usage_analytics` | No | `usage:read` | Read | Summarizes the account's API requests for a UTC window of at most 31 days, optionally grouped (`group_by`: `route_class`, `status_class` or `api_key_id`). | “Break down my API use this month by key.” | | `market_insights` | No | Any sign-in. Not on `/mcp/public` (use the four market tools there). | Read | Job-market figures from a daily snapshot of open US jobs, with an `as_of` date: pay, remote share, posting age and rankings. `question` picks a ready-made metric, a lookup, a breakdown, a salary ask or a dimensions list; other inputs are `role`, `title`, `place`, `company`, `seniority`, `employment_type`, `remote`, `metric`, `by`, `sort`, `limit`, `dimension` and `q`. Cells with fewer than 30 jobs are left out. For a live count use `count_jobs`. | “What do data analysts earn in Chicago?” | | `get_job_history` | No | `jobs:read` | Read | Returns when a job was first seen, when each of its public postings was first seen, and the job's last update time, by `job_id`. Past versions of jobs are not served: the version list is empty and `history_served` is false. A merged job answers 410 with `successor_job_id`. | “When was job 0b7c… first posted?” | | `count_cohort_jobs` | No | `jobs:read` | Read | Counts one explicitly selected partial job cohort by `cohortId`, with facets and snapshot metadata. It is separate from `count_jobs`, accepts no other filters and makes no claim about the full or current catalog. | “How many jobs are in cohort X?” | ## Endpoints and profiles | Address | What it is | |---|---| | `https://api.headcountlabs.com/mcp` | The full server. Needs OAuth sign-in. Without a token it answers `401` with a `WWW-Authenticate` header that points at the OAuth discovery document, except that a `tools/call` of `search_docs` is answered without signing in. | | `https://api.headcountlabs.com/mcp/public` | No sign-in and no key. Nine read-only tools (`search_docs`, `search_jobs`, `get_job`, `count_jobs`, `market_lookup`, `market_breakdown`, `salary_range`, `market_dimensions`, `list_fields`). `market_insights` is no longer served. No pricing wording, and no account or records used. One search returns at most 250 jobs, `limit` 1 to 50 per page, default 10 (1 to 10 with full descriptions), and no `max_results` (`search_jobs` then returns `next_cursor: null` with a note, or fails with `search_limit_reached`). Limits: 20 tool calls a minute and 1,000 a day per conversation, 600 a minute per network (shared by every conversation on it), and a site-wide daily budget; a refusal is `rate_limited` with `retry_after_seconds`. `initialize` returns the `Mcp-Session-Id` to send back. | | `https://api.headcountlabs.com/mcp?profile=chatgpt` and `?profile=claude` | The listings for the ChatGPT and Claude directories: the same 25 tools without `set_overage`, and without pricing wording, `upgrade_url` or the verify and compare offers. Other `profile` values are ignored. | The transport is stateless Streamable HTTP with JSON responses: send `POST`; `GET` answers `405` with `Allow: POST`. A request body can be up to 256 KB. ## Set up your client Use the server URL `https://api.headcountlabs.com/mcp` in every client and sign in when prompted. ### Claude Code ```sh claude mcp add --transport http headcountlabs https://api.headcountlabs.com/mcp # then run /mcp inside Claude Code and choose Authenticate ``` Add the server, then sign in from inside Claude Code. Add `--scope user` to make it available in every project. ### Claude on the web and Claude Desktop 1. Open Settings, then Connectors. 2. Choose Add custom connector, name it Headcount Labs and paste the server URL. 3. Choose Connect and sign in. The same steps work on claude.ai and in Claude Desktop. ### ChatGPT 1. Settings, Apps, Advanced settings: turn on Developer mode. 2. Create an app with the server URL. 3. Choose OAuth and sign in. [Step by step](https://headcountlabs.com/mcp/chatgpt/). ### Cursor ```json { "mcpServers": { "headcountlabs": { "url": "https://api.headcountlabs.com/mcp" } } } ``` Put this in `~/.cursor/mcp.json` (or `.cursor/mcp.json` in one project), then open Cursor Settings, MCP, and sign in to headcountlabs when prompted. ### VS Code with GitHub Copilot 1. Run MCP: Add Server from the command palette. 2. Choose HTTP and enter the server URL; name it headcountlabs. 3. Pick the user (global) scope and sign in when prompted. Or add it by hand to `mcp.json`: `{"servers": {"headcountlabs": {"type": "http", "url": "https://api.headcountlabs.com/mcp"}}}`. ### Codex ```sh codex mcp add headcountlabs --url https://api.headcountlabs.com/mcp codex mcp login headcountlabs ``` Add the server, then sign in. `codex mcp list` shows whether it is signed in. ### Windsurf ```json { "mcpServers": { "headcountlabs": { "serverUrl": "https://api.headcountlabs.com/mcp" } } } ``` Put this in `~/.codeium/windsurf/mcp_config.json`, then refresh the MCP list in Windsurf and sign in. ### Grok 1. Go to grok.com/connectors. 2. Choose New Connector, then Custom. 3. Paste the server URL and sign in when asked. [Step by step](https://headcountlabs.com/mcp/grok/). ### Gemini CLI ```json { "mcpServers": { "headcountlabs": { "command": "npx", "args": ["mcp-remote", "https://api.headcountlabs.com/mcp"] } } } ``` Put this in `~/.gemini/settings.json`, start Gemini CLI and run `/mcp list`. The `mcp-remote` helper opens the browser sign-in. ### Any other MCP client Use the URL `https://api.headcountlabs.com/mcp` as a remote (Streamable HTTP) server with OAuth. If a client only supports stdio, run `npx mcp-remote https://api.headcountlabs.com/mcp`. Clients that cannot sign in can use the keyless `https://api.headcountlabs.com/mcp/public` for read-only job search. ## Which tool to call What a user might say, the call an agent should make, and the rule behind it. Every call below was run against the live MCP server on October 9, 2026: 36 of 36 returned the expected result. Five cases (the next page, job details, raw source data, full descriptions and company details examples) now use `limit` 10, the smallest page size, and were not run again after that change. The calls that change billing were not run. The tools added since that test run (`market_lookup`, `market_breakdown`, `salary_range` and `market_dimensions`, which replaced `market_insights`, plus `verify_jobs`, `compare_sources`, `get_overage` and the search, company, export and usage-report tools) are described in the tool table and were checked against the server code, not run. `{{today-7}}` means the date seven days ago, and `{{prev.job_id}}` a value from the previous call's result. The same key is at [/docs/mcp-answer-key.json](https://headcountlabs.com/docs/mcp-answer-key.json) for agents and test harnesses. | User says | Call | Why | |---|---|---| | “How many jobs do you have?” | ``` count_jobs {} ``` | No filters counts every published job. | | “How many nursing jobs are there in California?” | ``` count_jobs {"filters": {"title": "nurse", "state": "CA"}} ``` | state alone means a U.S. state, as a two-letter code. | | “How many open jobs does Salesforce have?” | ``` count_jobs {"filters": {"company": "salesforce", "active": true}} ``` | company matches the employer name as text; active=true keeps jobs whose currentness is current. | | “Find remote software engineer jobs.” | ``` search_jobs {"filters": {"title_advanced": "\"software engineer\" OR \"software developer\"", "work_arrangement": "remote"}, "limit": 10} ``` | Remote is work_arrangement=remote, not a word search. title_advanced catches the common title variants. | | “Show me senior software engineer jobs.” | ``` search_jobs {"filters": {"title_advanced": "senior AND (\"software engineer\" OR \"software developer\")"}, "limit": 10} ``` | title matches the words as one phrase in order, so title="senior software engineer" misses "Software Engineer, Senior". Use title_advanced. | | “What jobs is Salesforce hiring for?” | ``` search_jobs {"filters": {"company": "salesforce", "active": true}, "limit": 10} ``` | company is a case-insensitive contains match on the employer name. | | “Jobs posted in Texas in the last week.” | ``` search_jobs {"filters": {"state": "TX", "posted_since": "{{today-7}}"}, "limit": 10} ``` | posted_since is the date the source published the job; a plain date works. | | “Data analyst jobs paying at least $100k a year.” | ``` search_jobs {"filters": {"title": "data analyst", "pay_min": 100000}, "limit": 10} ``` | pay_min is yearly; hourly pay is converted at 2,080 hours. | | “Jobs in Toronto.” | ``` search_jobs {"filters": {"city": "Toronto", "country": "CA"}, "limit": 10} ``` | Add country for a city outside the U.S. CA as a country is Canada. | | “Jobs in Ontario, Canada.” | ``` search_jobs {"filters": {"state": "ON", "country": "CA"}, "limit": 10} ``` | A non-U.S. state or province needs country too; state=ON alone would mean a U.S. state. | | “Part-time jobs in New York City.” | ``` search_jobs {"filters": {"employment_type": "part_time", "city": "New York", "state": "NY"}, "limit": 10} ``` | employment_type is an exact value such as full_time or part_time. | | “Hybrid product manager roles.” | ``` search_jobs {"filters": {"title": "product manager", "work_arrangement": "hybrid"}, "limit": 10} ``` | work_arrangement is remote, hybrid or in_person. | | “Jobs that mention Kubernetes.” | ``` search_jobs {"filters": {"description": "kubernetes"}, "limit": 10} ``` | description searches the job text; q searches title or description. | | “Jobs that need Python but not Java.” | ``` search_jobs {"filters": {"description_advanced": "python AND NOT java"}, "limit": 10} ``` | description_advanced takes AND, OR, NOT and parentheses. | | “Anything about machine learning.” | ``` search_jobs {"filters": {"title": "machine learning"}, "limit": 10} ``` | For job titles use title, which is fast. q searches every word of titles and descriptions, ranked by relevance; it is the slowest filter and can run past the 90-second limit with a narrow filter such as a small country, so use it only when the words must also be in descriptions. | | “Only show jobs that are still open.” | ``` search_jobs {"filters": {"title": "accountant", "currentness": "current"}, "limit": 10} ``` | currentness=current (or active=true) keeps jobs the latest read still found. | | “Leave out stale jobs.” | ``` search_jobs {"filters": {"title": "accountant", "stale": false}, "limit": 10} ``` | stale=false filters stale jobs out. | | “Jobs from Greenhouse boards only.” | ``` search_jobs {"filters": {"source": "greenhouse"}, "limit": 10} ``` | source is the vendor name in lower case. | | “Marketing jobs that list a salary.” | ``` search_jobs {"filters": {"title": "marketing", "has_pay": true}, "limit": 10} ``` | has_pay=true keeps jobs with a posting that publishes pay. | | “Only jobs where I can still apply.” | ``` search_jobs {"filters": {"title": "nurse", "application_check": "available"}, "limit": 10} ``` | application_check is available, closed, broken or inconclusive; available means an application could still be started. | | “How many jobs have a broken application link?” | ``` count_jobs {"filters": {"application_check": "broken"}} ``` | Expect 0. A broken or closed apply check takes that posting out of the current set, so a job with no other current posting is withdrawn and never reaches the public data. A count above 0 would mean withdrawn jobs are leaking into the public set. To find jobs whose apply link is still open, use application_check "available". | | “Jobs that were taken down.” | ``` search_jobs {"filters": {"posting_status": "no_longer_listed"}, "limit": 10} ``` | posting_status=no_longer_listed means a complete read of the source no longer found the posting. | | “What changed since yesterday?” | ``` search_jobs {"filters": {"updated_since": "{{today-1}}"}, "sort": "updated", "limit": 10} ``` | updated_since with sort=updated is the incremental pull. | | “Show me the next page.” | ``` search_jobs {"filters": {"title": "nurse"}, "limit": 10} search_jobs {"filters": {"title": "nurse"}, "limit": 10, "cursor": "{{prev.cursor}}"} ``` | Repeat the same filters with the cursor from the last result. | | “Tell me everything about that job.” | ``` search_jobs {"filters": {"title": "pharmacist"}, "limit": 10} get_job {"job_id": "{{prev.job_id}}"} ``` | get_job returns one job with every linked posting and the full description. | | “Show me the raw source data for that job.” | ``` search_jobs {"filters": {"title": "pharmacist"}, "limit": 10} get_job {"job_id": "{{prev.job_id}}", "include_source_data": true} ``` | include_source_data adds each posting's source fields. | | “Give me the full descriptions, not snippets.” | ``` search_jobs {"filters": {"title": "paralegal"}, "limit": 10, "descriptions": "full"} ``` | Descriptions are cut to 400 characters unless descriptions=full. | | “Export the first 200 nurse jobs in Ohio as a file.” | ``` search_jobs {"filters": {"title": "nurse", "state": "OH"}, "deliver_file": true, "max_jobs": 200} ``` | A search returns up to 250 jobs by default, 50 a page; set max_results (up to 1,000) on the first call for more, or use deliver_file with max_jobs for a bigger pull. | | “Read the next 25 jobs from that file.” | ``` search_jobs {"filters": {"title": "nurse", "state": "OH"}, "deliver_file": true, "max_jobs": 200} read_file {"file_id": "{{prev.file_id}}", "offset": 25, "limit": 25} ``` | read_file pages through a delivered file for free for 24 hours. | | “How much of my allowance is left?” | ``` get_usage {} ``` | get_usage is free and works even when the allowance is used up. | | “How many API requests have I used?” | ``` get_usage {} ``` | The same call reports requests used and remaining. | | “What filters are there for pay?” | ``` list_fields {"keywords": ["pay"]} ``` | list_fields is free; pass keywords to narrow it. | | “What happens when I use up my free jobs?” | ``` search_docs {"question": "What happens when I use up my free jobs for the day?"} ``` | Questions about pricing, limits and setup go to search_docs, which is free. | | “How do I connect Headcount Labs to Claude?” | ``` search_docs {"question": "How do I connect the MCP server to Claude?"} ``` | Setup questions go to search_docs. | | “Stop asking me before big searches.” | ``` set_confirmation_level {"percent": 0} set_confirmation_level {"percent": 25} ``` | Only when the user asks. 0 turns the question off; the runner puts it back to 25. | | “Turn on overage.” | ``` set_overage {"enabled": true} ``` | Only when the user asks. It changes billing, so the runner does not call it; an account without paid access gets an upgrade_url. | | “Don't let overage cost more than $25 a month.” | ``` set_overage {"monthlyLimitUsd": 25} ``` | monthlyLimitUsd caps overage dollars a month; null clears it, and leaving it out keeps the current limit. Only when the user asks; the runner does not call it. | | “Show Salesforce jobs with the company details.” | ``` search_jobs {"filters": {"company": "salesforce", "include": "company"}, "limit": 10} ``` | include=company adds the linked company record to each job. | | “What's the average salary for nurses?” | ``` market_lookup {"title": "Registered Nurse", "metric": "pay"} ``` | market_lookup answers pay questions from a daily snapshot of open US jobs and is free. The answer includes its as_of date. Do not average a sample of search results and present it as the market figure. For a live job count, use count_jobs. | | “Look up Salesforce's company record.” | ``` search_companies {"name": "salesforce"} get_company {"company_id": "{{prev.company_id}}"} ``` | Company tools need the companies:read scope, and each company returned is one record. search_jobs with include=company adds the company record to each job without the scope. | ## Common mistakes - Filters go inside `filters`: `{"filters": {"title": "nurse"}}`, not `{"title": "nurse"}`. There is no `query` filter; the keyword filter is `q`. `list_fields` (free) lists every filter name. - `title` matches the words as one phrase in order, so `senior software engineer` misses “Software Engineer, Senior”. Use `title_advanced` with AND, OR and NOT. - Remote work is `work_arrangement: "remote"` (or hybrid, in_person), not a word search. - `state` on its own is a U.S. state. For a province or another country's region, add `country`: `{"state": "ON", "country": "CA"}`. - A search returns up to 250 jobs by default, 50 a page. Set `max_results` (up to 1,000) on the first call for more. For a bigger pull, use `deliver_file: true` with `max_jobs`, then `read_file`. - Size a search with `count_jobs` first; it uses no jobs. ## How jobs are counted `search_jobs` and `get_job` count one record for each job they return, including every job in a delivered file. `verify_jobs` counts the jobs it samples and `compare_sources` the jobs it matches. `list_companies`, `search_companies`, `get_company`, `list_company_jobs`, `search_jobs_json`, `search_jobs_dsl` and `list_job_changes` count one record for each company, job or change event returned, and a completed export counts one record for every job it writes. `count_jobs`, `list_fields`, `read_file`, `read_job_export_file`, `list_job_exports`, `get_job_export`, `market_lookup`, `market_breakdown`, `salary_range`, `market_dimensions`, `search_docs`, `get_usage`, `get_overage`, `get_usage_requests`, `get_usage_analytics`, `set_confirmation_level` and `set_overage` cost nothing. The `usage` object on each `search_jobs` and `get_job` result shows `jobs_used_this_call` and the records you have left. The API and the MCP server share one free monthly allowance and the same prices; see [rate limits and free allowance](https://headcountlabs.com/docs/rate-limits/). ## Confirmation before large searches One search is the first `search_jobs` call plus every call that passes its `next_cursor`, or one file delivery. When the next page would take that search past your confirmation level, the call returns an error with `http_status` 409 and code `confirmation_required`, and uses no jobs. The error carries `jobs_returned_so_far`, `next_page_size`, `threshold_jobs`, `level_percent`, the monthly or daily limit and `jobs_remaining`. Your agent should ask you, then repeat the call with `confirmed: true`. `verify_jobs` and `compare_sources` ask the same way. The level belongs to your account, not to one key. ## Sign-in and access MCP clients sign in with OAuth 2.1 in your browser: the client finds the server's metadata at `/.well-known/oauth-protected-resource/mcp` and `/.well-known/oauth-authorization-server`, registers itself at `/api/oauth/register` (dynamic client registration, public client, PKCE `S256`, https or loopback redirect addresses, at most 5), sends you to `/oauth/authorize` and gets tokens from `/api/oauth/token`. You sign in with Google or an email and password, then approve the scopes on the consent page. The sign-in code lasts 60 seconds and works once. The access token lasts one hour; the client refreshes it with a 30-day refresh token that rotates each time, and reusing an old refresh token revokes the connection. Each connection shows up as an API key labeled `MCP: ` on [api.headcountlabs.com/data/keys](https://api.headcountlabs.com/data/keys); delete it there to disconnect. A customer-created API key also works as a bearer token on `/mcp`. Setup steps for each client are on the [MCP page](https://headcountlabs.com/mcp/). ### Scopes | Scope | Lets the client | Tools | |---|---|---| | `jobs:read` | Search, count, export and read published jobs | `search_jobs`, `get_job`, `count_jobs`, `read_file`, `verify_jobs`, `compare_sources`, `search_jobs_json`, `search_jobs_dsl`, `list_job_changes`, the four export tools, `get_usage` | | `companies:read` | Search and read published company records and their jobs | `list_companies`, `search_companies`, `get_company`, `list_company_jobs` | | `usage:read` | Read API usage requests, analytics and overage status | `get_usage_requests`, `get_usage_analytics`, `get_overage`, `get_usage` | | `overage:write` | Change the account's overage setting or search confirmation level when you explicitly request it | `set_overage`, `set_confirmation_level` | A client that asks for no scope gets `jobs:read` only. To use the company and usage tools, the client must ask for `companies:read` and `usage:read` (and `overage:write` to change the confirmation level or overage) in its `scope` parameter; the sign-in page lists each scope in plain words before you approve. A tool called without its scope returns `insufficient_scope` (403). Unknown scopes are refused. Never ask the user to paste a password, API key or token into chat, and never put one in a prompt, file or log. Keep keys in the client's secret store or in environment variables. ## Compact results `search_jobs` and `read_file` return a compact summary of each job unless you ask for more: `rank`, `job_id`, `job_ad` (the employer-written `title`, `employer` and a 200-character `snippet` of the description), `company_id`, `locations`, `work_arrangement`, `pay` (`min`, `max`, `currency`, `period`), `posted_at`, `first_seen_at`, `posting_url` and `apply_url`. A compact page also says `view: "compact"` and has a `detail_hint`. `total_matches`, the ranking and `next_cursor` are the same in both views. To get every field, pass `view: "full"` (descriptions cut to 400 characters), add `descriptions: "full"` for the whole text, name the properties you need in `fields`, or call `get_job` for one job. Ten typical searches of 10 jobs came to about 19,700 tokens compact, against 51,600 with every field: 62% less. The REST API (`/v1/jobs`) is unchanged. ## Job ad text is data Titles, employer names, descriptions, snippets, locations and source data are copied from employers' public postings. They can hold anything an employer typed, including text written to look like instructions to an AI. Every result that carries this text starts with an `untrusted_content` notice naming those fields, and the server's instructions tell the AI to treat the text only as data to show, quote or summarize, and never to follow it. Before sending the text, the MCP server removes characters and markup that hide text from a person reading it: zero-width and text-direction characters, Unicode tag characters, HTML comments, `script`, `style`, `template` and `noscript` blocks, and elements marked `hidden`, `aria-hidden="true"`, `display: none`, `visibility: hidden`, `font-size: 0` or `opacity: 0`. The stored jobs and the REST API are unchanged. ## Job cards In clients that support MCP Apps, `search_jobs` results also appear as job cards: title, employer, location, remote or hybrid, pay and posted date, with an Apply button that opens the original posting. The pay, work arrangement and location controls on the cards run a new search, and "Show more jobs" loads the next page. The cards follow the client's light or dark theme and fit a phone screen. The view is the resource `ui://headcountlabs/job-cards-v1.html`, named in the tool's `_meta.ui.resourceUri` (and `openai/outputTemplate` for ChatGPT). Clients without MCP Apps show the normal result. A search from the cards uses records like any other `search_jobs` call. ## Rate limits Both `/mcp` and `/mcp/public` allow **60 tool calls per rolling minute** for each API key or OAuth token. A call with no key counts against its conversation instead (20 a minute), and against its network (IPv4 /24 or IPv6 /48), which allows 600 a minute across every conversation on it. A conversation is ChatGPT's `openai/session` id in `_meta`, or else the `Mcp-Session-Id` header that `initialize` returns; a call that names neither counts only against its network. Only `tools/call` counts: `initialize`, `tools/list` and notifications do not, and each `tools/call` inside a JSON-RPC batch counts as one. The limit is shared across all of our servers, so it holds however your calls are routed. Over the limit, the server answers **HTTP 429** with a `Retry-After` header (seconds to wait) plus `RateLimit-Limit`, `RateLimit-Remaining` (0) and `RateLimit-Reset` headers, and a JSON-RPC error: `error.code` `-32029`, a plain `error.message`, and `error.data` with `code: "rate_limited"`, `http_status: 429`, `retry_after_seconds`, `limit` (60 for a key, 20 for a conversation, 600 for a network), `limit_scope` (`key`, `conversation` or `network`) and `window_seconds: 60`. A refused call is never billed and uses no records. Wait `Retry-After` seconds, then repeat the same call. ```json HTTP/1.1 429 Retry-After: 36 {"jsonrpc": "2.0", "id": 21, "error": {"code": -32029, "message": "Too many requests: this API key is limited to 60 tool calls per minute. Try again in 36 seconds.", "data": {"code": "rate_limited", "http_status": 429, "retry_after_seconds": 36, "limit": 60, "limit_scope": "key", "window_seconds": 60}}} ``` Calls without an account (`/mcp/public` with no key) also have daily limits: 1,000 calls a day per conversation and a site-wide daily budget. Those refusals are a tool error with code `rate_limited` and `retry_after_seconds`. Signed-in calls also count toward the account's API limits: at most 10 requests running at once per API key (more returns a tool error with `http_status` 429, `rate_limited` and `limit_scope` `concurrency`), one `search_jobs_json` or `search_jobs_dsl` search at a time per key, and on the free allowance 60 requests in any 60 seconds (1 per second) and 1,000 a day, counted across the account's keys. Send calls one after another rather than as a parallel batch; on a 429 wait `Retry-After` (`retry_after`) seconds and retry the call once. ## Errors A failed tool call returns `isError: true` with `http_status`, `request_id` and the API's `error` object; a 429 also carries `retry_after`. Codes the MCP server adds: `confirmation_required` (409), `file_not_found` (404, the file expired or belongs to another account), `invalid_request` (400, for example a bad filter or cursor), `insufficient_scope` (403, the token lacks the scope in the Access column), `invalid_job_redirect` (502), `job_redirect_cycle` and `job_redirect_limit` (508, a merged job that loops or has more than 5 hops), `invalid_export_file` (502), `catalog_unavailable` and `service_unavailable` (503). `rate_limited` (HTTP 429, JSON-RPC error -32029, see Rate limits above). On `/mcp/public`: `search_limit_reached`. A `search_jobs` or `count_jobs` call that runs past the 90-second limit returns `http_status` 503 with code `query_too_broad` (alias `service_unavailable`, `retryable` false) and uses no jobs. Do not repeat it unchanged: for job titles use `filters.title` (or `title_advanced`) instead of `filters.q`, which searches every word of titles and descriptions and is the slowest filter, and add a state, city, source or company. A 503 that says the service is busy (three long searches already running) can be retried after a minute. All API codes are listed under [errors](https://headcountlabs.com/docs/errors/#error-codes). ### Fixing a rejected call When a call's arguments are wrong, the tool returns `http_status` 400 with code `invalid_arguments` and a `problems` list. Each problem names the `field`, says what is wrong in `problem`, and gives an `example` that works. It adds `accepted` (the allowed values) when the field takes a fixed list, and `did_you_mean` for an unknown name, such as `filters.q` for `filters.query`. A value the API rejects (`invalid_request`) also carries `field` and `example`. `rate_limited` (429) and temporary 503 errors (busy, catalog being published, a passing failure) carry `retry_after_seconds` and say how long to wait before repeating the same call. A search stopped at the time limit, or a `query_timeout`, does not: it would be stopped again, so the message says to narrow the call instead. A 429 for a used-up allowance or spend limit does not, because waiting a few seconds does not fix it. ```json {"http_status": 400, "error": {"code": "invalid_arguments", "tool": "search_jobs", "message": "query is not a filter. Did you mean filters.q? Fix the call and try again; list_fields shows every filter name.", "problems": [{"field": "filters.query", "problem": "query is not a filter. Did you mean filters.q?", "did_you_mean": "filters.q", "example": {"filters": {"q": "nurse"}}}]}} ``` Source: https://headcountlabs.com/docs/mcp-tools/ --- # Pagination and cursors URL: https://headcountlabs.com/docs/pagination/ # Pagination and cursors Understand the distinct continuation rules for jobs, companies, and usage reports. ## Jobs cursors keep working while data is published Jobs list cursors are opaque, HMAC-signed tokens bound to the projection ID, normalized filters, sort and page size. A cursor in the default `updated` order is a position in that order and keeps working while new data is published: no job is returned twice, but a job added or updated during the walk can be missed, and a withdrawn job drops out. A relevance cursor can stop working when new data is published; then restart at the first page with the same filters and limit. Cursors do not expire. ## Companies pages pin a retained release Company list/search cursors bind the normalized filters and page size to a retained company release. The cursor reads that release rather than requiring the active release to remain unchanged. Missing retained releases or mismatched request scope fail validation. Company ordering is normalized name, then company UUID, ascending. ## Usage request cursors Usage-request cursors are customer-bound and tied to filters, page size, a high-water row, and an admission capture time. They expire 60 minutes after the initial capture; paging does not extend expiry. The report reads ledger finalization state for captured admissions, so the capture time is not a frozen settlement snapshot. ## Keep page parameters stable When continuing, use the same endpoint, filters, and exact page size that produced the cursor. Store the complete response cursor as an opaque value. Treat the cursor as opaque; the route does not define a client-side format for decoding or creating one. ## A cursor is not a durable export checkpoint A walk through jobs pages can miss jobs that are added or updated while it runs. For a reliable ingestion workflow, record your own completed work, then catch up with the changes feed, which has its own resume cursor; see the [jobs reference](https://headcountlabs.com/docs/jobs/). ## Page sizes and cursor rules | Route | Page size | Default | Next page | | --- | --- | --- | --- | | `GET /v1/jobs`, `POST /v1/jobs/search`, `POST /v1/jobs/search/es_dsl`, `GET /v1/companies/{companyId}/jobs` | 1 to 250, or 1 to 1,000 when `fields` is exactly `job_id` | 50 | `next_cursor` → `cursor` | | `GET /v1/jobs/changes` | 1 to 1,000 | 100 | `resume_cursor` → `after`, while `has_more` is true | | `GET /v1/companies`, `POST /v1/companies/search` | 1 to 100 | 50 | `next_cursor` → `cursor` | | `GET /v1/usage/requests` | 1 to 100 | 50 | `next_cursor` → `cursor`; expires after one hour | A jobs cursor is tied to the filters, page size and sort it came from. A cursor used with a different query, or a relevance cursor from before new data was published, returns `400` `invalid_request`; start again from the first page. `next_cursor` is `null` on the last page. Cursors are up to 2,048 characters (8,192 for usage reports). For long-running syncs, see the [ingestion strategy](https://headcountlabs.com/docs/ingestion-strategy/). To pull a large result set without paging, use a [bulk export](https://headcountlabs.com/docs/jobs/#bulk-export). Source: https://headcountlabs.com/docs/pagination/ --- # Supported platforms URL: https://headcountlabs.com/docs/platforms/ # Supported platforms Every job-board platform Headcount Labs reads, with the exact value for the source filter. ## How the source filter works Pass a value from the table as `source` on `GET /v1/jobs` or `GET /v1/jobs/count`, or in `search_jobs` filters. A job matches when at least one of its postings came from that platform. The value is case-insensitive and matches the start of the platform value, so use the full value. Each posting shows its platform in `postings[].source`. ``` GET https://api.headcountlabs.com/v1/jobs?source=greenhouse&country=US GET https://api.headcountlabs.com/v1/jobs/count?source=workday ``` `exclude_source` takes a comma list of up to 10 values to leave out. A job still matches when another of its postings comes from a platform not on the list. Related filters: `source_class` (`ats`, `employer-site`, `government-exchange`, `aggregator`, `staffing-network`, `dataset`, `purchased`, `third-party-api`, `unknown`) and `source_type`. ## All 113 platform values Sorted by number of jobs, largest first. Job counts per platform are on [coverage](https://headcountlabs.com/coverage/). `custom` and `employer_site` are companies’ own career sites. A posting with no recorded platform has `source` `unknown`. | Platform | `source` value | Note | | --- | --- | --- | | Workday | `workday` | | | Oracle Recruiting Cloud | `oracle_hcm` | | | SmartRecruiters | `smartrecruiters` | | | iCIMS | `icims` | | | SAP SuccessFactors | `successfactors` | | | Phenom | `phenom` | | | DirectEmployers | `directemployers` | | | ADP | `adp` | | | Jibe | `jibe` | | | Oracle Taleo | `taleo` | Also matches `taleo_business_edition`. | | Greenhouse | `greenhouse` | | | UKG | `ukg` | | | Paycom | `paycom` | | | Paylocity | `paylocity` | | | Radancy | `radancy` | | | TalentReef | `talentreef` | | | CareerPlug | `careerplug` | | | Dayforce | `dayforce` | | | Custom career sites | `custom` | | | Workable | `workable` | | | JazzHR | `jazzhr` | | | Zoho Recruit | `zoho_recruit` | | | Company career sites | `employer_site` | | | PandaPé | `pandape` | | | Lever | `lever` | | | Gupy | `gupy` | | | BambooHR | `bamboohr` | | | Ashby | `ashby` | | | Cornerstone | `csod` | | | softgarden | `softgarden` | | | HRMDirect | `hrmdirect` | | | Beisen | `beisen` | | | Paycor | `paycor` | | | Teamtailor | `teamtailor` | | | BrassRing | `brassring` | | | Welcome to the Jungle | `welcometothejungle` | | | HRMOS | `hrmos` | | | Breezy HR | `breezy` | | | Recruiterflow | `recruiterflow` | | | Activate | `activate` | | | Eightfold AI | `eightfold` | | | ClearCompany | `clearcompany` | | | Recruitee | `recruitee` | | | PageUp | `pageup` | | | Betterteam | `betterteam` | | | ApplicantPro | `applicantpro` | | | NEOGOV | `neogov` | | | USAJOBS | `usajobs` | | | Avature | `avature` | | | Taleo Business Edition | `taleo_business_edition` | | | isolved | `isolved` | | | Rippling | `rippling` | | | Pinpoint | `pinpoint` | | | Jobvite | `jobvite` | | | Umantis | `umantis` | | | Sólides | `solides` | | | Hireology | `hireology` | | | HERP | `herp` | | | Keka | `keka` | | | Taleez | `taleez` | | | SelectMinds | `selectminds` | | | Hirebridge | `hirebridge` | | | JOIN | `join` | | | Traffit | `traffit` | | | ApplicantStack | `applicantstack` | | | Comeet | `comeet` | | | Personio | `personio` | | | Bullhorn | `bullhorn` | | | onlyfy | `onlyfy` | | | d.vinci | `dvinci` | | | MOKA | `moka` | | | Apploi | `apploi` | | | Paradox | `paradox` | | | Oleeo | `oleeo` | | | Dover | `dover` | | | Talentsoft | `talentsoft` | | | Eploy | `eploy` | | | ReachMee | `reachmee` | | | Varbi | `varbi` | | | rexx systems | `rexx` | | | ViziRecruiter | `vizirecruiter` | | | Gem | `gem` | | | Jobylon | `jobylon` | | | Flatchr | `flatchr` | | | Rival | `rival` | | | JobAdder | `jobadder` | | | Freshteam | `freshteam` | | | HiBob | `hibob` | | | Trakstar Hire | `trakstar_hire` | | | Recooty | `recooty` | | | ApplicantPool | `applicantpool` | | | ServiceNow | `servicenow` | | | EasyCruit | `easycruit` | | | OurCareerPages | `ourcareerpages` | | | HR Manager | `hr_manager` | | | APS Career Portal | `apscareerportal` | | | AcquireTM | `acquiretm` | | | concludis | `concludis` | | | TriNet Hire | `trinet_hire` | | | GoHire | `gohire` | | | Homerun | `homerun` | | | HireHive | `hirehive` | | | Interview Exchange | `interviewexchange` | | | Deel | `deel` | | | Kenjo | `kenjo` | | | Carerix | `carerix` | | | Jobsoid | `jobsoid` | | | Polymer | `polymer` | | | Tribepad | `tribepad` | | | FirstStage | `firststage` | | | Darwinbox | `darwinbox` | | | HiringThing | `hiringthing` | | | Manatal | `manatal` | | Source: https://headcountlabs.com/docs/platforms/ --- # Rate limits and free allowance URL: https://headcountlabs.com/docs/rate-limits/ # Rate limits and free allowance The free monthly allowance, per-record prices, the request rate, what counts and the headers that report it. ## Free allowance Every organization gets **100,000 records** free each UTC calendar month, shared by every API key on the organization. The count starts again at 00:00 UTC on the 1st. No card is needed. Each job or company a successful response returns is one record, including a job read by its ID and a job you fetched before. Counts, usage reports, errors and empty pages return no records and cost nothing. The MCP connector uses the same allowance and prices, because it calls the same API. ## Prices after the free allowance You pay per record. Each job or company a successful response returns is one record, and a record delivered again counts again. The first 100,000 records each UTC calendar month are free, and every record after that costs $0.01 per 1,000, at any volume. The count starts again at 00:00 UTC on the 1st. | Records this month | Per 1,000 records | |---|---| | First 100,000 | Free | | Every record after that | $0.01 | For example, 1,000,000 records in a month cost $9, 3,000,000 cost $29 and 9,000,000 cost $89. Keyword searches and filtered lists cost the same per record. Counts return no records and cost nothing. Add prepaid usage in any amount from $1, or turn on pay as you go to be charged on the 1st for the month before. Prepaid usage is spent only after the month’s free records, at this rate, and expires 12 months after your most recent purchase. The [pricing page](https://headcountlabs.com/pricing/) has an estimator. ## Request rate Each account may make a limited number of requests in any 60-second window, counted across all of its keys. On the free allowance that is 1 request per second (60 in the window). Each API key may have 10 requests running at once. | Account | Requests per 60 seconds | Requests per UTC day | |---|---|---| | New account on the free allowance | 60 (1 per second) | 1,000 | | Account that pays for usage | 60 | No daily limit | On the free allowance an account may also make 1,000 requests in one UTC day (midnight to midnight UTC), counted across all of its keys. Past that, the API returns `429` with code `rate_limited`, and `Retry-After` counts the seconds until the next UTC day begins. Accounts that pay for usage have no daily request limit. A request over either limit gets `429` with code `rate_limited` and a `Retry-After` header in seconds. A refused request does not use the window or any allowance. A request the API accepts uses the window even if it then fails with a 4xx or 5xx. ## What counts - Each job, company or changes event a successful response returns is one record. The prices above are per record. - A successful list, search or changes call returns jobs or events; a job you fetched before still counts again. - A count is one request toward the rate limit and returns no records, so it costs nothing. A single-job read counts one record. Usage reports cost nothing. - A request refused with `401` or `429` is not counted. - Export calls (create, poll, list and download) do not count toward the per-minute window. A completed export counts one record for every job it writes. Through the MCP server, the tools that return jobs, companies or change events (`search_jobs`, `get_job`, `verify_jobs`, `compare_sources`, the company, export and search tools) count one record for each item they return. `count_jobs`, `list_fields`, `market_insights`, `get_usage`, `set_confirmation_level`, `set_overage`, `get_overage`, `read_file`, `search_docs` and the usage reports are free, so you can always check your usage. See [MCP tools](https://headcountlabs.com/docs/mcp-tools/) for every tool. Over MCP a refusal comes back as a tool error with `http_status` 429. ## When you run out When the month’s free allowance is used and you have no prepaid usage or pay as you go, calls get `429` with code `rate_limited` or `data_limit_exceeded` and no data, until the allowance comes back on the 1st of the next month. `Retry-After` says how many seconds to wait. ## Headers on each response | Header | Meaning | |---|---| | `RateLimit-Policy`, `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` | Your request window and what is left of it. | | `X-Data-Records-Charged` | Records this response counted. | | `X-Data-Records-Used`, `X-Data-Records-Limit`, `X-Data-Records-Remaining`, `X-Data-Records-Reset` | Your allowance: used, total, left, and when it resets. | | `X-Data-Requests-Used`, `X-Data-Requests-Limit`, `X-Data-Requests-Remaining` | Your requests: used, total and left. | | `Retry-After` | On a 429: seconds to wait before retrying. | | `X-Request-Id` | Quote it when you contact support. | ## Page sizes | Route | Page size | Default | |---|---|---| | `GET /v1/jobs`, `POST /v1/jobs/search`, `POST /v1/jobs/search/es_dsl`, `GET /v1/companies/{companyId}/jobs` | 1 to 250, or 1 to 1,000 when `fields` is exactly `job_id` | 50 | | `GET /v1/jobs/changes` | 1 to 1,000 events | 100 | | `GET /v1/companies`, `POST /v1/companies/search` | 1 to 100 | 50 | | `GET /v1/usage/requests` | 1 to 100 | 50 | | MCP `search_jobs`, `search_jobs_json`, `search_jobs_dsl`, `list_company_jobs`, `list_companies`, `search_companies`, `list_job_changes` | 10 to 100; one search returns at most `max_results` (10 to 1,000, default 250); a `search_jobs` file holds up to 5,000 | 50 | | MCP `search_jobs` on `/mcp/public` (no sign-in) | 1 to 50 (1 to 10 with full descriptions); one search returns at most 250 | 10 | Text filters take 1 to 200 characters. Cursor rules are on the [pagination page](https://headcountlabs.com/docs/pagination/). ## Staying inside the limits - Run `/v1/jobs/count` first to see how big a query is. - Use the largest page size you can: 250 jobs for lists, and 1,000 ids per page with `fields=job_id`. - Keep in sync with `/v1/jobs/changes` instead of re-reading whole lists. See the [ingestion strategy](https://headcountlabs.com/docs/ingestion-strategy/). - Use an [export](https://headcountlabs.com/docs/bulk-download/) for a large one-time load. - On `429`, wait for `Retry-After` and retry the same request. - Researchers, nonprofits, students and developers with special requirements can email [support@headcountlabs.com](mailto:support@headcountlabs.com) for more free allowance or discounts. Source: https://headcountlabs.com/docs/rate-limits/ --- # OpenAPI reference URL: https://headcountlabs.com/docs/openapi-reference/ # OpenAPI reference Every route in the live OpenAPI specification (17 operations). Base URL: https://api.headcountlabs.com. Source: https://api.headcountlabs.com/openapi - GET /v1/companies: Browse companies - POST /v1/companies/search: Search companies - GET /v1/companies/{companyId}: Get a company by UUID - GET /v1/companies/{companyId}/jobs: List a company's jobs - GET /v1/jobs: List public jobs - POST /v1/jobs/search: Search public jobs with a JSON body - POST /v1/jobs/search/es_dsl: Search public jobs with Elasticsearch-style clauses - POST /v1/jobs/exports: Create a bulk jobs export - GET /v1/jobs/exports: List recent jobs exports - GET /v1/jobs/exports/{exportId}: Get a jobs export - GET /v1/jobs/exports/{exportId}/files/{n}: Download a gzip JSON Lines export file - GET /v1/jobs/changes: List public job changes - GET /v1/jobs/count: Count public jobs - GET /v1/jobs/{jobId}: Get a job by ID - PUT /v1/account/overage: Turn overage billing on or off and set its monthly limit - GET /v1/usage/requests: List customer request events - GET /v1/usage/analytics: Read customer daily usage ## Overview Search and sync job postings collected from employers' own job sources, with company records. Authentication: send your API key as a bearer token, Authorization: Bearer jc_live_. (keys issued before October 2026 start with ar_live_ and still work). Create keys in your account. A missing or wrong key returns 401 invalid_api_key. Paging: list endpoints return next_cursor; pass it back as cursor for the next page. Every page of one listing reads the same catalog snapshot (snapshot_watermark), so results don't shift under you. A cursor from an older snapshot or with different filters returns 400; start again from the first page. Keeping in sync: pull GET /v1/jobs/changes with since for the first call, then keep passing resume_cursor as after to receive created, updated and expired jobs in order. Limits: every organization gets 100,000 records free each UTC calendar month, shared by all its API keys. Past the free allowance you pay per record delivered: $0.01 per 1,000 records, however many you use in a month. Counts return no records and cost nothing. Add prepaid usage or turn on pay as you go to keep going; see https://headcountlabs.com/pricing/. Requests are also limited per minute. Going over returns 429 (rate_limited or data_limit_exceeded) with a Retry-After header in seconds. Counts and usage reports return no records. Errors always look like {"error": {"code", "message", "request_id"}}. Quote request_id when you contact support. 503 catalog_unavailable means the jobs catalog is being published; retry shortly. Searches and counts are limited to 90 seconds: a query stopped at the limit returns 503 query_too_broad and uses no records. Do not repeat it unchanged; for job titles use title (or title_advanced) instead of q, which is a broad full-text search and the slowest filter, and add filters such as state, city, company or source. A 503 saying the service is busy means three long searches are already running; retry in a minute. Older routes may answer 504 query_timeout for a stopped query; handle it the same way. ## GET /v1/companies **Browse companies** Lists companies from one immutable registry release. Parameters: - name (query; string; min length 1, max length 200): Case-insensitive canonical-name substring. - limit (query; integer; min 1, max 100, default 50): Page size, 1-100. Defaults to 50. - cursor (query; string; min length 1, max length 2048): The next_cursor from the previous page. It pins the company release it started on. Responses: - 200: A page of public company records. Body: CompanyPage. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. ## POST /v1/companies/search **Search companies** Combines verified name, country, and status filters with AND. Search uses the same UUID company records and release-pinned cursor as company browse. Request body (JSON, required): - name (string; min length 1, max length 200): Case-insensitive canonical-name substring after trimming. - country (string): ISO 3166-1 alpha-2 code, case-insensitive. - status (string: "active", "retired", "merged"): - limit (integer; min 1, max 100, default 50): - cursor (string; min length 1, max length 2048): Responses: - 200: A page of matching public company records. Body: CompanyPage. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. ## GET /v1/companies/{companyId} **Get a company by UUID** Parameters: - companyId (path, required; CompanyId): Headcount Labs company ID (lowercase UUID). A merged company's old ID redirects (308) to its current ID. Responses: - 200: A public company record. Body: object. - 308: A merged company ID redirects to its current UUID. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 404: The company or customer-owned API key was not found. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. ## GET /v1/companies/{companyId}/jobs **List a company's jobs** Lists the company's public jobs from the latest published jobs catalog, with the same filters, order and cursor rules as GET /v1/jobs. Resolves the company UUID and redirects merged IDs. Requires an active company registry release and a published jobs catalog, and responds 503 while either is missing. Parameters: - companyId (path, required; CompanyId): Headcount Labs company ID (lowercase UUID). A merged company's old ID redirects (308) to its current ID. - fields (query; string): Comma list of the job properties to return; repeat the parameter or separate names with commas. Allowed names are job_id, currentness, stale, company_id, employer_name, title, description, work_arrangement, locations, job_first_seen_at, curated_at, job_updated_at, postings and company. job_id is always returned. Without fields the whole job is returned. An unknown name returns 400. It changes only the shape of each job, never which jobs match. Responses: - 308: A merged company ID redirects to its current UUID. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 404: The company or customer-owned API key was not found. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## GET /v1/jobs **List public jobs** Returns included public jobs from the latest published jobs catalog. A search with q, title or description is ranked by relevance, with title matches weighted ten times description matches; any other list, or sort=updated, is newest job_updated_at first. Ties break by job_id, descending. Without a currentness or active filter only current jobs are returned. Every page of one listing reads the same catalog snapshot: next_cursor is bound to that snapshot, the filters and the limit, and a cursor from an older snapshot or a different query returns 400. Responds 503 catalog_unavailable while no jobs catalog has been published. Parameters: - company (query; string; min length 1, max length 200): Employer name contains this text. Case-insensitive. 1-200 characters. A term of 1-2 characters matches the whole employer name or its first word instead (`hp` finds "HP Inc." but not "Shop HP Repairs"). - company_id (query; CompanyId): Only jobs of this company, by its Headcount Labs company ID (lowercase UUID). - title (query; string; min length 1, max length 200): Job title contains these words as one phrase, in this order (full-text match). "senior software engineer" does not match "Software Engineer, Senior" or "Senior Staff Software Engineer"; use title_advanced, such as senior AND "software engineer", to match the words in any order. 1-200 characters. - title_advanced (query; string; min length 1, max length 200): Boolean title search: the words may appear in any order. Supports AND, OR and NOT keywords, &, | and !, parentheses, prefix terms such as engineer:*, and quoted phrases such as "product manager". Prefer it over title when job titles vary in word order, for example senior AND ("software engineer" OR "software developer"). A positive search term is required. - description_advanced (query; string; min length 1, max length 200): Boolean description search. Supports AND, OR and NOT keywords, &, | and !, parentheses, prefix terms such as engineer:*, and quoted phrases such as "product manager". A positive search term is required. - q (query; string; min length 1, max length 200): Keyword search: the phrase appears in the title or description. Results are ranked by relevance unless sort=updated. 1-200 characters. - location (query; string; min length 1, max length 200): Any job location contains this text (city, region or country as written). Case-insensitive. 1-200 characters. - state (query; string; min length 1, max length 200): Two-letter subdivision code. On its own it means a U.S. state (state=CA is California only); combine with country for another country's subdivision (country=CA&state=BC is British Columbia). - country (query; string): Two-letter ISO country code, for example US or CA. Case-insensitive. Send up to 10 codes separated by commas to match jobs in any of them. - msa (query; string): 5-digit CBSA code of a metropolitan or micropolitan statistical area, for example 12420 for Austin-Round Rock-San Marcos, TX. Matches any job location whose msa.cbsa_code equals it. - work_arrangement (query; string: "remote", "hybrid", "in_person"): One of remote, hybrid or in_person, as the source states it. Jobs whose source doesn't say are not matched. - remote_type (query; string: "remote", "hybrid", "in_person"): Alias for work_arrangement; do not send both. - employment_type (query; string; min length 1, max length 200): Employment type as published, for example full_time or part_time. Exact match, case-insensitive. Send up to 10 values separated by commas to match jobs with any of them. - source (query; string; min length 1, max length 200): The source vendor, such as greenhouse or smartrecruiters. Board IDs are not exposed. - currentness (query; string; default "current"): Comma list of current, uncertain and not_current. - active (query; boolean): true maps to currentness=current and false to currentness=not_current; do not send with currentness. - posted_since (query; string (date) or string (date-time)): Posted on or after this time, by the date the source published. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). A plain date means the start of that day in UTC. - posted_until (query; string (date) or string (date-time)): Posted on or before this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). A plain date means the end of that day in UTC. - published_since (query; string (date) or string (date-time)): Compatibility alias for posted_since; do not send both. - first_seen_since (query; string (date) or string (date-time)): First collected by Headcount Labs on or after this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - updated_since (query; string (date) or string (date-time)): Job record last changed on or after this time; use it for incremental pulls. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - curated_since (query; string (date) or string (date-time)): Entered the final dataset on or after this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - job_id (query; string (uuid)): One job by its job ID (a lowercase UUID). - description (query; string; min length 1, max length 200): Words that must appear together in the job description. Use description_advanced for a Boolean expression. - city (query; string; min length 1, max length 200): City name. Matches any job location whose city contains this text, case-insensitive. Combine with state and country to narrow it. - exclude_source (query; string; max length 200): Comma list of up to 10 source vendors or source types to leave out. A job still matches when another of its postings comes from a source not on the list. - source_type (query; string; min length 1, max length 200): The kind of job source, as in postings[].source_data.source_type. Exact match, case-insensitive. - source_class (query; string: "ats", "employer-site", "government-exchange", "aggregator", "staffing-network", "dataset", "purchased", "third-party-api", "unknown"): The class of job source a posting came from, for example ats for an applicant tracking system board or employer-site for a company's own careers page. - posting_id (query; string; min length 1, max length 200): The job that holds this posting, by Headcount Labs' posting ID. - source_posting_id (query; string; min length 1, max length 200): Jobs with a posting that has this source posting ID (the job source's own ID for the listing). - posting_status (query; string: "listed", "no_longer_listed"): Jobs with a posting in this state. listed means the source still shows it; no_longer_listed means a completed read no longer found it. - stale (query; boolean): true for jobs flagged stale, false for the rest. The flag is a label published with the job. Stale jobs stay in results, and stale=false leaves them out. - company_linked (query; boolean): true for jobs linked to a company record (company_id is set); false for jobs with no linked company. - has_description (query; boolean): true for jobs with a known description; false for jobs without one. - has_location (query; boolean): true for jobs with at least one known location; false for jobs with none. - has_pay (query; boolean): true for jobs with a posting that publishes pay; false for jobs with a posting that does not. - has_posting_url (query; boolean): true for jobs with a posting that has a known listing URL. - has_application_url (query; boolean): true for jobs with a posting that has a known application URL. - pay_currency (query; string): ISO 4217 currency code. Jobs with a posting whose published pay is in this currency. - pay_min (query; number; min 0, max 1000000000): Lowest yearly pay. Matches postings whose pay floor is at least this amount. Pay is compared per year (hourly x 2,080, monthly x 12); pay with an unknown interval never matches. Amounts are not converted between currencies, so pair it with pay_currency. Up to two decimal places. - pay_max (query; number; min 0, max 1000000000): Highest yearly pay. Matches postings whose pay ceiling is at most this amount, compared per year the same way as pay_min. Must not be below pay_min. - first_seen_until (query; string (date) or string (date-time)): First collected by Headcount Labs on or before this time. Accepts an RFC 3339 timestamp or a plain date. - updated_until (query; string (date) or string (date-time)): Last changed on or before this time. Accepts an RFC 3339 timestamp or a plain date. - curated_until (query; string (date) or string (date-time)): Entered the final dataset on or before this time. Accepts an RFC 3339 timestamp or a plain date. - last_fetch_since (query; string (date) or string (date-time)): Jobs with a posting whose job source was last read completely on or after this time. Accepts an RFC 3339 timestamp or a plain date. - last_fetch_until (query; string (date) or string (date-time)): Jobs with a posting whose job source was last read completely on or before this time. Accepts an RFC 3339 timestamp or a plain date. - application_check (query; string: "available", "closed", "broken", "inconclusive"): Jobs with a posting whose latest application check had this result. available means an application could still be started. - application_check_since (query; string (date) or string (date-time)): Jobs with a posting whose latest application check ran on or after this time. Accepts an RFC 3339 timestamp or a plain date. - include (query; string): Comma list containing company and/or source_data. company adds the linked public company record; source_data adds each posting's source data. - fields (query; string): Comma list of the job properties to return; repeat the parameter or separate names with commas. Allowed names are job_id, currentness, stale, company_id, employer_name, title, description, work_arrangement, locations, job_first_seen_at, curated_at, job_updated_at, postings and company. job_id is always returned. Without fields the whole job is returned. An unknown name returns 400. It changes only the shape of each job, never which jobs match. - description_format (query; string: "text", "html"; default "text"): text returns descriptions as plain text. html returns 503 because source HTML descriptions are not published yet. - limit (query; integer; min 1, max 1000, default 50): Page size, 1-250, or 1-1,000 when fields is exactly job_id. Defaults to 50. - cursor (query; string; min length 1, max length 2048): The next_cursor from the previous page. It is tied to the same filters, page size, sort and catalog snapshot; start again from the first page if you get a 400 for a stale cursor. - sort (query; string: "relevance", "updated"): relevance ranks by how well q, title and description match, and is the default when one of them is set; it returns 400 without one. updated lists the most recently updated jobs first, and is the default otherwise. Responses: - 200: A page of public job records. Body: JobListResponse. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## POST /v1/jobs/search **Search public jobs with a JSON body** Takes the same filters, paging and representation options as GET /v1/jobs as one JSON object (Content-Type application/json, at most 16,384 bytes). Unknown keys are rejected. Booleans and numbers must be JSON booleans and numbers. currentness and include must be arrays; country, employment_type and fields may be strings or arrays. Send next_cursor back as cursor in the body for the next page. The response, request charge, limits and errors match GET /v1/jobs. Page size is 1-250, or 1-1000 when fields is exactly job_id. Request body (JSON, required): - company (string; min length 1, max length 200): Employer name contains this text. Case-insensitive. 1-200 characters. A term of 1-2 characters matches the whole employer name or its first word instead (`hp` finds "HP Inc." but not "Shop HP Repairs"). - company_id (CompanyId): Only jobs of this company, by its Headcount Labs company ID (lowercase UUID). - title (string; min length 1, max length 200): Job title contains these words as one phrase, in this order (full-text match). "senior software engineer" does not match "Software Engineer, Senior" or "Senior Staff Software Engineer"; use title_advanced, such as senior AND "software engineer", to match the words in any order. 1-200 characters. - title_advanced (string; min length 1, max length 200): Boolean title search: the words may appear in any order. Supports AND, OR and NOT keywords, &, | and !, parentheses, prefix terms such as engineer:*, and quoted phrases such as "product manager". Prefer it over title when job titles vary in word order, for example senior AND ("software engineer" OR "software developer"). A positive search term is required. - description_advanced (string; min length 1, max length 200): Boolean description search. Supports AND, OR and NOT keywords, &, | and !, parentheses, prefix terms such as engineer:*, and quoted phrases such as "product manager". A positive search term is required. - q (string; min length 1, max length 200): Keyword search: the phrase appears in the title or description. Results are ranked by relevance unless sort=updated. 1-200 characters. - location (string; min length 1, max length 200): Any job location contains this text (city, region or country as written). Case-insensitive. 1-200 characters. - state (string; min length 1, max length 200): Two-letter subdivision code. On its own it means a U.S. state (state=CA is California only); combine with country for another country's subdivision (country=CA&state=BC is British Columbia). - country (string or array of string): Two-letter ISO country code, for example US or CA. Case-insensitive. Send up to 10 codes separated by commas to match jobs in any of them. In a JSON body this may be a string or an array of strings. - msa (string): 5-digit CBSA code of a metropolitan or micropolitan statistical area, for example 12420 for Austin-Round Rock-San Marcos, TX. Matches any job location whose msa.cbsa_code equals it. - work_arrangement (string: "remote", "hybrid", "in_person"): One of remote, hybrid or in_person, as the source states it. Jobs whose source doesn't say are not matched. - remote_type (string: "remote", "hybrid", "in_person"): Alias for work_arrangement; do not send both. - employment_type (string or array of string): Employment type as published, for example full_time or part_time. Exact match, case-insensitive. Send up to 10 values separated by commas to match jobs with any of them. In a JSON body this may be a string or an array of strings. - source (string; min length 1, max length 200): The source vendor, such as greenhouse or smartrecruiters. Board IDs are not exposed. - currentness (array of string): Comma list of current, uncertain and not_current. In a JSON body this must be an array of strings. - active (boolean): true maps to currentness=current and false to currentness=not_current; do not send with currentness. - posted_since (string (date) or string (date-time)): Posted on or after this time, by the date the source published. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). A plain date means the start of that day in UTC. - posted_until (string (date) or string (date-time)): Posted on or before this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). A plain date means the end of that day in UTC. - published_since (string (date) or string (date-time)): Compatibility alias for posted_since; do not send both. - first_seen_since (string (date) or string (date-time)): First collected by Headcount Labs on or after this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - updated_since (string (date) or string (date-time)): Job record last changed on or after this time; use it for incremental pulls. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - curated_since (string (date) or string (date-time)): Entered the final dataset on or after this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - job_id (string (uuid)): One job by its job ID (a lowercase UUID). - description (string; min length 1, max length 200): Words that must appear together in the job description. Use description_advanced for a Boolean expression. - city (string; min length 1, max length 200): City name. Matches any job location whose city contains this text, case-insensitive. Combine with state and country to narrow it. - exclude_source (string; max length 200): Comma list of up to 10 source vendors or source types to leave out. A job still matches when another of its postings comes from a source not on the list. - source_type (string; min length 1, max length 200): The kind of job source, as in postings[].source_data.source_type. Exact match, case-insensitive. - source_class (string: "ats", "employer-site", "government-exchange", "aggregator", "staffing-network", "dataset", "purchased", "third-party-api", "unknown"): The class of job source a posting came from, for example ats for an applicant tracking system board or employer-site for a company's own careers page. - posting_id (string; min length 1, max length 200): The job that holds this posting, by Headcount Labs' posting ID. - source_posting_id (string; min length 1, max length 200): Jobs with a posting that has this source posting ID (the job source's own ID for the listing). - posting_status (string: "listed", "no_longer_listed"): Jobs with a posting in this state. listed means the source still shows it; no_longer_listed means a completed read no longer found it. - stale (boolean): true for jobs flagged stale, false for the rest. The flag is a label published with the job. Stale jobs stay in results, and stale=false leaves them out. - company_linked (boolean): true for jobs linked to a company record (company_id is set); false for jobs with no linked company. - has_description (boolean): true for jobs with a known description; false for jobs without one. - has_location (boolean): true for jobs with at least one known location; false for jobs with none. - has_pay (boolean): true for jobs with a posting that publishes pay; false for jobs with a posting that does not. - has_posting_url (boolean): true for jobs with a posting that has a known listing URL. - has_application_url (boolean): true for jobs with a posting that has a known application URL. - pay_currency (string): ISO 4217 currency code. Jobs with a posting whose published pay is in this currency. - pay_min (number; min 0, max 1000000000): Lowest yearly pay. Matches postings whose pay floor is at least this amount. Pay is compared per year (hourly x 2,080, monthly x 12); pay with an unknown interval never matches. Amounts are not converted between currencies, so pair it with pay_currency. Up to two decimal places. - pay_max (number; min 0, max 1000000000): Highest yearly pay. Matches postings whose pay ceiling is at most this amount, compared per year the same way as pay_min. Must not be below pay_min. - first_seen_until (string (date) or string (date-time)): First collected by Headcount Labs on or before this time. Accepts an RFC 3339 timestamp or a plain date. - updated_until (string (date) or string (date-time)): Last changed on or before this time. Accepts an RFC 3339 timestamp or a plain date. - curated_until (string (date) or string (date-time)): Entered the final dataset on or before this time. Accepts an RFC 3339 timestamp or a plain date. - last_fetch_since (string (date) or string (date-time)): Jobs with a posting whose job source was last read completely on or after this time. Accepts an RFC 3339 timestamp or a plain date. - last_fetch_until (string (date) or string (date-time)): Jobs with a posting whose job source was last read completely on or before this time. Accepts an RFC 3339 timestamp or a plain date. - application_check (string: "available", "closed", "broken", "inconclusive"): Jobs with a posting whose latest application check had this result. available means an application could still be started. - application_check_since (string (date) or string (date-time)): Jobs with a posting whose latest application check ran on or after this time. Accepts an RFC 3339 timestamp or a plain date. - include (array of string): Comma list containing company and/or source_data. company adds the linked public company record; source_data adds each posting's source data. In a JSON body this must be an array of strings. - fields (string or array of string): Comma list of the job properties to return; repeat the parameter or separate names with commas. Allowed names are job_id, currentness, stale, company_id, employer_name, title, description, work_arrangement, locations, job_first_seen_at, curated_at, job_updated_at, postings and company. job_id is always returned. Without fields the whole job is returned. An unknown name returns 400. It changes only the shape of each job, never which jobs match. In a JSON body this may be a string or an array of strings. - description_format (string: "text", "html"; default "text"): text returns descriptions as plain text. html returns 503 because source HTML descriptions are not published yet. - limit (integer; min 1, max 1000, default 50): Page size, 1-250, or 1-1,000 when fields is exactly job_id. Defaults to 50. - cursor (string; min length 1, max length 2048): The next_cursor from the previous page. It is tied to the same filters, page size, sort and catalog snapshot; start again from the first page if you get a 400 for a stale cursor. - sort (string: "relevance", "updated"): relevance ranks by how well q, title and description match, and is the default when one of them is set; it returns 400 without one. updated lists the most recently updated jobs first, and is the default otherwise. Responses: - 200: A page of public job records. Body: JobListResponse. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## POST /v1/jobs/search/es_dsl **Search public jobs with Elasticsearch-style clauses** Translates the supported Elasticsearch-style query subset to the same filters as POST /v1/jobs/search. All must and filter clauses are AND-ed. should is supported only for term or match clauses on the same country or employment_type field, including when must/filter is also present. Range gt is treated as inclusive gte, and lt as inclusive lte. The response, cursor, request charge, limits, and errors match POST /v1/jobs/search. Page size is 1-250, or 1-1000 when fields is exactly job_id. Request body (JSON, required): - query (object, required): One supported clause: match_all, bool, term, terms, match, match_phrase, range, exists, query_string, or simple_query_string. Unsupported clauses and fields return 400 invalid_request. See the operation description and Headcount Labs API documentation for the accepted field list. - limit (integer; min 1, max 1000, default 50): Page size 1-250. Values 251-1000 are accepted only when fields is exactly job_id. - cursor (string; min length 1, max length 2048): - sort (string: "relevance", "updated"): - fields (string or array of string): - include (array of string: "company", "source_data"): - description_format (string: "text", "html"; default "text"): Responses: - 200: A page of public job records. Body: JobListResponse. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## POST /v1/jobs/exports **Create a bulk jobs export** Request body (JSON, required): - q (string): - fields (array of string): - include (array of string: "company", "source_data"): - description_format (string: "text", "html"; default "text"): - sort (string: "relevance", "updated"): - max_records (integer; min 1, max 100000, default 100000): Responses: - 202: Export accepted Body: JobsExport. - 400: Invalid export request - 401: Invalid API key - 409: The account already has a queued or running export - 429: Request allowance is insufficient - 503: Export service is unavailable ## GET /v1/jobs/exports **List recent jobs exports** Responses: - 200: Exports for the authenticated account, newest first, limited to 20 Body: object. - 401: Invalid API key - 503: Export service is unavailable ## GET /v1/jobs/exports/{exportId} **Get a jobs export** Parameters: - exportId (path, required; string (uuid)): Responses: - 200: Export status and file metadata Body: JobsExport. - 401: Invalid API key - 404: Export does not exist or belongs to another account - 503: Export service is unavailable ## GET /v1/jobs/exports/{exportId}/files/{n} **Download a gzip JSON Lines export file** Parameters: - exportId (path, required; string (uuid)): - n (path, required; integer; min 1): Responses: - 200: Gzip-compressed JSON Lines file Body: string (binary). - 401: Invalid API key - 404: File is unknown, not ready, expired, or belongs to another account - 503: Export service is unavailable ## GET /v1/jobs/changes **List public job changes** Lists created, updated and expired job events from the latest published jobs catalog, in event order. Send exactly one of since or after: start with since, then pass resume_cursor as after. A cursor from an older catalog snapshot returns 400. Responds 503 catalog_unavailable while no jobs catalog has been published, and 503 service_unavailable when the catalog changes during the request (retry). Parameters: - after (query; string; min length 1, max length 2048): The resume_cursor from your previous changes call. Send exactly one of after or since. - since (query; string (date-time)): Start of the change window: changes strictly after this RFC 3339 timestamp. Use it for the first call, then continue with after. - types (query; string; default "created,updated,expired"): Comma list of created, updated and expired. Defaults to all three. - limit (query; integer; min 1, max 1000, default 100): Events per page, 1-1,000. Defaults to 100. - company_id (query; CompanyId): Only changes for this company's jobs (lowercase UUID). - include (query; string: "source_data"): source_data adds allowlisted source metadata to each job in the events. The source payload and internal extraction details are not published. Responses: - 200: A page of job changes. Body: JobsChangesResponse. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## GET /v1/jobs/count **Count public jobs** Counts jobs matching the same filters as GET /v1/jobs in the latest published jobs catalog, with that catalog's snapshot watermark. Responds 503 catalog_unavailable while no jobs catalog has been published. Parameters: - company (query; string; min length 1, max length 200): Employer name contains this text. Case-insensitive. 1-200 characters. A term of 1-2 characters matches the whole employer name or its first word instead (`hp` finds "HP Inc." but not "Shop HP Repairs"). - company_id (query; CompanyId): Only jobs of this company, by its Headcount Labs company ID (lowercase UUID). - title (query; string; min length 1, max length 200): Job title contains these words as one phrase, in this order (full-text match). "senior software engineer" does not match "Software Engineer, Senior" or "Senior Staff Software Engineer"; use title_advanced, such as senior AND "software engineer", to match the words in any order. 1-200 characters. - title_advanced (query; string; min length 1, max length 200): Boolean title search: the words may appear in any order. Supports AND, OR and NOT keywords, &, | and !, parentheses, prefix terms such as engineer:*, and quoted phrases such as "product manager". Prefer it over title when job titles vary in word order, for example senior AND ("software engineer" OR "software developer"). A positive search term is required. - description_advanced (query; string; min length 1, max length 200): Boolean description search. Supports AND, OR and NOT keywords, &, | and !, parentheses, prefix terms such as engineer:*, and quoted phrases such as "product manager". A positive search term is required. - q (query; string; min length 1, max length 200): Keyword search: the phrase appears in the title or description. 1-200 characters. - location (query; string; min length 1, max length 200): Any job location contains this text (city, region or country as written). Case-insensitive. 1-200 characters. - state (query; string; min length 1, max length 200): Two-letter subdivision code. On its own it means a U.S. state (state=CA is California only); combine with country for another country's subdivision (country=CA&state=BC is British Columbia). - country (query; string): Two-letter ISO country code, for example US or CA. Case-insensitive. Send up to 10 codes separated by commas to match jobs in any of them. - msa (query; string): 5-digit CBSA code of a metropolitan or micropolitan statistical area, for example 12420 for Austin-Round Rock-San Marcos, TX. Matches any job location whose msa.cbsa_code equals it. - work_arrangement (query; string: "remote", "hybrid", "in_person"): One of remote, hybrid or in_person, as the source states it. Jobs whose source doesn't say are not matched. - remote_type (query; string: "remote", "hybrid", "in_person"): Alias for work_arrangement; do not send both. - employment_type (query; string; min length 1, max length 200): Employment type as published, for example full_time or part_time. Exact match, case-insensitive. Send up to 10 values separated by commas to match jobs with any of them. - source (query; string; min length 1, max length 200): The source vendor, such as greenhouse or smartrecruiters. Board IDs are not exposed. - currentness (query; string; default "current"): Comma list of current, uncertain and not_current (combined with OR). Defaults to current. A job is current when a completed read of its job source listed it within the last 31 days and no check has found it closed. - active (query; boolean): true maps to currentness=current; do not send with currentness. - posted_since (query; string (date) or string (date-time)): Posted on or after this time, by the date the source published. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). A plain date means the start of that day in UTC. - posted_until (query; string (date) or string (date-time)): Posted on or before this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). A plain date means the end of that day in UTC. - published_since (query; string (date) or string (date-time)): Compatibility alias for posted_since; do not send both. - first_seen_since (query; string (date) or string (date-time)): First collected by Headcount Labs on or after this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - updated_since (query; string (date) or string (date-time)): Job record last changed on or after this time; use it for incremental pulls. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - curated_since (query; string (date) or string (date-time)): Entered the final dataset on or after this time. Accepts an RFC 3339 timestamp with a time zone (2026-09-21T00:00:00Z) or a plain date (2026-09-21). - job_id (query; string (uuid)): One job by its job ID (a lowercase UUID). - description (query; string; min length 1, max length 200): Words that must appear together in the job description. Use description_advanced for a Boolean expression. - city (query; string; min length 1, max length 200): City name. Matches any job location whose city contains this text, case-insensitive. Combine with state and country to narrow it. - exclude_source (query; string; max length 200): Comma list of up to 10 source vendors or source types to leave out. A job still matches when another of its postings comes from a source not on the list. - source_type (query; string; min length 1, max length 200): The kind of job source, as in postings[].source_data.source_type. Exact match, case-insensitive. - source_class (query; string: "ats", "employer-site", "government-exchange", "aggregator", "staffing-network", "dataset", "purchased", "third-party-api", "unknown"): The class of job source a posting came from, for example ats for an applicant tracking system board or employer-site for a company's own careers page. - posting_id (query; string; min length 1, max length 200): The job that holds this posting, by Headcount Labs' posting ID. - source_posting_id (query; string; min length 1, max length 200): Jobs with a posting that has this source posting ID (the job source's own ID for the listing). - posting_status (query; string: "listed", "no_longer_listed"): Jobs with a posting in this state. listed means the source still shows it; no_longer_listed means a completed read no longer found it. - stale (query; boolean): true for jobs flagged stale, false for the rest. The flag is a label published with the job. Stale jobs stay in results, and stale=false leaves them out. - company_linked (query; boolean): true for jobs linked to a company record (company_id is set); false for jobs with no linked company. - has_description (query; boolean): true for jobs with a known description; false for jobs without one. - has_location (query; boolean): true for jobs with at least one known location; false for jobs with none. - has_pay (query; boolean): true for jobs with a posting that publishes pay; false for jobs with a posting that does not. - has_posting_url (query; boolean): true for jobs with a posting that has a known listing URL. - has_application_url (query; boolean): true for jobs with a posting that has a known application URL. - pay_currency (query; string): ISO 4217 currency code. Jobs with a posting whose published pay is in this currency. - pay_min (query; number; min 0, max 1000000000): Lowest yearly pay. Matches postings whose pay floor is at least this amount. Pay is compared per year (hourly x 2,080, monthly x 12); pay with an unknown interval never matches. Amounts are not converted between currencies, so pair it with pay_currency. Up to two decimal places. - pay_max (query; number; min 0, max 1000000000): Highest yearly pay. Matches postings whose pay ceiling is at most this amount, compared per year the same way as pay_min. Must not be below pay_min. - first_seen_until (query; string (date) or string (date-time)): First collected by Headcount Labs on or before this time. Accepts an RFC 3339 timestamp or a plain date. - updated_until (query; string (date) or string (date-time)): Last changed on or before this time. Accepts an RFC 3339 timestamp or a plain date. - curated_until (query; string (date) or string (date-time)): Entered the final dataset on or before this time. Accepts an RFC 3339 timestamp or a plain date. - last_fetch_since (query; string (date) or string (date-time)): Jobs with a posting whose job source was last read completely on or after this time. Accepts an RFC 3339 timestamp or a plain date. - last_fetch_until (query; string (date) or string (date-time)): Jobs with a posting whose job source was last read completely on or before this time. Accepts an RFC 3339 timestamp or a plain date. - application_check (query; string: "available", "closed", "broken", "inconclusive"): Jobs with a posting whose latest application check had this result. available means an application could still be started. - application_check_since (query; string (date) or string (date-time)): Jobs with a posting whose latest application check ran on or after this time. Accepts an RFC 3339 timestamp or a plain date. Responses: - 200: Matching job count and snapshot watermark. Body: JobCountResponse. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## GET /v1/jobs/{jobId} **Get a job by ID** Returns one job with all its linked postings from the latest published jobs catalog. Responds 503 catalog_unavailable while no jobs catalog has been published. Parameters: - jobId (path, required; JobId): Headcount Labs job ID (lowercase UUID). A merged job redirects (308) to the job it merged into; a withdrawn job returns 410. - fields (query; string): Comma list of the job properties to return; repeat the parameter or separate names with commas. Allowed names are job_id, currentness, stale, company_id, employer_name, title, description, work_arrangement, locations, job_first_seen_at, curated_at, job_updated_at, postings and company. job_id is always returned. Without fields the whole job is returned. An unknown name returns 400. It changes only the shape of each job, never which jobs match. Responses: - 200: A public job record with all linked postings. Body: JobDetailResponse. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. - 504: The query was stopped at the time limit (code query_timeout). No records are charged. Do not repeat it unchanged: narrow the filters, for example use title instead of q and add a state or employer. Job searches and counts now report a query stopped at the 90-second cap as 503 query_too_broad. Body: ErrorEnvelope. ## PUT /v1/account/overage **Turn overage billing on or off and set its monthly limit** Turns overage billing on or off for an account with an active paid subscription, and sets an optional monthly limit in US dollars. Overage is off by default. monthlyLimitUsd is a positive number with at most two decimals, up to 100000. With no limit, which is the default, overage has no ceiling. With a limit, once the month's overage dollars reach it requests stop with 429 data_limit_exceeded, nothing is billed above it, and a page that would cross it is refused whole. null clears the limit and leaving the field out keeps the stored one. An account without an active paid subscription answers 403 upgrade_required with an upgrade_url, or 403 no_active_subscription. The same change is available to agents as the set_overage MCP tool. This request is not counted against the request windows. Request body (JSON, required): - enabled (boolean): - monthlyLimitUsd (number or null; above 0, max 100000): Monthly overage limit in US dollars; null clears it (no limit). Omit to keep the stored value. Responses: - 200: The overage setting and this month's overage use. Body: OverageStatus. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 403: upgrade_required (no paid subscription; the error carries upgrade_url) or no_active_subscription. Body: ErrorEnvelope. - 409: overage_item_conflict. The subscription already carries a different overage price; contact support. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. ## GET /v1/usage/requests **List customer request events** Lists the authenticated customer's admitted requests. The cursor freezes admission membership for one hour; settlement status stays current. Parameters: - from (query, required; string (date-time)): Inclusive UTC RFC 3339 timestamp. - to (query, required; string (date-time)): Exclusive UTC RFC 3339 timestamp; at most 31 days after from. - route_class (query; string: "jobs.list", "jobs.detail", "jobs.changes", "jobs.count", "companies.jobs", "companies.list", "companies.detail", "companies.search", "usage.requests", "usage.analytics"): Only requests of this kind, for example jobs.list, jobs.count or companies.detail. - api_key_id (query; string; min length 1, max length 200): Only requests made with this key (one of your own keys). - limit (query; integer; min 1, max 100, default 50): Rows per page, 1-100. Defaults to 50. - cursor (query; string; min length 1, max length 8192): The next_cursor from the previous page. Usage cursors expire after one hour. Responses: - 200: A page of request events. Body: UsageRequestsPage. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 404: The company or customer-owned API key was not found. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. ## GET /v1/usage/analytics **Read customer daily usage** Reports up to 100,000 unique events and 1,000 groups in a period of at most 31 days. Request metrics use admission day; record metrics use finalization day. Parameters: - from (query, required; string (date-time)): Inclusive UTC RFC 3339 timestamp. - to (query, required; string (date-time)): Exclusive UTC RFC 3339 timestamp; at most 31 days after from. - route_class (query; string: "jobs.list", "jobs.detail", "jobs.changes", "jobs.count", "companies.jobs", "companies.list", "companies.detail", "companies.search", "usage.requests", "usage.analytics"): Only requests of this kind, for example jobs.list, jobs.count or companies.detail. - api_key_id (query; string; min length 1, max length 200): Only requests made with this key (one of your own keys). - group_by (query; string: "route_class", "status_class", "api_key_id"): Group the totals by route_class, status_class or api_key_id. Omit it for one overall total. Responses: - 200: Daily usage groups. Body: UsageAnalytics. - 400: The request parameters or body are invalid. Body: ErrorEnvelope. - 401: A valid bearer API key is required. Body: ErrorEnvelope. - 404: The company or customer-owned API key was not found. Body: ErrorEnvelope. - 422: The report exceeded a complete-result limit. Body: ErrorEnvelope. - 429: A request window or the allowance was reached. Body: ErrorEnvelope. - 503: The required service or publication is unavailable (code catalog_unavailable or service_unavailable). A search or count stopped at the 90-second limit returns query_too_broad instead (no records are charged; narrow it, for example use title instead of q, rather than repeating it). service_unavailable is also returned when three long searches are already running (retry in a minute). Body: ErrorEnvelope. ## Schemas ### JobsExport - export_id (string (uuid), required): - status (string: "queued", "running", "completed", "failed", "expired", required): - created_at (string (date-time), required): - completed_at (string or null (date-time), required): - expires_at (string or null (date-time), required): - record_count (integer; min 0, required): - snapshot_watermark (string or null, required): - request (object, required): - files (array of object, required): - error (string): ### CompanyId Type: string (uuid) ### JobId Type: string (uuid) ### FieldStateSourceOmitted The source did not publish this field. - state (any, required): ### FieldStateSourceUnmapped The source published a value outside this field's vocabulary. The value stays null and evidence keeps the source's own words. - state (any, required): - value (null, required): - evidence (array of string, required): ### FieldStateExtractionFailed The source published this field but Headcount Labs could not read it. - state (any, required): ### FieldStateKnownString - state (any, required): - value (string, required): ### FieldStateDerivedString A value computed from source data by a fixed rule, never by a model. Evidence names the rule's input. - state (any, required): - value (string, required): - evidence (array of string, required): ### FieldStateString Type: FieldStateKnownString or FieldStateSourceOmitted or FieldStateSourceUnmapped or FieldStateExtractionFailed or FieldStateDerivedString ### FieldStateKnownWorkArrangement - state (any, required): - value (string: "remote", "hybrid", "in_person", required): ### FieldStateDerivedWorkArrangement A value computed from source data by a fixed rule, never by a model. Evidence names the rule's input. - state (any, required): - value (string: "remote", "hybrid", "in_person", required): - evidence (array of string, required): ### FieldStateWorkArrangement Type: FieldStateKnownWorkArrangement or FieldStateSourceOmitted or FieldStateSourceUnmapped or FieldStateExtractionFailed or FieldStateDerivedWorkArrangement ### FieldStateKnownObject - state (any, required): - value (object, required): ### FieldStateDerivedObject A value computed from source data by a fixed rule, never by a model. Evidence names the rule's input. - state (any, required): - value (object, required): - evidence (array of string, required): ### FieldStateObject Type: FieldStateKnownObject or FieldStateSourceOmitted or FieldStateSourceUnmapped or FieldStateExtractionFailed or FieldStateDerivedObject ### JobPosting - posting_id (string, required): Headcount Labs's ID for this posting (one public listing of the job on one job source). - source (string, required): The job source vendor, such as greenhouse or smartrecruiters. - source_posting_id (string, required): The job source's own ID for this posting. - posting_status (string: "listed", "no_longer_listed", required): listed while the source still shows the posting; no_longer_listed once a completed fetch no longer finds it. - posting_url (FieldStateString, required): The posting's public page on the job source. - application_url (FieldStateString, required): Where to apply for this posting, when the source gives an application link. - location (FieldStateObject, required): The posting's location as the source published it (city, region, country). When the posting itself states a US postal code that is real and lies in the stated state, the object also has zip, the 5-digit ZIP (ZIP+4 is cut to 5). zip is absent for a city-only location, a street address without a ZIP, a remote posting and any non-US location; it is never derived from a city or a point. - pay (FieldStateObject, required): Pay as the source published it (minimum, maximum, currency and period), not converted. - source_posted_at (string or null (date-time), required): The date the job source says the posting was published. - first_seen_at (string (date-time), required): When Headcount Labs first collected this posting. - last_completed_fetch_at (string or null (date-time), required): When Headcount Labs last read the posting's job source completely. - latest_application_check (object or null, required): Headcount Labs's latest check of whether an application can still be started (available, closed, broken or inconclusive) and when it ran. - attribution (object, required): What the job source's rights record says about crediting it. null means the rights record does not say. When required is true, show text and link with the job. - source_data (object): Allowlisted source metadata, present only when requested. The source payload and internal extraction details are not published. ### Job - job_id (JobId, required): The combined Headcount Labs job ID. One job links every posting of the same opening. - merged_into_job_id (JobId): Present on merged-job redirects. - currentness (string: "current", "uncertain", "not_current", required): current while a linked posting is listed and accepting applications; uncertain when Headcount Labs cannot confirm that; not_current when every linked posting is no longer listed. - stale (boolean, required): A label published with the job. A stale job stays listed and in results; filter with stale=false to leave stale jobs out. - company_id (CompanyId or null, required): The Headcount Labs company record. Null when the job's employer is not yet linked to a company record; employer_name then carries the name the source published. - employer_name (FieldStateString, required): The employer name. - title (FieldStateString, required): The job title. - description (FieldStateString, required): The job description as plain text. - work_arrangement (FieldStateWorkArrangement, required): remote, hybrid or in_person, as the source states it. - locations (array of FieldStateObject, required): Every location of the job, combined from its linked postings. A known location value holds the address fields (street, city, region, postal_code, country); zip, the 5-digit US ZIP the posting states for that place when it states one that is real and in the stated state (the key is absent otherwise); and, when Headcount Labs could place the location, county_fips (5-digit US county FIPS code, a string such as 48453) and msa (cbsa_code, cbsa_title and type, metro or micro, of the metropolitan or micropolitan statistical area; null when the location is in no statistical area). - job_first_seen_at (string (date-time), required): When Headcount Labs first collected any posting of this job. - curated_at (string (date-time), required): When the job first entered the final dataset. - job_updated_at (string (date-time), required): When the job record last changed; sort=updated orders by this. - postings (array of JobPosting, required): ### JobDetailResponse - data (Job, required): ### JobListResponse - data (array of Job, required): - next_cursor (string or null, required): - snapshot_watermark (string (date-time), required): ### JobChange - event_id (string, required): - job_id (JobId, required): - type (string: "created", "updated", "expired", required): - occurred_at (string (date-time), required): - job (Job): ### JobsChangesResponse - data (array of JobChange, required): - resume_cursor (string, required): - has_more (boolean, required): - snapshot_watermark (string (date-time), required): ### JobCountResponse - count (integer; min 0, required): - snapshot_watermark (string (date-time), required): ### Company - company_id (CompanyId, required): - name (string, required): - country (string or null, required): ISO 3166-1 alpha-2 code, or null when the registry country is unknown. - status (string: "active", "retired", "merged", required): - region (string or null, required): State or province code from the same government address as country, or null when unknown. - address_source (string or null: "sec", "dol_form5500", null, required): Which government address gave country and region: sec (SEC business address) or dol_form5500 (Form 5500 plan sponsor address). Null when no government address is known. - identifiers (array of object, required): Public registry identifiers, each from a US-government public source. Empty when none is known. - industries (array of object, required): Industry codes, each from a US-government public source. Empty when none is known. ### CompanyPage - data (array of Company, required): - next_cursor (string or null, required): ### CompanySearchRequest - name (string; min length 1, max length 200): Case-insensitive canonical-name substring after trimming. - country (string): ISO 3166-1 alpha-2 code, case-insensitive. - status (string: "active", "retired", "merged"): - limit (integer; min 1, max 100, default 50): - cursor (string; min length 1, max length 2048): ### ErrorEnvelope - error (object, required): ### UsageRequestRow - request_id (string, required): - api_key_id (string, required): - route_class (string, required): - admitted_at (string (date-time), required): - finalized_at (string or null, required): - state (string, required): - http_status (integer or null, required): - request_charged (boolean, required): - records_returned (integer; min 0, required): - policy_id (string or null, required): - policy_version (integer or null, required): - settlement_policy_id (string or null, required): - settlement_policy_version (integer or null, required): ### OverageStatus - overage_enabled (boolean, required): - overage_monthly_limit_usd (number or null, required): The monthly overage limit in US dollars; null when the customer set none. - overage_limit_remaining_usd (number or null, required): Dollars of the limit not yet used this month; null when there is no limit. - overage_jobs_used (integer, required): Jobs used this UTC month past the included allowance. - overage_usd (number, required): This month's overage so far, rounded up to the cent. ### UsageRequestsPage - data (array of UsageRequestRow, required): - next_cursor (string or null, required): - admissions_captured_at (string (date-time), required): ### UsageDailyGroup - day (string (date), required): - group (string, required): - request_events (integer, required): - charged_requests (integer, required): - pending_requests (integer, required): - rate_limited_requests (integer, required): - usage_limited_requests (integer, required): - http_status_2xx (integer, required): - http_status_3xx (integer, required): - http_status_4xx (integer, required): - http_status_5xx (integer, required): - error_rate (number or null; min 0, max 1, required): Share of admitted requests in this day and group that returned a 4xx or 5xx response, rounded to four decimal places; null when no requests were admitted. - returned_records (integer, required): - job_records_returned (integer, required): - company_records_returned (integer, required): ### UsageAnalytics - query_timestamp (string (date-time), required): - time_basis (object, required): - group_by (string or null: "route_class", "status_class", "api_key_id", null, required): - data (array of UsageDailyGroup, required): --- # Search and location filters URL: https://headcountlabs.com/docs/search-and-location/ # Search and location filters How text and place filters match, with the rules that decide whether a place query finds what you expect. ## Text search `q` searches the title and description together. `title` matches the title and `description` matches the description, each as one phrase. Quotes and asterisks are removed first. `q` does not search the company or the location. A text value is 1 to 200 characters. For several words in any order, exclusions, groups or prefixes, use `title_advanced` or `description_advanced`. They take a Boolean expression such as `nurse AND NOT manager`. The [query language](https://headcountlabs.com/docs/query-language/) page has the syntax and examples. **Fast searches.** For job titles, use `title` (one phrase in order, for example `title=executive assistant`) or `title_advanced`, plus filters such as `country`, `state`, `city`, `company` or `source`; these usually answer in about a second. `q` is a broad full-text search of the title and description together, ranked by relevance (relevance is the default sort when `q` or `title` is set). It is usually the slower filter: on 12 November 2026 `title=executive assistant&country=NG¤tness=current&limit=20` answered in under a second; after a later fix the same search with `q=executive assistant` returns in about 0.2 seconds. Use `q` only when the words must also be found in descriptions, and if a `q` search with a narrow filter is slow, `sort=updated` can be faster. ## Location filters Every known location of a job is stored with a city, a region, a two-letter country code and search text. The search text is the street, city, region, postal code and country joined by spaces, in lower case. | Filter | How it matches | |---|---| | `location` | The text appears anywhere in a location’s search text. Not case sensitive. | | `city` | The text appears in the location’s city. Not case sensitive. | | `country` | Exact two-letter ISO code such as `US` or `DE`. Up to 10 codes, separated by commas, match jobs in any of them. | | `state` | Two-letter subdivision code. Alone it means a US state, so `state=CA` is California. With `country` it means that country’s subdivision: `country=CA&state=BC` is British Columbia. | | `msa` | A five-digit CBSA code, for example `12420` for Austin-Round Rock-San Marcos, TX. Matches any location in that metropolitan or micropolitan area. | ## Rules for location filters - All location filters in one request must match the same location of the job. `city=Paris&country=FR` finds Paris, France. `city=Paris&state=TX` finds Paris, Texas. - Send one place name for each filter. The search text has no commas, so `location=Austin, TX` does not match. Use `city=Austin&state=TX`. - For a country, use the code in `country` rather than a name in `location`. - Accents are kept: Montréal and Montreal are different text. - For remote work, use `work_arrangement=remote`, not a location. - `has_location=false` finds jobs with no known location. ## Examples ``` GET /v1/jobs/count?city=Austin&state=TX&work_arrangement=hybrid GET /v1/jobs/count?country=DE&title_advanced=engineer:* GET /v1/jobs?msa=41860&has_pay=true&limit=50 GET /v1/jobs?country=US,CA,GB&title=data%20analyst ``` ## The website search is separate The sample explorer on the website searches a dated snapshot by title, company or description and can filter by source. It is a demonstration. For the API, use the filters on this page and the [job filters](https://headcountlabs.com/docs/filters/) reference. Source: https://headcountlabs.com/docs/search-and-location/ --- # Plan a safe data sync URL: https://headcountlabs.com/docs/sync-strategy/ # Plan a safe data sync A step-by-step plan for loading a slice of jobs and keeping it current without gaps or duplicates. ## Plan the sync before you start A good sync loads once, then follows changes. Decide first which jobs you want, because every read costs requests. Write the filters down (for example `country=US` and `work_arrangement=remote`) and keep them fixed for the whole sync. A cursor belongs to one query, so changing a filter or the page size means starting again. ## Step 1: load a slice at a time - Note the time. You will need it for the changes feed. - Count the slice with `GET /v1/jobs/count` to estimate pages. - Page through `GET /v1/jobs` with `limit=250`, passing each `next_cursor` back as `cursor`. Or run an [export](https://headcountlabs.com/docs/bulk-download/) when the slice is 100,000 jobs or fewer. - Save each job under its `job_id`, replacing any earlier copy. Do not append. Load by slices (one country, or one `updated_since` to `updated_until` range at a time). If a load fails, you only repeat one slice. ## Step 2: follow the changes feed Start `GET /v1/jobs/changes` with `since` set to the time you noted in step 1, so nothing that changed during the load is missed. After each page, save the work first and then store the page’s `resume_cursor`. Pass it as `after` next time. Keep reading while `has_more` is true. - Replace your copy with the `job` in `created` and `updated` events. - Mark the job closed on an `expired` event. It carries no job object. - Skip events whose `event_id` you have already applied. ## Make writes safe to repeat Cursors and retries mean you will sometimes read the same job twice. If every write replaces the job by `job_id`, a repeated read changes nothing. Keep the `occurred_at` and `event_id` of the last event you applied as a fallback. ## When a cursor stops working A jobs cursor in the default order keeps working while new data is published, but a long walk can miss a job added or updated during it. That is why you follow the walk with the changes feed. A relevance cursor, and any cursor from an older catalog version, can return `400`. Restart that listing from its first page. For the changes feed, restart with `since` set a little before the `occurred_at` of your last saved event. ## Test the failure cases - A page you already saved arrives again. - A cursor is rejected after a new catalog version. - Your process stops halfway through a page. - `429` with `Retry-After`: wait that many seconds. - `503`: retry after a short pause. - `503 query_too_broad`: the query hit the 90-second limit; narrow the slice instead of repeating it. `504 query_timeout` means the query could not start in time; retry after `Retry-After`. Source: https://headcountlabs.com/docs/sync-strategy/ --- # Usage and limits URL: https://headcountlabs.com/docs/usage-and-limits/ # Usage and limits The free allowance, request limits and paid usage in one place, and where to watch your own use. ## What your limits are Three limits apply to an account, and all of an account’s keys share them. | Limit | How it works | Where to read more | |---|---|---| | Free monthly allowance | 100,000 records each UTC calendar month, shared by every API key on the organization. It comes back on the 1st. | [Pricing](https://headcountlabs.com/pricing/) | | Request rate | The number of requests in any 60-second window. Over it, you get `429 rate_limited` and a `Retry-After` header. | [Rate limits](https://headcountlabs.com/docs/rate-limits/) | | Paid usage | Prepaid usage or pay as you go covers records after the free allowance, at $0.01 per 1,000 records. | [Pricing](https://headcountlabs.com/pricing/) | ## Watch your usage Every response carries headers that report your window and allowance. See the [errors and headers](https://headcountlabs.com/docs/errors/) page for the full list. For history, [the usage reporting endpoints](https://headcountlabs.com/docs/usage/) list your recent requests and give daily totals by route class, status class or key. In the MCP server, `get_usage` reports your allowance and costs nothing. See [MCP tools](https://headcountlabs.com/docs/mcp-tools/). ## Requests and records are different A request is one call. A record is one job or company that a successful response returns. Prices are per record, so a request that returns 100 jobs costs 20 times as much as one that returns 5. Requests count toward the rate limit, so use the largest page that suits you. A request that fails validation is still a request that the API admitted, so fix errors instead of retrying blindly. A request refused with 401 or 429 is not counted. ## What uses allowance and what is free | Call | Counts? | |---|---| | Filtered list or keyword search | Yes, one record per job returned | | Count or search count | No. It returns no records | | Read one job | Yes, one record | | Changes feed | Yes, one record per job in each page | | Usage reports | They return no jobs and do not use the free job allowance | | Errors, redirects and empty pages | No records are charged | ## If you run out When the free allowance for the month is gone and you have no prepaid usage or pay as you go, calls are refused with a rate-limit error until the allowance comes back on the 1st of the next month. Add prepaid usage from $1 or turn on pay as you go from your account. The MCP connector uses the same allowance and prices. ## Researchers, nonprofits and students If you need more free allowance or a discount, email [support@headcountlabs.com](mailto:support@headcountlabs.com) and describe what you are building. Source: https://headcountlabs.com/docs/usage-and-limits/ --- # Usage reporting endpoints URL: https://headcountlabs.com/docs/usage/ # Usage reporting endpoints Read your own request ledger and daily totals, with the time rules and limits. ## Two reports | Route | What it returns | |---|---| | `GET /v1/usage/requests` | One row for each request your account made: request ID, key ID, route class, times, state, HTTP status, whether it was charged and how many records it returned. | | `GET /v1/usage/analytics` | Daily totals: requests, charged, pending, rate-limited and over-limit requests, counts of 2xx, 3xx, 4xx and 5xx responses, error rate and records returned (jobs and companies). | Both are free to read. They return no jobs and are left out of their own results. ## Request ledger ``` GET /v1/usage/requests?from=2026-10-13T00:00:00Z&to=2026-10-14T00:00:00Z&limit=100 ``` The response is `{data, next_cursor, admissions_captured_at}`. `from` and `to` are required UTC timestamps with `from` before `to`, at most 31 days apart. Filter with `route_class`. `limit` is 1 to 100 (default 50). Several fields in each row can be null, for example `finalized_at` on a request that has not completed. The cursor freezes which requests are included for one hour, while the status of those requests stays current. After an hour, start again. ## Daily analytics ``` GET /v1/usage/analytics?from=2026-10-01T00:00:00Z&to=2026-10-14T00:00:00Z&group_by=route_class ``` Use `group_by` with `route_class`, `status_class` or `api_key_id` to split each day. Without it you get one total for each UTC day. Request counts belong to the UTC day the request was admitted. Returned-record counts belong to the day the request finished. `error_rate` is the share of requests that returned a 4xx or 5xx response, rounded to four decimal places, or null when there were none. A report that would cover more than 100,000 requests or 1,000 groups returns `422`; use a shorter period. ## Rules - Times are RFC 3339 in UTC, ending with `Z`. The period starts at `from` and ends just before `to`. - Send each parameter once. Unknown or repeated parameters return `400`. - `api_key_id` filters one key. All keys on an account appear together by default. ## A report is not an invoice The reports describe requests and returned records. They do not show a dollar balance or invoice. See your account page for billing, and the [pricing page](https://headcountlabs.com/pricing/) for the rate. ## Empty result ``` { "data": [], "next_cursor": null, "admissions_captured_at": "2026-10-14T12:00:00.000Z" } ``` A period with no requests returns an empty `data` array and a null cursor. That is a success, not an error. Source: https://headcountlabs.com/docs/usage/ --- # Field dictionary URL: https://headcountlabs.com/docs/fields/ # Field dictionary Every field in a job record, with a complete real example, the states a value can be in, and the value lists behind the filters. ## One complete record A real job from the live API on October 14, 2026, requested with `include=company,source_data`. Only the description text is shortened, and the `company.identifiers` and `company.industries` entries are the values Headcount Labs returned for this employer. `next_cursor` and `snapshot_watermark` sit beside `data` on list responses; a single-job response holds only `data`. ``` { "data": [ { "job_id": "9f70ad16-ab51-49fe-b964-62067a7946b3", "currentness": "current", "stale": false, "company_id": "3483b509-5f22-4535-a907-19c285f3b460", "employer_name": { "state": "known", "value": "Cloudflare" }, "title": { "state": "known", "value": "Senior Customer Engineer, Strategic - San Francisco" }, "description": { "state": "known", "value": "(plain-text job description, left out here for length)" }, "work_arrangement": { "state": "known", "value": "hybrid" }, "locations": [ { "state": "known", "value": { "city": "San Francisco", "region": "US-CA", "country": "US", "county_fips": "06075", "msa": { "type": "metro", "cbsa_code": "41860", "cbsa_title": "San Francisco-Oakland-Fremont, CA" } } } ], "job_first_seen_at": "2026-10-07T19:31:45.114Z", "curated_at": "2026-10-13T07:33:18.049Z", "job_updated_at": "2026-10-14T23:30:26.947Z", "postings": [ { "posting_id": "79de47fa11a25e23ad485762a9a0fb1c09cca32f3ae3c108b7788734134d504c", "source": "greenhouse", "source_posting_id": "8246078", "posting_status": "listed", "posting_url": { "state": "known", "value": "https://boards.greenhouse.io/cloudflare/jobs/8246078?gh_jid=8246078" }, "application_url": { "state": "known", "value": "https://boards.greenhouse.io/cloudflare/jobs/8246078?gh_jid=8246078" }, "location": { "state": "known", "value": { "city": "San Francisco", "state": "CA", "remote": false, "country": "US" } }, "pay": { "state": "known", "value": { "max": 336000, "min": 214000, "currency": "USD", "interval": "year" } }, "source_posted_at": "2026-10-06T14:22:31.000Z", "first_seen_at": "2026-10-07T19:31:45.114Z", "last_completed_fetch_at": "2026-10-14T14:04:07.098Z", "latest_application_check": null, "attribution": { "required": null, "text": null, "link": null }, "source_data": { "job_location_type": "hybrid", "source_posted_at": "2026-10-06T14:22:31.000Z", "source_updated_at": "2026-10-14T00:57:01.000Z", "employment_type": null, "source_type": "greenhouse", "availability": "listed" } } ], "company": { "company_id": "3483b509-5f22-4535-a907-19c285f3b460", "name": "Cloudflare", "country": "US", "status": "active", "region": "CA", "address_source": "sec", "identifiers": [ { "scheme": "ein", "value": "270805829", "exchange": null, "source": "sec" }, { "scheme": "sec_cik", "value": "0001477333", "exchange": null, "source": "sec" }, { "scheme": "ticker", "value": "NET", "exchange": null, "source": "sec" }, { "scheme": "uei", "value": "JV9YXS9MLA48", "exchange": null, "source": "sam_gov" } ], "industries": [ { "system": "naics", "code": "541519", "source": "sam_gov" }, { "system": "sic", "code": "7372", "source": "sec" } ] } } ], "next_cursor": "", "snapshot_watermark": "2026-10-14T01:43:41.000Z" } ``` ## How to read a value Most text-like fields are wrapped in a small object that says where the value came from. Read `state` first and only then look for `value`. | state | Shape | What it means | |---|---|---| | `known` | `{"state":"known","value":"Engineer"}` | The source gave a usable value. | | `source_omitted` | `{"state":"source_omitted"}` | The source did not publish this. There is no `value` key. | | `source_unmapped` | `{"state":"source_unmapped","value":null,"evidence":["…"]}` | The source published something, but it did not map to a defined value. `evidence` shows the source text. | | `extraction_failed` | `{"state":"extraction_failed"}` | Headcount Labs tried to read the value and could not. There is no `value` key. | | `derived` | `{"state":"derived","value":"hybrid","evidence":["…"]}` | Headcount Labs worked the value out from the posting text. `evidence` quotes what it used. | A state is never the same as `null`. Treat `source_omitted` and `extraction_failed` as "unknown", and keep them apart from a known empty value. ## Job fields | Field | Type | What it holds | |---|---|---| | `job_id` | UUID | The combined job. One job joins every posting of the same opening across job boards. | | `merged_into_job_id` | UUID | Only on the body of a 308 redirect, when this job was merged into another one. | | `currentness` | `current`, `uncertain`, `not_current` | `current` while a linked posting is listed and accepting applications. `uncertain` when that cannot be confirmed. `not_current` when every linked posting is no longer listed. | | `stale` | boolean | A label published with the job. A stale job stays in results. Filter with `stale=true` or `stale=false`. | | `company_id` | UUID or null | The company record for the employer. Null when the employer is not yet linked to a company record; `employer_name` then holds the name the source published. | | `employer_name` | field state (string) | The employer name as published. | | `title` | field state (string) | The job title as published. | | `description` | field state (string) | The description as plain text. | | `work_arrangement` | field state | `remote`, `hybrid` or `in_person`. A `derived` value carries the evidence it came from. | | `locations` | array of field states | Every location of the job, merged from its postings. See the location section below. | | `job_first_seen_at` | timestamp | When Headcount Labs first collected any posting of this job. | | `curated_at` | timestamp | When the job first entered the final dataset. | | `job_updated_at` | timestamp | When the job record last changed. `sort=updated` orders by this. | | `postings` | array | One entry for each public listing of the job on one job source. | | `company` | object or null | Present only when you ask for it with `include=company` or `fields=company`. See the company section below. | ## Posting fields Each entry in `postings` is one listing of the job on one source. | Field | Type | What it holds | |---|---|---| | `posting_id` | string | Headcount Labs ID for this posting. | | `source` | string | The job-board platform, for example `greenhouse`, `lever` or `workday`. The [platform list](https://headcountlabs.com/docs/platforms/) shows every value. | | `source_posting_id` | string | The source’s own ID for the posting. | | `posting_status` | `listed` or `no_longer_listed` | `listed` while the source still shows the posting. `no_longer_listed` once a completed read no longer finds it. | | `posting_url` | field state (string) | The posting’s public page on the source. | | `application_url` | field state (string) | Where to apply, when the source gives an application link. | | `location` | field state (object) | The location exactly as the source published it. Different shape from the job-level `locations`. | | `pay` | field state (object) | Pay as published, not converted. | | `source_posted_at` | timestamp or null | The date the source says it published the posting. | | `first_seen_at` | timestamp | When Headcount Labs first collected this posting. | | `last_completed_fetch_at` | timestamp or null | When Headcount Labs last read the posting’s source completely. | | `latest_application_check` | object or null | `{"result","checked_at"}`, where result is `available`, `closed`, `broken` or `inconclusive`. | | `attribution` | object | `{"required","text","link"}`. What the source’s rights record says about crediting it. All three are null when the record says nothing. When `required` is true, show `text` and `link` with the job. | | `source_data` | object | Only with `include=source_data`. See the source data section below. | ## Locations A job has two kinds of location data, and they use different keys. **Job level (`locations[].value`)** is cleaned and enriched. Keys: `city`, `region` (ISO 3166-2, for example `US-TX`), `country` (two letters), `county_fips` (a five-digit US county code as a string, or null), `msa` and, when the source gives them, `street` and `postal_code`. `msa` is `{"type":"metro" or "micro","cbsa_code","cbsa_title"}`, or null when the place is in no statistical area. `zip` is a five-digit US ZIP, present only when the posting states a real ZIP inside the stated state; the key is absent otherwise. **Posting level (`postings[].location.value`)** is the source’s own data, so keys follow what the source publishes: `city`, `state`, `remote` (boolean) and `country`, plus, when the source gives them, `latitude`, `longitude`, `postalCode`, `streetAddress`, `countryRaw`, `regionCode` and `zip`. A posting that lists several places also has `alternatives`, an array where each entry has `raw`, `city`, `state`, `remote`, `country` and the same optional keys. ## Pay `postings[].pay.value` holds `min`, `max`, `currency` (ISO 4217) and `interval` (`year`, `month` or `hour`), as the source published them. When a source lists several ranges, `ranges` is an array of the same four keys. Pay is never converted between currencies or intervals in the response. The filters `pay_min` and `pay_max` compare yearly amounts: hourly pay is multiplied by 2,080 and monthly pay by 12 before comparing, and pay with an unknown interval never matches. When there is no pay, the state is `source_omitted`, or `extraction_failed` where a pay line could not be read. ## Company object Ask for it with `include=company`. Each company has `company_id`, `name`, `country` and `status` (`active`, `retired` or `merged`), plus: | Field | What it holds | |---|---| | `region` | State or province code from the same government address as `country`, or null. | | `address_source` | `sec` (SEC business address), `dol_form5500` (Form 5500 plan sponsor address) or null. | | `identifiers` | Public registry IDs from US government sources. Each has `scheme` (`sec_cik`, `ein`, `uei` or `ticker`), `value`, `exchange` and `source` (`sec`, `dol_form5500` or `sam_gov`). Empty when none is known. | | `industries` | Industry codes from US government sources. Each has `system` (`naics` or `sic`), `code` and `source`. Empty when none is known. | ## Source data With `include=source_data` each posting gets a `source_data` object with the values the source itself labels. It holds only the keys below; the raw source payload is not published. | Key | What it holds | |---|---| | `job_location_type` | The source’s own work-location label, as published. | | `source_posted_at` | The source’s posted date, as published. | | `source_updated_at` | The source’s own last-updated time, as published. | | `employment_type` | The source’s employment type label, as published. Free text; see the value lists below. | | `source_type` | The kind of source, such as an ATS board or an employer site. | | `availability` | Whether the source shows the posting as listed. | ## Other response shapes | Response | Fields | |---|---| | List and search | `data` (jobs), `next_cursor` (string or null), `snapshot_watermark` | | Single job | `data` (one job) | | Count | `count`, `snapshot_watermark` | | Changes | `data` (events), `resume_cursor`, `has_more`, `snapshot_watermark`. Each event has `event_id`, `job_id`, `type` (`created`, `updated` or `expired`), `occurred_at` and, for created and updated events, the `job`. | | Export | `export_id`, `status`, `created_at`, `completed_at`, `expires_at`, `record_count`, `snapshot_watermark`, `request`, `files` (each with `n`, `records`, `bytes`, `url`), `error` | | Error | `error.code`, `error.message`, `error.request_id` | ## Value lists Counts below are current jobs from the October 14, 2026 snapshot (4,886,218 current jobs). They change daily. Run `GET /v1/jobs/count` with the filter to see today’s number. | Field or filter | Values | |---|---| | `work_arrangement` | `remote` 127,219, `hybrid` 167,344, `in_person` 780,175. Jobs where no arrangement could be read have `source_omitted` or `extraction_failed`, so these three do not add up to the catalog. | | `currentness` | `current` (the default filter), `uncertain`, `not_current`. | | `posting_status` | `listed`, `no_longer_listed`. | | `application_check` | `available`, `closed`, `broken`, `inconclusive`. | | `pay_currency` | ISO 4217 codes. Most common: USD 1,394,280, EUR 51,333, CAD 36,444, GBP 20,232, AUD 1,975. Jobs with pay in total: 1,601,152. | | `country` | Two-letter ISO 3166-1 codes, for example `US`, `DE`, `CA`. | | `state` | Subdivision codes. Alone, a US state (`CA` is California); with `country`, that country’s subdivision. | | `source` | Platform names such as `greenhouse`, `lever`, `ashby`, `workday`. See [supported platforms](https://headcountlabs.com/docs/platforms/). | ## Employment type is free text `employment_type` is the label the source printed, so the same idea appears under many spellings. A filter matches one spelling exactly, ignoring case. These are the most common ones: | Value | Current jobs | |---|---| | Full time | 953,534 | | Full-time | 568,664 | | full_time | 269,446 | | Part time | 209,796 | | Part-time | 135,298 | | part_time | 54,624 | | contract | 48,354 | | Regular | 29,005 | | Permanent | 21,603 | | Contractor | 16,989 | | Intern | 11,800 | | Temporary | 11,529 | | Per diem | 8,913 | | Seasonal | 8,176 | | Internship | 7,351 | There is no normalized list. To cover one idea, send several spellings in one filter: `employment_type` takes up to 10 values. Use `GET /v1/jobs/count?employment_type=...` to test a spelling before you rely on it. A count over several very common spellings with no other filter can run past the 90-second limit and return `503 query_too_broad`; add a country or state to narrow it. Source: https://headcountlabs.com/docs/fields/ --- # Query language URL: https://headcountlabs.com/docs/query-language/ # Query language The Boolean title and description syntax and the Elasticsearch-style query body, with the exact rules and real examples. ## Three ways to search text Pick the simplest one that does the job. For job titles that is `title` or `title_advanced` plus filters such as `country` or `state`. `q` searches every word in the title and description, ranks by relevance and is the slowest: with a narrow filter such as a small country it can run past the 90-second limit, so use it only when the words must also be found in descriptions. | Use | Where | What it matches | |---|---|---| | `q`, `title`, `description` | Query parameters on `GET /v1/jobs`, `/v1/jobs/count` and in `POST /v1/jobs/search` bodies | `q` searches title and description together. `title` matches the title as one exact phrase. `description` matches the description. Quotes and asterisks are removed first. | | `title_advanced`, `description_advanced` | Same places | A Boolean expression with `AND`, `OR`, `NOT`, groups, phrases and prefixes. Words may appear in any order. | | `POST /v1/jobs/search/es_dsl` | Its own endpoint | An Elasticsearch-style JSON `query`. It is translated into the same filters, so it can express exactly what the filters can. | ## Boolean search with title_advanced and description_advanced Send an expression in `title_advanced` to search titles, or in `description_advanced` to search descriptions. Each parameter takes one expression of up to 200 characters. ``` GET /v1/jobs/count?title_advanced=nurse%20AND%20NOT%20manager GET /v1/jobs/count?title_advanced=engineer:*%20AND%20(senior%20%7C%20staff) ``` | Part | Syntax | Notes | |---|---|---| | Words | `engineer` | Letters, digits, `_` and `-`. | | Prefix | `engineer:*` | Matches words that start with the text, such as engineering. | | Phrase | `"customer success"` | Words next to each other. Write a quote inside a phrase as `""`. | | AND | `a AND b` or `a & b` | Both must match. | | OR | `a OR b` or `a \| b` | Either may match. | | NOT | `NOT a` or `!a` | Excludes a word. See the rule below. | | Groups | `(a OR b) AND c` | Up to 12 levels of parentheses. | Operators are not case sensitive. `NOT` binds tighter than `AND`, and `AND` binds tighter than `OR`, so use parentheses when you mix them. An expression can have up to 64 tokens. Two rules cause most 400 errors. First, put an operator between words: `senior engineer` is rejected, and `senior AND engineer` works. Second, every expression needs at least one positive word: `NOT manager` alone is rejected, and so is `a OR NOT b`. A bad expression returns `400 invalid_request` with the message "must be a valid Boolean search expression". ## Examples with real counts Counts are current jobs on October 14, 2026, from `GET /v1/jobs/count`. | title_advanced | Result | |---|---| | `senior engineer` | 400, no operator between the words | | `NOT manager` | 400, no positive word | | `senior AND engineer` | 65,580 jobs | | `nurse AND NOT manager` | 125,432 jobs | | `engineer:* AND (senior \| staff)` | 80,776 jobs | ## Elasticsearch-style queries `POST /v1/jobs/search/es_dsl` accepts a JSON body with a `query` and the usual paging and shaping options. Use it when you already have Elasticsearch queries or want a nested yes/no structure. ``` { "query": { "bool": { "filter": [ {"term": {"country": "US"}}, {"term": {"work_arrangement": "remote"}}, {"range": {"pay_min": {"gte": 150000}}}, {"exists": {"field": "application_url"}} ], "must": [{"match": {"title_advanced": "data AND (engineer OR scientist)"}}] } }, "fields": ["job_id", "title", "employer_name"], "limit": 25 } ``` The body may contain these top-level keys: `query` (required), `limit`, `cursor`, `sort`, `fields`, `include` and `description_format`. The body can be up to 16,384 bytes and must be sent as `application/json`. Responses look like `GET /v1/jobs` responses. ## Supported clauses | Clause | What it does | |---|---| | `match_all` | Matches everything. Must be `{}`. | | `bool` | Combines clauses with `must` and `filter` (both mean AND), `should`, `must_not` and `minimum_should_match` (only the value 1). | | `term`, `match`, `match_phrase` | One field and one value, for example `{"term":{"country":"US"}}`. The value may also be written `{"value": ...}` or `{"query": ...}`. | | `terms` | One field and 1 to 10 values. Several values are allowed only for `country`, `employment_type`, `currentness`, `include` and `exclude_source`. | | `range` | One field with `gte`, `gt`, `lte` or `lt`. `gt` and `lt` are treated as inclusive. Fields: `posted_since`/`posted_until`, `first_seen_*`, `updated_*`, `curated_*`, `last_fetch_*`, `pay_min`/`pay_max`, `created_at`, `last_updated` and `application_check_since` (lower bound only). | | `exists` | `{"field": "pay"}`. Fields: `description`, `keyword_description`, `location`, `locations`, `pay`, `posting_url`, `application_url`. Inside `must_not` it means "does not exist". | | `query_string`, `simple_query_string` | Text search: `query` and an optional `fields` list of `title` and/or `description`. Both fields (or none) search `q`; one field searches that field as a phrase. These do not use the Boolean syntax above; for Boolean text, `match` on `title_advanced` or `description_advanced`. | ## Fields and aliases Any filter name works as a field in `term`, `terms`, `match` and `match_phrase`: for example `country`, `state`, `city`, `work_arrangement`, `employment_type`, `source`, `company_id`, `pay_currency`, `title_advanced` and `description_advanced`. The list of filters is on the [job filters](https://headcountlabs.com/docs/filters/) page. These aliases are also accepted: | Alias | Same as | |---|---| | `remote_type` | `work_arrangement` | | `published_since` | `posted_since` | | `keyword_description` | `description` | | `company_name` | `company` | | `created_at` | `first_seen_since` (range only) | | `last_updated` | `updated_since` (range only) | | `application_active` | `true` only; means `application_check=available` | | `deleted` | `0`/`false` means current jobs, `1`/`true` means not current | ## Rules and limits - Clauses nest up to 32 levels deep. - `should` accepts only `term` or `match` clauses on one field, `country` or `employment_type`, with up to 10 values. It means "any of these". - `must_not` accepts `source` (which becomes `exclude_source`) and `exists` clauses only. - Clauses are combined with AND. Two clauses that set the same single-value filter to different values are rejected, and so is an AND of different `country`, `employment_type`, `currentness` or `include` lists, because that would change which jobs match. - Anything else (aggregations, scripts, fuzzy or wildcard clauses, unknown fields) returns `400 invalid_request` and the message names the clause or field it rejected. - Searches and counts are limited to 90 seconds. A query stopped at the limit returns `503 query_too_broad` and uses no records. Do not repeat it unchanged: for job titles use `title` or `title_advanced` instead of `q`, add filters such as state, city, company or source, or ask for a smaller `limit`. A `503` whose message says the service is busy means three long searches are already running; wait a minute and retry, or narrow the search. Source: https://headcountlabs.com/docs/query-language/ --- # Code samples URL: https://headcountlabs.com/docs/code-samples/ # Code samples Request code in Python, Node.js, Ruby, PHP and curl for listing, counting, searching, syncing and exporting jobs. ## Before you run anything Every sample reads your key from the `HEADCOUNTLABS_API_KEY` environment variable and sends it as `Authorization: Bearer ...`. Keep the key on a server or in a protected shell. Do not paste it into code you share or commit. The base URL is `https://api.headcountlabs.com`. On any failure the samples print the status code and the error body, which has `error.code`, `error.message` and `error.request_id`. Quote the request ID when you contact support. On October 14, 2026 the Python and Node.js samples on this page were run against the live API with an invalid key. Each one sent the request to the right host and path with the right header and body, and received the expected `401 invalid_api_key` response. Run them with your own key to see real results. The Ruby, PHP and curl samples use the same requests. ## Shared setup Each language starts with a small helper. It sends the key, retries a `429` or `503` once or twice after the number of seconds in `Retry-After` (when that is two minutes or less), and raises an error with the response body for any other failure. The samples below call this helper. **Python** **Node.js** **Ruby** **PHP** **curl** ``` import os import time import requests BASE = "https://api.headcountlabs.com" session = requests.Session() session.headers["Authorization"] = "Bearer " + os.environ["HEADCOUNTLABS_API_KEY"] def call(method, path, **kwargs): for attempt in range(3): response = session.request(method, BASE + path, timeout=60, **kwargs) wait = int(response.headers.get("Retry-After", "5")) if response.status_code in (429, 503) and attempt < 2 and wait <= 120: time.sleep(wait) continue if not response.ok: raise RuntimeError(f"{response.status_code} {response.text}") return response raise RuntimeError("unreachable") ``` ``` // Node.js 18 or newer (built-in fetch) const BASE = "https://api.headcountlabs.com"; const KEY = process.env.HEADCOUNTLABS_API_KEY; async function call(method, path, body) { for (let attempt = 0; attempt < 3; attempt++) { const response = await fetch(BASE + path, { method, headers: { Authorization: `Bearer ${KEY}`, ...(body ? { "Content-Type": "application/json" } : {}), }, body: body ? JSON.stringify(body) : undefined, }); const wait = Number(response.headers.get("retry-after") ?? 5); if ([429, 503].includes(response.status) && attempt < 2 && wait <= 120) { await new Promise((resolve) => setTimeout(resolve, wait * 1000)); continue; } if (!response.ok) throw new Error(`${response.status} ${await response.text()}`); return response; } } ``` ``` require "json" require "net/http" require "uri" BASE = "https://api.headcountlabs.com" KEY = ENV.fetch("HEADCOUNTLABS_API_KEY") def call(method, path, body = nil) uri = URI(BASE + path) 3.times do |attempt| request = Net::HTTP.const_get(method.capitalize).new(uri) request["Authorization"] = "Bearer #{KEY}" if body request["Content-Type"] = "application/json" request.body = JSON.generate(body) end response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 60) { |http| http.request(request) } wait = (response["Retry-After"] || 5).to_i if %w[429 503].include?(response.code) && attempt < 2 && wait <= 120 sleep wait next end raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess) return response end end ``` ``` = 300) throw new RuntimeException("$status $text"); return $file !== null ? [] : json_decode($text, true); } } ``` ``` # Put the key in an environment variable. Never paste it into a command you share. export HEADCOUNTLABS_API_KEY="..." export BASE="https://api.headcountlabs.com" # --fail-with-body exits non-zero on a 4xx or 5xx and still prints the error body (curl 7.76 or newer) ``` ## List a page of jobs Returns one page of jobs and a `next_cursor`. Filters go in the query string. The default page is 50 jobs; `limit` goes up to 250. **Python** **Node.js** **Ruby** **PHP** **curl** ``` jobs = call("GET", "/v1/jobs?country=US&work_arrangement=remote&has_pay=true&posted_since=2026-10-01&limit=50").json() print(len(jobs["data"]), jobs["next_cursor"]) ``` ``` const jobs = await (await call("GET", "/v1/jobs?country=US&work_arrangement=remote&has_pay=true&posted_since=2026-10-01&limit=50")).json(); console.log(jobs.data.length, jobs.next_cursor); ``` ``` jobs = JSON.parse(call("get", "/v1/jobs?country=US&work_arrangement=remote&has_pay=true&posted_since=2026-10-01&limit=50").body) puts jobs["data"].length, jobs["next_cursor"] ``` ``` $jobs = call_api("GET", "/v1/jobs?country=US&work_arrangement=remote&has_pay=true&posted_since=2026-10-01&limit=50"); echo count($jobs["data"]), " ", $jobs["next_cursor"], "\n"; ``` ``` curl --fail-with-body -sS "$BASE/v1/jobs?country=US&work_arrangement=remote&has_pay=true&posted_since=2026-10-01&limit=50" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` ## Count matching jobs Returns `{count, snapshot_watermark}` and no jobs. Use it to size a request before you make it. **Python** **Node.js** **Ruby** **PHP** **curl** ``` count = call("GET", "/v1/jobs/count?country=US&work_arrangement=remote&has_pay=true").json() print(count["count"], count["snapshot_watermark"]) ``` ``` const count = await (await call("GET", "/v1/jobs/count?country=US&work_arrangement=remote&has_pay=true")).json(); console.log(count.count, count.snapshot_watermark); ``` ``` count = JSON.parse(call("get", "/v1/jobs/count?country=US&work_arrangement=remote&has_pay=true").body) puts count["count"], count["snapshot_watermark"] ``` ``` $count = call_api("GET", "/v1/jobs/count?country=US&work_arrangement=remote&has_pay=true"); echo $count["count"], " ", $count["snapshot_watermark"], "\n"; ``` ``` curl --fail-with-body -sS "$BASE/v1/jobs/count?country=US&work_arrangement=remote&has_pay=true" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` ## Read one job Reads one combined job by ID. `include=company` adds the company object. Reading a single job counts as one record. **Python** **Node.js** **Ruby** **PHP** **curl** ``` job = call("GET", "/v1/jobs/9f70ad16-ab51-49fe-b964-62067a7946b3?include=company").json()["data"] print(job["title"]["value"], job["company"]["name"]) ``` ``` const job = (await (await call("GET", "/v1/jobs/9f70ad16-ab51-49fe-b964-62067a7946b3?include=company")).json()).data; console.log(job.title.value, job.company.name); ``` ``` job = JSON.parse(call("get", "/v1/jobs/9f70ad16-ab51-49fe-b964-62067a7946b3?include=company").body)["data"] puts job["title"]["value"], job["company"]["name"] ``` ``` $job = call_api("GET", "/v1/jobs/9f70ad16-ab51-49fe-b964-62067a7946b3?include=company")["data"]; echo $job["title"]["value"], " ", $job["company"]["name"], "\n"; ``` ``` curl --fail-with-body -sS "$BASE/v1/jobs/9f70ad16-ab51-49fe-b964-62067a7946b3?include=company" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` ## Search with a JSON body Sends the filters as a JSON body, which suits long lists and Boolean text. The body can be up to 16,384 bytes. `country` and `fields` may be arrays. See the [query language](https://headcountlabs.com/docs/query-language/) page for `title_advanced`. **Python** **Node.js** **Ruby** **PHP** **curl** ``` body = { "title_advanced": "data AND (engineer OR scientist)", "country": [ "US", "CA" ], "has_pay": True, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 } result = call("POST", "/v1/jobs/search", json=body).json() print(len(result["data"]), result["next_cursor"]) ``` ``` const body = { "title_advanced": "data AND (engineer OR scientist)", "country": [ "US", "CA" ], "has_pay": true, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 }; const result = await (await call("POST", "/v1/jobs/search", body)).json(); console.log(result.data.length, result.next_cursor); ``` ``` body = JSON.parse(<<~JSON) { "title_advanced": "data AND (engineer OR scientist)", "country": [ "US", "CA" ], "has_pay": true, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 } JSON result = JSON.parse(call("post", "/v1/jobs/search", body).body) puts result["data"].length, result["next_cursor"] ``` ``` $body = json_decode('{"title_advanced": "data AND (engineer OR scientist)", "country": ["US", "CA"], "has_pay": true, "fields": ["job_id", "title", "employer_name"], "limit": 25}', true); $result = call_api("POST", "/v1/jobs/search", $body); echo count($result["data"]), " ", $result["next_cursor"], "\n"; ``` ``` curl --fail-with-body -sS -X POST "$BASE/v1/jobs/search" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title_advanced": "data AND (engineer OR scientist)", "country": [ "US", "CA" ], "has_pay": true, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 }' ``` ## Search with an Elasticsearch-style query Sends an Elasticsearch-style `query`. It is translated into the same filters. See the [query language](https://headcountlabs.com/docs/query-language/) page for the clauses it accepts. **Python** **Node.js** **Ruby** **PHP** **curl** ``` body = { "query": { "bool": { "filter": [ { "term": { "country": "US" } }, { "term": { "work_arrangement": "remote" } }, { "range": { "pay_min": { "gte": 150000 } } }, { "exists": { "field": "application_url" } } ], "must": [ { "match": { "title_advanced": "data AND (engineer OR scientist)" } } ] } }, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 } result = call("POST", "/v1/jobs/search/es_dsl", json=body).json() print(len(result["data"]), result["next_cursor"]) ``` ``` const body = { "query": { "bool": { "filter": [ { "term": { "country": "US" } }, { "term": { "work_arrangement": "remote" } }, { "range": { "pay_min": { "gte": 150000 } } }, { "exists": { "field": "application_url" } } ], "must": [ { "match": { "title_advanced": "data AND (engineer OR scientist)" } } ] } }, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 }; const result = await (await call("POST", "/v1/jobs/search/es_dsl", body)).json(); console.log(result.data.length, result.next_cursor); ``` ``` body = JSON.parse(<<~JSON) { "query": { "bool": { "filter": [ { "term": { "country": "US" } }, { "term": { "work_arrangement": "remote" } }, { "range": { "pay_min": { "gte": 150000 } } }, { "exists": { "field": "application_url" } } ], "must": [ { "match": { "title_advanced": "data AND (engineer OR scientist)" } } ] } }, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 } JSON result = JSON.parse(call("post", "/v1/jobs/search/es_dsl", body).body) puts result["data"].length, result["next_cursor"] ``` ``` $body = json_decode('{"query": {"bool": {"filter": [{"term": {"country": "US"}}, {"term": {"work_arrangement": "remote"}}, {"range": {"pay_min": {"gte": 150000}}}, {"exists": {"field": "application_url"}}], "must": [{"match": {"title_advanced": "data AND (engineer OR scientist)"}}]}}, "fields": ["job_id", "title", "employer_name"], "limit": 25}', true); $result = call_api("POST", "/v1/jobs/search/es_dsl", $body); echo count($result["data"]), " ", $result["next_cursor"], "\n"; ``` ``` curl --fail-with-body -sS -X POST "$BASE/v1/jobs/search/es_dsl" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": { "bool": { "filter": [ { "term": { "country": "US" } }, { "term": { "work_arrangement": "remote" } }, { "range": { "pay_min": { "gte": 150000 } } }, { "exists": { "field": "application_url" } } ], "must": [ { "match": { "title_advanced": "data AND (engineer OR scientist)" } } ] } }, "fields": [ "job_id", "title", "employer_name" ], "limit": 25 }' ``` ## Walk every page of a list Follows `next_cursor` until it is null. Keep the same filters and `limit` on every call, because a cursor is tied to them. **Python** **Node.js** **Ruby** **PHP** **curl** ``` cursor = None seen = 0 while True: path = "/v1/jobs?country=US&work_arrangement=remote&limit=250" + ("&cursor=" + cursor if cursor else "") page = call("GET", path).json() seen += len(page["data"]) cursor = page["next_cursor"] if not cursor: break print(seen, "jobs") ``` ``` let cursor = null; let seen = 0; while (true) { const path = "/v1/jobs?country=US&work_arrangement=remote&limit=250" + (cursor ? "&cursor=" + encodeURIComponent(cursor) : ""); const page = await (await call("GET", path)).json(); seen += page.data.length; cursor = page.next_cursor; if (!cursor) break; } console.log(seen, "jobs"); ``` ``` cursor = nil seen = 0 loop do path = "/v1/jobs?country=US&work_arrangement=remote&limit=250" + (cursor ? "&cursor=#{URI.encode_www_form_component(cursor)}" : "") page = JSON.parse(call("get", path).body) seen += page["data"].length cursor = page["next_cursor"] break unless cursor end puts "#{seen} jobs" ``` ``` $cursor = null; $seen = 0; do { $path = "/v1/jobs?country=US&work_arrangement=remote&limit=250" . ($cursor ? "&cursor=" . urlencode($cursor) : ""); $page = call_api("GET", $path); $seen += count($page["data"]); $cursor = $page["next_cursor"]; } while ($cursor); echo "$seen jobs\n"; ``` ``` cursor="" while :; do page=$(curl --fail-with-body -sS -G "$BASE/v1/jobs" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" \ --data-urlencode "country=US" --data-urlencode "work_arrangement=remote" --data-urlencode "limit=250" \ ${cursor:+--data-urlencode "cursor=$cursor"}) || break echo "$page" | jq ".data | length" cursor=$(echo "$page" | jq -r ".next_cursor // empty") [ -z "$cursor" ] && break done ``` ## Read the changes feed Reads created, updated and expired events since a time. Save `resume_cursor` and pass it back as `after` on the next call. Send either `since` or `after`, never both. **Python** **Node.js** **Ruby** **PHP** **curl** ``` feed = call("GET", "/v1/jobs/changes?since=2026-10-13T00:00:00Z&types=created,updated,expired&limit=1000").json() for event in feed["data"]: print(event["type"], event["job_id"], event["occurred_at"]) resume = feed["resume_cursor"] # pass back as ?after=... next time more = feed["has_more"] ``` ``` const feed = await (await call("GET", "/v1/jobs/changes?since=2026-10-13T00:00:00Z&types=created,updated,expired&limit=1000")).json(); for (const event of feed.data) console.log(event.type, event.job_id, event.occurred_at); const resume = feed.resume_cursor; // pass back as ?after=... next time const more = feed.has_more; ``` ``` feed = JSON.parse(call("get", "/v1/jobs/changes?since=2026-10-13T00:00:00Z&types=created,updated,expired&limit=1000").body) feed["data"].each { |event| puts [event["type"], event["job_id"], event["occurred_at"]].join(" ") } resume = feed["resume_cursor"] # pass back as ?after=... next time more = feed["has_more"] ``` ``` $feed = call_api("GET", "/v1/jobs/changes?since=2026-10-13T00:00:00Z&types=created,updated,expired&limit=1000"); foreach ($feed["data"] as $event) echo $event["type"], " ", $event["job_id"], " ", $event["occurred_at"], "\n"; $resume = $feed["resume_cursor"]; // pass back as ?after=... next time $more = $feed["has_more"]; ``` ``` curl --fail-with-body -sS "$BASE/v1/jobs/changes?since=2026-10-13T00:00:00Z&types=created,updated,expired&limit=1000" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" # Next call: ...?after= ``` ## Create, poll and download an export Creates an export of up to 100,000 jobs, waits for it to finish and saves each gzip file. Files hold one JSON job per line. The [bulk download walkthrough](https://headcountlabs.com/docs/bulk-download/) explains each step. **Python** **Node.js** **Ruby** **PHP** **curl** ``` job = call("POST", "/v1/jobs/exports", json={ "country": "US", "work_arrangement": "remote", "has_pay": True, "fields": [ "job_id", "title", "employer_name", "locations", "postings" ], "max_records": 50000 }).json() while job["status"] in ("queued", "running"): time.sleep(10) job = call("GET", "/v1/jobs/exports/" + job["export_id"]).json() if job["status"] != "completed": raise RuntimeError(job.get("error", job["status"])) for f in job["files"]: data = call("GET", f["url"], stream=True) with open(f"jobs-{f['n']}.jsonl.gz", "wb") as out: for chunk in data.iter_content(1 << 20): out.write(chunk) ``` ``` let job = await (await call("POST", "/v1/jobs/exports", { "country": "US", "work_arrangement": "remote", "has_pay": true, "fields": [ "job_id", "title", "employer_name", "locations", "postings" ], "max_records": 50000 })).json(); while (["queued", "running"].includes(job.status)) { await new Promise((r) => setTimeout(r, 10000)); job = await (await call("GET", `/v1/jobs/exports/${job.export_id}`)).json(); } if (job.status !== "completed") throw new Error(job.error ?? job.status); const { writeFile } = await import("node:fs/promises"); for (const f of job.files) { const file = await call("GET", f.url); await writeFile(`jobs-${f.n}.jsonl.gz`, Buffer.from(await file.arrayBuffer())); } ``` ``` job = JSON.parse(call("post", "/v1/jobs/exports", JSON.parse(<<~JSON)).body) { "country": "US", "work_arrangement": "remote", "has_pay": true, "fields": [ "job_id", "title", "employer_name", "locations", "postings" ], "max_records": 50000 } JSON while %w[queued running].include?(job["status"]) sleep 10 job = JSON.parse(call("get", "/v1/jobs/exports/#{job["export_id"]}").body) end raise (job["error"] || job["status"]) unless job["status"] == "completed" job["files"].each do |f| File.binwrite("jobs-#{f["n"]}.jsonl.gz", call("get", f["url"]).body) end ``` ``` $job = call_api("POST", "/v1/jobs/exports", json_decode('{"country": "US", "work_arrangement": "remote", "has_pay": true, "fields": ["job_id", "title", "employer_name", "locations", "postings"], "max_records": 50000}', true)); while (in_array($job["status"], ["queued", "running"])) { sleep(10); $job = call_api("GET", "/v1/jobs/exports/" . $job["export_id"]); } if ($job["status"] !== "completed") throw new RuntimeException($job["error"] ?? $job["status"]); foreach ($job["files"] as $f) { $out = fopen("jobs-" . $f["n"] . ".jsonl.gz", "wb"); call_api("GET", $f["url"], null, $out); fclose($out); } ``` ``` # 1. Create the export (returns 202 with export_id) curl --fail-with-body -sS -X POST "$BASE/v1/jobs/exports" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "country": "US", "work_arrangement": "remote", "has_pay": true, "fields": [ "job_id", "title", "employer_name", "locations", "postings" ], "max_records": 50000 }' # 2. Poll until status is completed curl --fail-with-body -sS "$BASE/v1/jobs/exports/$EXPORT_ID" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" # 3. Download each file listed in files[].url (gzip, one JSON job per line) curl --fail-with-body -sS -o jobs-1.jsonl.gz "$BASE/v1/jobs/exports/$EXPORT_ID/files/1" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" ``` ## What comes back - List and search responses have `data`, `next_cursor` and `snapshot_watermark`. Use the [field dictionary](https://headcountlabs.com/docs/fields/) to read each job. - A count response has `count` and `snapshot_watermark`. - `429` means you used your allowance or sent requests too fast. Wait for `Retry-After`. See [rate limits](https://headcountlabs.com/docs/rate-limits/). - `503 query_too_broad` on a search or count means the query ran past the 90-second limit (no records used). Do not repeat it unchanged: for job titles use `title` instead of `q`, and add a country, state, source or date range. Older routes may answer `504 query_timeout` for the same thing. - The [errors page](https://headcountlabs.com/docs/errors/) lists every code. Source: https://headcountlabs.com/docs/code-samples/ --- # Which route should I use? URL: https://headcountlabs.com/docs/which-route/ # Which route should I use? A decision guide for choosing between list, count, single-job, search, export and changes requests. ## Start from what you need | You want to | Use | Why | |---|---|---| | Know how many jobs match | `GET /v1/jobs/count` | Returns one number and no jobs. Run it before any large read. | | Read one job you already have an ID for | `GET /v1/jobs/{jobId}` | One record. Add `include=company` or `include=source_data` when you need them. | | Show or process a page of results | `GET /v1/jobs` | Filters in the query string, 50 jobs by default and up to 250, then follow `next_cursor`. | | Send a long filter list or Boolean text | `POST /v1/jobs/search` | The same filters as a JSON body, so long lists do not hit URL limits. | | Reuse an Elasticsearch query | `POST /v1/jobs/search/es_dsl` | Translates a `bool` query into the same filters. | | Collect up to 100,000 matching jobs into files | `POST /v1/jobs/exports` | One request, then download gzip files. Easier than paging. | | Collect every job ID for a filter | `GET /v1/jobs?fields=job_id&limit=1000` | Id-only pages go up to 1,000 per page. | | Keep a copy up to date | `GET /v1/jobs/changes` | Created, updated and expired events in order, so you never re-read the catalog. | | Find a company or list its jobs | `/v1/companies`, `/v1/companies/search`, `/v1/companies/{id}/jobs` | Company IDs are stable and merged IDs redirect. | | Check your own usage | `GET /v1/usage/requests`, `/v1/usage/analytics` | Your request ledger and daily totals. | | Give an AI agent job search | The MCP server | Ready-made tools. See [MCP tools](https://headcountlabs.com/docs/mcp-tools/). | ## Pick by size | Jobs you need | Best route | |---|---| | A few, to show a user | One `GET /v1/jobs` call | | Up to a few thousand | `GET /v1/jobs` with a cursor loop | | Up to 100,000 | One export | | More than 100,000 | Split the filter (by country, state, source or posted date) and run one export at a time, or load with `GET /v1/jobs` and keep up with `changes` | | Everything, kept fresh | Initial load, then the [changes feed](https://headcountlabs.com/docs/sync-strategy/) | Count first when you are unsure. `GET /v1/jobs/count` is cheap and tells you which row of this table you are in. ## Pick a search style | Situation | Use | |---|---| | Simple words in a title or description | `q`, `title` or `description` | | Several words in any order, exclusions or groups | `title_advanced` or `description_advanced` | | Exact structure from an existing Elasticsearch client | `POST /v1/jobs/search/es_dsl` | | A place | `country`, `state`, `city`, `msa` or `location`. See [search and location filters](https://headcountlabs.com/docs/search-and-location/) | | Remote work | `work_arrangement=remote`, not a place name | The [query language](https://headcountlabs.com/docs/query-language/) page has the exact syntax. ## What each route costs Pricing is per record: each job a route returns is one record, after your free allowance of 100,000 records a month. Counts return no records and cost nothing. The numbers are on the [pricing page](https://headcountlabs.com/pricing/), and [rate limits](https://headcountlabs.com/docs/rate-limits/) explains how the allowance and the per-minute limits work. Source: https://headcountlabs.com/docs/which-route/ --- # Bulk download walkthrough URL: https://headcountlabs.com/docs/bulk-download/ # Bulk download walkthrough Count, create, wait for and download an export of up to 100,000 jobs, then keep the copy up to date. ## When to use an export An export turns a search into files. It runs in the background, so you make one request, wait, and download. Use it for a one-time load of up to 100,000 jobs, or for a large slice you want to import in one step. If you need more than 100,000, split the search by country, state, source or date and run the exports one after another. ## 1. Count the jobs first Make the same filters into a count request. If the number is above 100,000, narrow the filters or plan several exports. ``` GET /v1/jobs/count?country=US&work_arrangement=remote&has_pay=true ``` The response is `{"count": ..., "snapshot_watermark": "..."}`. ## 2. Choose the fields you need Add `fields` to the export body to keep the files small. `job_id` is always included. The allowed names are `job_id`, `currentness`, `stale`, `company_id`, `employer_name`, `title`, `description`, `work_arrangement`, `locations`, `job_first_seen_at`, `curated_at`, `job_updated_at`, `postings` and `company`. Without `fields` each line is a complete job. ## 3. Create the export Send `POST /v1/jobs/exports` with a JSON body. The body is a search body (any filter, plus `fields`, `sort` and `include`) without `limit` or `cursor`, and an optional `max_records` from 1 to 100,000 (the default is 100,000). ``` POST /v1/jobs/exports Content-Type: application/json { "country": "US", "work_arrangement": "remote", "has_pay": true, "fields": ["job_id", "title", "employer_name", "locations", "postings"], "max_records": 50000 } ``` The API answers `202 Accepted` with an export object whose `status` is `queued`. Keep `export_id`. An account can have one export queued or running at a time; a second create call returns `409 export_in_progress`. ## 4. Wait for it to finish Poll `GET /v1/jobs/exports/{export_id}` every 10 seconds or so. `status` moves from `queued` to `running` to `completed`, `failed` or `expired`. If it fails, `error` says why. A failure that says the catalog snapshot changed or the server restarted means you should create the export again. `GET /v1/jobs/exports` lists your last 20 exports. ## 5. Download the files A completed export lists `files`. Each entry has `n` (file number), `records`, `bytes` and a relative `url` such as `/v1/jobs/exports/{export_id}/files/1`. Send the same bearer key when you download. Files are gzip, with one JSON job on each line, and each holds up to 10,000 jobs. ``` curl --fail-with-body -sS -o jobs-1.jsonl.gz \ "https://api.headcountlabs.com/v1/jobs/exports/$EXPORT_ID/files/1" \ -H "Authorization: Bearer $HEADCOUNTLABS_API_KEY" gunzip -c jobs-1.jsonl.gz | head -n 1 ``` Files stay available for 24 hours after the export completes. After that the status becomes `expired` and you create a new export. Code in five languages is in the [code samples](https://headcountlabs.com/docs/code-samples/). ## 6. Keep the copy fresh An export is a snapshot. It records `snapshot_watermark`, the catalog version it read. To stay current after loading it, call `GET /v1/jobs/changes?since=...` with a time at or before the export’s `created_at`, apply the events by `job_id`, and save each `resume_cursor`. The [sync guide](https://headcountlabs.com/docs/sync-strategy/) shows how to make those writes safe to repeat. ## Limits and cost - Up to 100,000 jobs per export and one export at a time for each account. - Each file holds up to 10,000 jobs, and files are kept for 24 hours. - Creating, polling, listing and downloading an export do not count against the per-minute request limit. - An export is counted when it completes: one request for every 100 jobs written, at least one, at the price of the matching list or search request. A failed export is not counted. See [pricing](https://headcountlabs.com/pricing/). - If your allowance cannot cover the export, the create call returns `429` with `data_limit_exceeded` or `rate_limited`. - HTML descriptions (`description_format=html`) are not available and return `503 service_unavailable`. Source: https://headcountlabs.com/docs/bulk-download/ --- # API release notes URL: https://headcountlabs.com/docs/changelog/ # API release notes Dated changes to the Headcount Labs API and its documentation, newest first. ## About these notes These notes list changes to the API and its documentation, newest first. Changes made before October 7, 2026 are not listed. Pricing changes are on the [site changelog](https://headcountlabs.com/changelog/). ## October 14, 2026: Documentation update - New pages: the [field dictionary](https://headcountlabs.com/docs/fields/) with a complete real record, the [query language](https://headcountlabs.com/docs/query-language/), [code samples](https://headcountlabs.com/docs/code-samples/), [route guide](https://headcountlabs.com/docs/which-route/), [bulk download walkthrough](https://headcountlabs.com/docs/bulk-download/) and these release notes. - The OpenAPI reference now lists `POST /v1/jobs/search` and types the location and pay objects. - The key format is corrected on the authentication page: new keys start with `jc_live_`. ## October 13, 2026: Fields, Elasticsearch-style search and exports - `fields` picks which job properties come back on `GET /v1/jobs`, `POST /v1/jobs/search`, `GET /v1/jobs/{jobId}` and the company jobs list. With `fields=job_id` alone, `limit` goes up to 1,000. - `country` and `employment_type` accept up to 10 values. - New `POST /v1/jobs/search/es_dsl` takes an Elasticsearch-style `query`. - New `POST /v1/jobs/exports` creates an export of up to 100,000 jobs. Poll it with `GET /v1/jobs/exports/{exportId}`, list your last 20 with `GET /v1/jobs/exports`, and download gzip files. ## October 12, 2026: Date-only filters - The fetch and application date filters (`last_fetch_since`, `last_fetch_until`, `application_check_since`) accept a plain date such as `2026-10-12` as well as a full timestamp. ## October 9, 2026: Name change and query timeout - The API, MCP and sign-in pages now use the Headcount Labs name. Support mail comes from `support@headcountlabs.com`. - A query that runs longer than 10 seconds now returns `504 query_timeout` and uses no records. ## October 8, 2026: More location and company data - Each job location can carry `county_fips` and `msa` (metropolitan or micropolitan area), and a five-digit `zip` when the posting states one. - Companies carry `region`, `address_source`, `identifiers` (SEC CIK, EIN, UEI, ticker) and `industries` (NAICS, SIC). - A job that is gone returns `410 job_withdrawn` with `no_longer_listed_at` in the body. - Overage billing gained an optional monthly dollar limit on `PUT /v1/account/overage`. - The docs now say that `title` matches one exact phrase while `title_advanced` matches words in any order. ## October 7, 2026: Key prefix and documented filters - New keys start with `jc_live_`. Keys issued before this date start with `ar_live_` and keep working. - The OpenAPI reference documents the 26 job filters the API already accepted, including `has_description`, `has_location`, `has_pay`, `has_posting_url`, `has_application_url`, `pay_min`, `pay_max`, `last_fetch_since`, `application_check`, `source_class` and `exclude_source`. - New `PUT /v1/account/overage` turns overage billing on or off. Source: https://headcountlabs.com/docs/changelog/ --- # Backfill a job board with Headcount Labs URL: https://headcountlabs.com/resources/backfill-a-job-board/ # Backfill a job board with Headcount Labs Fill a job board with open jobs from employers' own career sites, then keep it current. ## What you get A backfill fills your job board with open jobs from employers’ own career sites and applicant tracking systems. Each Headcount Labs job merges duplicate postings of the same opening and links to the original posting, so you can send applicants straight to the employer. ## 1. Size the backfill for free Count the jobs before you fetch them. A count is one request and returns no jobs. ``` GET https://api.headcountlabs.com/v1/jobs/count?country=US&state=TX&posted_since=2026-10-02 Authorization: Bearer ``` Adjust the filters until the count fits your budget. Useful filters for a job board: `country`, `state`, `city`, `title` or `q`, `work_arrangement`, `employment_type`, `has_pay=true`, `has_application_url=true` and `posted_since`. See [filters](https://headcountlabs.com/docs/filters/) and [location matching](https://headcountlabs.com/docs/search-and-location/#location-matching). ## 2. Load the jobs Page through `GET /v1/jobs` with the same filters and `limit=250`, passing `next_cursor` back as `cursor`. Store each job under its `job_id`. ``` GET https://api.headcountlabs.com/v1/jobs?country=US&state=TX&posted_since=2026-10-02&limit=250 ``` Only `current` jobs are returned unless you ask for others. For each job, show `title`, `employer_name`, `locations` and `description`, and link the apply button to a posting's `application_url` or `posting_url`. When a posting's `attribution.required` is true, show its attribution text and link with the job. ## 3. Keep it fresh After the first load, read only what changed from `GET /v1/jobs/changes`, starting with `since` set to when the load began and then passing `resume_cursor` as `after`. Add `created` jobs, replace `updated` jobs, and take down `expired` jobs. The [ingestion strategy](https://headcountlabs.com/docs/ingestion-strategy/) covers polling and recovery. ## 4. Plan the cost You pay per record, and each job a list or changes page returns is one record. Every organization gets 100,000 records free each UTC calendar month; after that, records cost $0.01 per 1,000 at any volume. Keeping a full copy current with the changes feed is about 1 to 2 million records a day today, roughly 30 to 60 million a month, or about $300 to $600 a month. The feed lists every record we update, so ask for `types=created,expired` if you only need new and closed jobs. Counts return no records and cost nothing. Add prepaid usage from $1 or turn on pay as you go to go past the free allowance. See [pricing](https://headcountlabs.com/pricing/) and [rate limits](https://headcountlabs.com/docs/rate-limits/). ## With an AI agent Connect the [MCP server](https://headcountlabs.com/mcp/) and ask, for example: “Get every open job in Texas posted in the last 30 days as a file.” The `search_jobs` tool writes up to 5,000 jobs to a JSONL file you can download. Source: https://headcountlabs.com/resources/backfill-a-job-board/