# Company export (CSV)

> The whole company directory, or the filtered slice of it, as one streamed CSV file of the company summary's columns, with the same filters as /v1/companies and no paging. Paid plans only; bills no jobs.

Source: https://hyperjobs.io/docs/api-reference/companies-export

<EndpointHeader method="GET" path="/v1/companies.csv" />

The bulk export. Takes the same filters as
[`/v1/companies`](/docs/api-reference/companies-list) and streams every
matching company as CSV in a single response: the columns of the
[company summary](/docs/objects/company#summary), without its description and
slogan. No `limit`, no `offset`, no
pages to walk. It exists for the case the search endpoint is bad at: "give me
all of them", as a file.

<Warning title="Starter plan and above">
  On the Free plan this endpoint answers [`403`](/docs/errors#403-forbidden). See
  [plans](/help/plans).
</Warning>

<CodeGroup>
```bash title="cURL"
curl -H "Authorization: Bearer $HYPERJOBS_KEY" \
  "https://api.hyperjobs.io/v1/companies.csv?country=DE&has_jobs=true" \
  -o companies.csv
```

```js title="Node"
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch("https://api.hyperjobs.io/v1/companies.csv?country=DE&has_jobs=true", {
  headers: { Authorization: `Bearer ${process.env.HYPERJOBS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
// Stream to disk: the body can be tens of megabytes; don't buffer it.
await pipeline(Readable.fromWeb(res.body), createWriteStream("companies.csv"));
```

```python title="Python"
import os, requests

with requests.get(
    "https://api.hyperjobs.io/v1/companies.csv",
    params={"country": "DE", "has_jobs": "true"},
    headers={"Authorization": f"Bearer {os.environ['HYPERJOBS_KEY']}"},
    stream=True,
    timeout=300,
) as res:
    res.raise_for_status()
    with open("companies.csv", "wb") as f:
        for chunk in res.iter_content(chunk_size=1 << 16):
            f.write(chunk)
```
</CodeGroup>

## Query parameters

Every filter on [`/v1/companies`](/docs/api-reference/companies-list), with
identical semantics. `limit` and `offset` are the exception: they don't exist
here, and sending either is a `400`.

<Fields>
  <ParamField query="q" type="string">
    Case-insensitive substring match on company name.
  </ParamField>
  <ParamField query="domain" type="string (comma-separated)">
    A domain the company holds: exact, any of its `domains`; case, a scheme,
    `www.` and a path are ignored. Comma = OR.
  </ParamField>
  <ParamField query="linkedin" type="string (comma-separated)">
    The company's LinkedIn page: its URL or its slug (`linear`). Comma = OR.
  </ParamField>
  <ParamField query="industry" type="string (comma-separated)">
    LinkedIn industry (exact, case-insensitive), comma = OR.
  </ParamField>
  <ParamField query="country" type="string (comma-separated)">
    HQ country: full name or ISO-2, comma = OR.
  </ParamField>
  <ParamField query="size" type="string (comma-separated)">
    Size bucket, comma = OR, e.g. `11_50`. One of the
    [nine size codes](/docs/reference/enums#company_size); anything else is a
    `400`.
  </ParamField>
  <ParamField query="employee_count_gte" type="integer">
    Minimum employee count (inclusive).
  </ParamField>
  <ParamField query="employee_count_lt" type="integer">
    Maximum employee count (exclusive).
  </ParamField>
  <ParamField query="agency" type="&quot;only&quot; | &quot;exclude&quot;">
    Staffing / recruitment agencies: `exclude` hides them, `only` returns just
    them. The same caveats as the `agency` filter on `/v1/jobs`: it is
    incomplete, and it keeps the companies we could not assess.
  </ParamField>
  <ParamField query="has_jobs" type="boolean">
    `true` → only companies with at least one live job in the pool.
  </ParamField>
  <ParamField query="domain_proven" type="boolean">
    `true` → only companies whose website is proven to be their own; `false` →
    only those whose website isn't (unproven, or not assessed yet).
  </ParamField>
  <ParamField query="linkedin_proven" type="boolean">
    `true` → only companies whose LinkedIn page is proven to be their own;
    `false` → only those whose page isn't.
  </ParamField>
</Fields>

Unknown parameters are rejected with a `400` that names the parameter.

## Response

`Content-Type: text/csv; charset=utf-8`, sent as an attachment
(`Content-Disposition: attachment; filename="companies.csv"`), streamed in
pages of 5,000 rows from the database so the whole filtered set goes out with
a bounded memory footprint on both ends. The first line is the header; rows
are ordered by our internal company key, which is stable across runs but
otherwise meaningless. Sort the file yourself.

Twenty-one columns, the [company summary](/docs/objects/company#summary)
flattened, without `description` and `slogan`, always in this order:

| Column | From the [Company object](/docs/objects/company) |
| --- | --- |
| `id` | `id` |
| `name` | `name` |
| `domain` | `domain` |
| `website` | `website` |
| `linkedin_url` | `linkedin_url` |
| `linkedin_id` | `linkedin_id`: LinkedIn's numeric organisation id |
| `industry` | `industry` |
| `type` | `type`: a [code](/docs/reference/enums#company_type), e.g. `privately_held` |
| `employee_count` | `employee_count` |
| `size_range` | `size_range`: a [code](/docs/reference/enums#company_size), e.g. `51_200` |
| `followers` | `followers` |
| `founded_year` | `founded_year` |
| `hq_country` | `hq.country`: a full country name, e.g. `United States` |
| `hq_region` | `hq.region`: e.g. `California` |
| `hq_locality` | `hq.locality`: e.g. `San Francisco` |
| `hq_raw` | `hq.raw`: the headquarters string as published |
| `is_agency` | `is_agency`: `true`, `false`, or empty when not assessed |
| `domain_proven` | `domain_proven`: `true`, `false`, or empty |
| `linkedin_proven` | `linkedin_proven`: `true`, `false`, or empty |
| `jobs_count` | `jobs_count`: live openings, same as the search endpoint |
| `details_url` | `details_url`: the company's full profile in this API |

```csv title="Response"
id,name,domain,website,linkedin_url,linkedin_id,industry,type,employee_count,size_range,followers,founded_year,hq_country,hq_region,hq_locality,hq_raw,is_agency,domain_proven,linkedin_proven,jobs_count,details_url
co_7Hk2p9Qx,Linear,linear.app,https://linear.app,https://www.linkedin.com/company/linear/,71634497,Software Development,privately_held,120,51_200,48210,2019,United States,California,San Francisco,"San Francisco, California, United States",false,true,true,12,https://api.hyperjobs.io/v1/companies/co_7Hk2p9Qx
```

Standard CSV escaping: a value containing a comma, a double quote, or a
newline is wrapped in double quotes, with embedded quotes doubled. Null is an
empty cell.

Of the summary, four fields are left out. `description` and `slogan` are not
in the file because the export bills no jobs, and it would otherwise hand over
every company description in one request: they come one job per row from
[`/v1/companies`](/docs/api-reference/companies-list), or with each job.
`domains` and `logo` are left out too (`domain`, the main one, is in). The full
profile's own fields (`specialties`, `products`, `funding`, `stock`,
`crunchbase_url`, `affiliated_companies`, `updated_at` and the rest) come
from [`/v1/companies/{id}`](/docs/api-reference/companies-retrieve) (or the
row's `details_url`), which bills 3 jobs per profile.

## Cost

Bills **no jobs**, however many rows come out. It sells the directory, not
the job rows the meter counts. It does count one request against your
[per-minute rate](/docs/rate-limits), and it's checked against your quota like
everything else, so an account already at `402` gets a `402` here too.

<Note>
  Usage is recorded when the headers go out, not when the body finishes.
  A client that disconnects mid-stream has still made one request; it has
  spent no jobs either way.
</Note>

## Errors

| Status | Cause |
| --- | --- |
| `400` | Unknown parameter (including `limit` or `offset`) or invalid value. The body names the `param` and carries a `hint`. |
| `401` | Missing, unknown, revoked, or expired key. |
| `402` | Monthly [quota](/docs/rate-limits) already exhausted. |
| `403` | Free plan. The body says which plan has it. |
| `429` | [Rate limit](/docs/rate-limits) exceeded. |
| `500` | Server error. Retry with backoff. |

```json title="403"
{
  "error": "The company directory is not included in the free plan",
  "plan": "free",
  "required_plan": "starter",
  "hint": "Starter and above: upgrade at https://hyperjobs.io/pricing"
}
```

Errors are JSON even though the success response is CSV. Check the status
before you parse.

## Related

<CardGroup cols={2}>
  <Card title="List companies" icon="List" href="/docs/api-reference/companies-list">
    The same filters, paged as JSON, on every plan.
  </Card>
  <Card title="Retrieve a company" icon="Building2" href="/docs/api-reference/companies-retrieve">
    The full profile: every field the CSV leaves out, at 3 jobs each.
  </Card>
  <Card title="The Company object" icon="Braces" href="/docs/objects/company">
    What each column means.
  </Card>
  <Card title="Rate limits & quotas" icon="Gauge" href="/docs/rate-limits">
    What costs jobs and what doesn't.
  </Card>
</CardGroup>
