> ## Documentation Index
> Fetch the complete documentation index at: https://www.hirebase.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Companies

> Export every company matching a company search to a CSV or JSON file

Export company search results to a file. `search` takes the same filters as [Search Companies](https://www.hirebase.org/docs/api-reference/companies/search-companies.md); instead of paging through results, you get one file with every match. The endpoint creates a task and returns it. Poll [Get Task Status](https://www.hirebase.org/docs/api-reference/tasks/get-task-status.md) for the download link.

> [!NOTE]
>
> **Metering:** an export uses `min(search.limit, matching companies)` from your companies allowance (`m_company_api_calls`, 1 unit per company) when the task is created. If the export fails, the units are given back. Use the free [estimate](#estimate-an-export) to see the count first.

## Endpoint

```bash theme={null}
POST https://api.hirebase.org/v2/hirebase/companies/export
```

## Authentication

**x-api-key** `string` *required*

Your Hirebase API key. See [Authentication](https://www.hirebase.org/docs/authentication.md).

## Request Body

> [!WARNING]
>
> Unknown fields are rejected with a `422` rather than silently ignored, so a misnamed filter cannot run a large unfiltered export.

**search** `object` *required*

The filters and sort of [Search Companies](https://www.hirebase.org/docs/api-reference/companies/search-companies.md) (`keywords`, `industries`, `types`, `hq_geolocations`, `funding_types`, `total_funding`, `founded`, `technology_slugs`, `sort_by` and the rest), with two differences:

**limit** `integer`

How many companies to export, in search order. Omit it to export every match. Between 1 and 100,000.

**include** `string[]`

Not supported on export and returns `422`. An export holds the company fields only.

**format** `string` *required*

`csv`, or `json` for one JSON object per line.

**notify\_url** `string`

An `https` URL that receives a signed `task.completed` or `task.failed` event when the export ends. Verify it with your account secret (`GET /v2/webhooks/account-secret`).

## Example

```bash theme={null}
curl -X POST https://api.hirebase.org/v2/hirebase/companies/export \
  -H "x-api-key: $HIREBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "search": {
      "types": ["Startup"],
      "hq_geolocations": [{"country": "United States"}],
      "funding_types": ["Series A"],
      "limit": 500
    },
    "format": "csv"
  }'
```

The response is a task. `input.metered_count` is the number of companies the export was billed for.

```json theme={null}
{
  "id": "e4783c75-1221-49e1-8901-9c6e30be5f40",
  "type": "export_companies",
  "state": "queued",
  "input": {
    "query": { "types": ["Startup"], "funding_types": ["Series A"] },
    "format": "csv",
    "metered_count": 500
  }
}
```

When the task's `state` is `finished`, its `result` holds the file. The link works for 30 days.

```json theme={null}
{
  "download_url": "https://...",
  "record_count": 500,
  "file_size": 708880,
  "expiry_time": "2026-12-19T02:17:12.526320"
}
```

## What the file contains

Each company has the public fields that [Search Companies](https://www.hirebase.org/docs/api-reference/companies/search-companies.md) returns:

`company_name`, `company_slug`, `company_logo`, `company_link`, `linkedin_link`, `description_summary`, `culture_summary`, `services`, `industries`, `subindustries`, `clout`, `founded`, `type`, `is_3rd_party_agency`, `is_recruiting_agency`, `mean_opinion_score`, `aliases`, `parent_company`, `subsidiaries`, `size_range`, `headquarters`, `stock_info`, `funding_info`.

In JSON, `size_range`, `headquarters`, `stock_info` and `funding_info` are objects. In CSV they are flattened into columns such as `size_range_min`, `headquarters_city`, `stock_info_symbol` and `funding_info_total_funding`, and lists are joined into one cell.

## Errors

| Status | When |
| - | - |
| `400` | No companies match the filters, or the filters match more than 100,000 companies and `search.limit` is not set. |
| `422` | An unknown field, `include`, an invalid `limit`, or a `notify_url` that is not `https`. |
| `429` | The export is larger than what is left of your plan's included companies. Set `search.limit` to the remaining amount or upgrade. |

## Estimate an export

```bash theme={null}
POST https://api.hirebase.org/v2/hirebase/companies/estimate
```

Send the same object you would put in `search`. The response says how many companies match and how many the export would use. It is free and uses no quota.

```bash theme={null}
curl -X POST https://api.hirebase.org/v2/hirebase/companies/estimate \
  -H "x-api-key: $HIREBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"types": ["Startup"], "funding_types": ["Series A"], "limit": 500}'
```

```json theme={null}
{ "cost": 500, "total_count": 3214 }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.