# Search Preview: Multi-source Company API

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

Query type:

URL:&#x20;
{% endcolumn %}

{% column %}
Multi-source Company

Elasticsearch DSL

<https://api.coresignal.com/cdapi/v2/company\\_multi\\_source/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, Multi-source Company API search `/v2/company_multi_source/search/es_dsl/preview` endpoint's 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-preview">search-preview</a></td></tr></tbody></table>

## Request query

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

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

## Response structure

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

| Data field                 | Description                                                                                   | Data type |
| -------------------------- | --------------------------------------------------------------------------------------------- | --------- |
| `id`                       | Identification number                                                                         | Integer   |
| `company_name`             | Company name                                                                                  | String    |
| `professional_network_url` | The most recent profile Professional network URL                                              | String    |
| `website`                  | Company's website                                                                             | String    |
| `unique_domain`            | Indicates if the domain is unique                                                             | Boolean   |
| `size_range`               | Company size based on employee count range (as selected by the company profile administrator) | String    |
| `employees_count`          | Number of employees on Professional network who associated their experience with the company  | Integer   |
| `industry`                 | Company's industry                                                                            | String    |
| `hq_country`               | Country the company is based in (as parsed by our in-house country parser)                    | String    |
| `company_logo`             | Base64-encoded image data of the company's logo                                               | 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 %}

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

```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`.

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

### Sorting options

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

{% 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: 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/multi-source-company-api/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.
