> For the complete documentation index, see [llms.txt](https://docs.coresignal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coresignal.com/company-data/api/search-preview.md).

# Search Preview: Company API

Preview matching company records with Elasticsearch DSL or custom filters before a full search.

{% columns %}
{% column width="16.666666666666664%" %}
Data type:

Query type:

URL:
{% endcolumn %}

{% column %}
Company data

Elasticsearch DSL and Coresignal's custom filters

<https://api.coresignal.com/cdapi/v2/company\\_multi\\_source/search/es\\_dsl/preview\\>
<https://api.coresignal.com/cdapi/v2/company\\_multi\\_source/search/filter/preview>
{% endcolumn %}
{% endcolumns %}

***

## Overview

Retrieve a limited set of fields from top-matching records in real time, and search suggestion features. Here, Company API search `/v2/company_multi_source/search/es_dsl/preview` and `/v2/company_multi_source/search/filter/preview` endpoints are reviewed.

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>General information about search preview</td><td><a href="https://docs.coresignal.com/api-introduction/requests/search-preview.md">Search Preview</a></td></tr><tr><td>Elasticsearch DSL requests</td><td><a href="https://docs.coresignal.com/company-data/api/elasticsearch-dsl.md">Elasticsearch DSL</a></td></tr><tr><td>Search Filters requests</td><td><a href="https://docs.coresignal.com/company-data/api/search-filters.md">Search Filters</a></td></tr></tbody></table>

## Request query

See the request example of company `preview` endpoints. Search Preview endpoints accept the same query structure as their corresponding Search endpoints.

{% tabs %}
{% tab title="Elasticsearch DSL request" %}
{% code title="Elasticsearch DSL request" %}

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/company_multi_source/search/es_dsl/preview' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
        "bool": {
            "should": [
                {
                    "query_string": {
                        "query": "it",
                        "default_field": "company_name",
                        "default_operator": "and"
                    }
                }
            ]
        }
    }
}'
```

{% endcode %}
{% endtab %}

{% tab title="Search filter request" %}
{% code title="Search filter request" overflow="wrap" expandable="true" %}

```json
curl -X 'POST' \
  'https://api.coresignal.com/cdapi/v2/company_multi_source/search/filter/preview' \
  -H 'accept: application/json' \
  -H 'apikey: {API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
    "industry": "Software Development",
    "exclude_type": "Nonprofit",
    "hq_country": "Canada"
  }'
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Response structure

Here is an overview of the fields that are retrieved using the Company API search preview endpoints.

<table data-search="false"><thead><tr><th>Data field</th><th>Description</th><th>Data type</th></tr></thead><tbody><tr><td><code>id</code></td><td>Identification number</td><td>Integer</td></tr><tr><td><code>company_name</code></td><td>Company name</td><td>String</td></tr><tr><td><code>professional_network_url</code></td><td>The most recent profile Professional network URL</td><td>String</td></tr><tr><td><code>website</code></td><td>Company's website</td><td>String</td></tr><tr><td><code>unique_domain</code></td><td>Indicates if the domain is unique</td><td>Boolean</td></tr><tr><td><code>size_range</code></td><td>Company size based on employee count range (as selected by the company profile administrator)</td><td>String</td></tr><tr><td><code>employees_count</code></td><td>Number of employees on Professional network who associated their experience with the company</td><td>Integer</td></tr><tr><td><code>industry</code></td><td>Company's industry</td><td>String</td></tr><tr><td><code>hq_country</code></td><td>Country the company is based in (as parsed by our in-house country parser)</td><td>String</td></tr><tr><td><code>company_logo</code></td><td>Company's logo URL</td><td>String</td></tr><tr><td><code>_score</code></td><td>Elasticsearch score</td><td>Float</td></tr></tbody></table>

**Refer to the data example here:**

{% hint style="info" %}
All personal/company information mentioned within this context is entirely fictional and is solely intended for illustrative purposes.
{% endhint %}

{% code title="Response example" %}

```json
    {
        "id": 123456789,
        "company_name": "Example Company",
        "professional_network_url": "https://www.professional-network_url.com/company/example-company",
        "website": "https://www.example-company.com",
        "unique_domain": true,
        "size_range": "11-50 employees",
        "employees_count": 0,
        "industry": "IT Services and IT Consulting",
        "hq_country": "United States",
        "company_logo": "/1a/e-x-a-m-p-l-e/123",
        "_score": 9.123456
    },
```

{% endcode %}

## Pagination

Example of the request using pagination query parameter `page`.

{% tabs %}
{% tab title="Elasticsearch DSL request" %}
{% code title="Elasticsearch DSL request" %}

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/company_multi_source/search/es_dsl/preview?page=2' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
        "bool": {
            "should": [
                {
                    "query_string": {
                        "query": "it",
                        "default_field": "company_name",
                        "default_operator": "and"
                    }
                }
            ]
        }
    }
}'
```

{% endcode %}
{% endtab %}

{% tab title="Search filter request" %}
{% code title="Search filter request" overflow="wrap" expandable="true" %}

```json
curl -X 'POST' \
  'https://api.coresignal.com/cdapi/v2/company_multi_source/search/filter/preview?page=5' \
  -H 'accept: application/json' \
  -H 'apikey: {API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
    "industry": "Software Development",
    "exclude_type": "Nonprofit",
    "hq_country": "Canada"
  }'
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Sorting options

Company API `/v2/company_multi_source/search/es_dsl/preview` endpoint supports sorting capabilities, which are the same as found in Company API's [Elasticsearch DSL](https://docs.coresignal.com/company-data/api/elasticsearch-dsl.md#sorting-options) topic.

{% code title="Elasticsearch DSL request" %}

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/company_multi_source/search/es_dsl/preview' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": { //Insert your query
    }, 
    "sort": [
        "employees_count"
    ]
}'
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coresignal.com/company-data/api/search-preview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
