# Search Preview: Base Company API

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

Query type:

URLs:
{% endcolumn %}

{% column %}
Base Company

Coresignal's custom filters and Elasticsearch DSL

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

***

## Overview

Retrieve a limited set of fields from top-matching records in real time, and search suggestion features. Here, Base Company API search `/v2/company_base/search/filter/preview` and `/v2/company_base/search/es_dsl/preview` endpoints' usage is 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="../../../api-introduction/requests/search-filters">search-filters</a></td></tr></tbody></table>

## Request queries

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

{% tabs %}
{% tab title="Search Filter request" %}
{% code title="Search Filter request" %}

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/company_base/search/filter/preview' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "industry": "Data",
  "location": "USA",
  "founded_year_gte": 2022
}'
```

{% endcode %}
{% endtab %}

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

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

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

## Response structure

Here is an overview of the fields that are retrieved using the Base Company API search preview endpoints.&#x20;

| Data field                    | Description                                                                | Data type |
| ----------------------------- | -------------------------------------------------------------------------- | --------- |
| `id`                          | Identification number                                                      | Integer   |
| `name`                        | Company name                                                               | String    |
| `canonical_url`               | The most recent profile URL                                                | String    |
| `website`                     | Company's website                                                          | String    |
| `size`                        | <p>Company size category<br>(determined by the number of employees)</p>    | String    |
| `industry`                    | Company's industry                                                         | String    |
| `headquarters_country_parsed` | Country the company is based in (as parsed by our in-house country parser) | String    |
| `_score`                      | Elasticsearch score                                                        | Float     |

**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 %}

{% tabs %}
{% tab title="Search Filter response" %}
{% code title="Search Filter response" %}

```json
    {
        "id": 123456789,
        "name": "Example Company",
        "canonical_url": "https://www.professional-network.com/company/example-company",
        "website": "www.example-company.com",
        "size": "2-10 employees",
        "industry": "IT System Data Services",
        "headquarters_country_parsed": "Germany",
        "_score": 18.12345
    },
```

{% endcode %}
{% endtab %}

{% tab title="Elasticsearch DSL response" %}
{% code title="Elasticsearch DSL response" %}

```json
    {
        "id": 10203040,
        "name": "Example Tech",
        "canonical_url": "https://www.professional-network.com/company/example-tech",
        "website": "http://www.example-tech.org",
        "size": "2-10 employees",
        "industry": "Business Consulting and Services",
        "headquarters_country_parsed": "United States",
        "_score": 10.0
    },
```

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

## Pagination

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

{% tabs %}
{% tab title="Search Filter request" %}
{% code title="Search Filter request" %}

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/company_base/search/filter/preview?page=3' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "industry": "Data",
  "location": "USA",
  "founded_year_gte": 2022
}'
```

{% endcode %}
{% endtab %}

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

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

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


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coresignal.com/company-api/base-company-api/endpoints/search-preview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
