# Search Preview: Base Employee API

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

Query type:

URLs:
{% endcolumn %}

{% column %}
Base Employee

Coresignal's custom filters and Elasticsearch DSL

<https://api.coresignal.com/cdapi/v2/employee\\_base/search/filter/preview\\>
<https://api.coresignal.com/cdapi/v2/employee\\_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 Employee API search `/v2/employee_base/search/filter/preview` and `/v2/employee_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-preview">search-preview</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.&#x20;

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

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/employee_base/search/filter/preview' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "headline": "Data",
  "skill": "Front-end"
}'
```

{% endcode %}
{% endtab %}

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

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

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

## Response structure

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

| Data field            | Description                                                                                                                                                                                                                 | Data type |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `id`                  | Identification number                                                                                                                                                                                                       | Integer   |
| `full_name`           | Employee's full name                                                                                                                                                                                                        | String    |
| `profile_url`         | Employee profile URL                                                                                                                                                                                                        | String    |
| `headline`            | Profile headline                                                                                                                                                                                                            | String    |
| `location`            | Employee's location                                                                                                                                                                                                         | String    |
| `country`             | Associated country                                                                                                                                                                                                          | String    |
| `connections_count`   | Count of profile connections                                                                                                                                                                                                | Integer   |
| `follower_count`      | Count of profile followers                                                                                                                                                                                                  | Integer   |
| `experience_count`    | Number of experience records                                                                                                                                                                                                | Integer   |
| `company_name`        | <p>Company name. Data is from <code>experience</code> category. </p><p>Must include: <code>“order\_in\_profile”: 1</code> AND <code>”deleted": 0</code> AND <code>”is\_current”: 1</code></p>                               | String    |
| `company_url`         | <p>Company's Professional network URL. Data is from <code>experience</code> category. </p><p>Must include: <code>“order\_in\_profile”: 1</code> AND <code>”deleted": 0</code> AND <code>”is\_current”: 1</code> </p>        | String    |
| `company_website`     | <p>Company's website. Data is from <code>experience</code> category.</p><p>Must include: <code>“order\_in\_profile”: 1</code> AND <code>”deleted": 0</code> AND <code>”is\_current”: 1</code></p>                           | String    |
| `company_industry`    | <p>Company's industry. Data is from <code>experience</code> category.</p><p>Must include: <code>“order\_in\_profile”: 1</code> AND <code>”deleted": 0</code> AND <code>”is\_current”: 1</code></p>                          | String    |
| `title`               | <p>Current job position title. Data is from <code>experience</code> category. </p><p>Must include: <code>“order\_in\_profile”: 1</code> AND <code>”deleted": 0</code> AND <code>”is\_current”: 1</code></p>                 | String    |
| `experience_location` | <p>Full address of the company's headquarters. Data is from <code>experience</code> category. </p><p>Must include: <code>“order\_in\_profile”: 1</code> AND <code>”deleted": 0</code> AND <code>”is\_current”: 1</code></p> | 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": 12345678,
        "full_name": "John Doe",
        "profile_url": "https://www.professional-network.com/in/john-doe",
        "headline": "Data Engineer",
        "location": "Vancouver, British Columbia, Canada",
        "country": "Canada",
        "connections_count": 285,
        "follower_count": 298,
        "experience_count": 4,
        "company_name": "MineSense Technologies Ltd.",
        "company_url": "https://www.professional-network.com/company/minesense-technologies-ltd-",
        "company_website": "http://www.minesense.com",
        "company_industry": "Metal Ore Mining",
        "title": "Data Engineer",
        "experience_location": "California, United States",
        "_score": 20.12345
    },
```

{% endcode %}
{% endtab %}

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

```json
    {
        "id": 12345678,
        "full_name": "John Doe",
        "profile_url": "https://www.professional-network.com/in/john-doe",
        "headline": "Data Engineer",
        "location": "Vancouver, British Columbia, Canada",
        "country": "Canada",
        "connections_count": 285,
        "follower_count": 298,
        "experience_count": 4,
        "company_name": "MineSense Technologies Ltd.",
        "company_url": "https://www.professional-network.com/company/minesense-technologies-ltd-",
        "company_website": "http://www.minesense.com",
        "company_industry": "Metal Ore Mining",
        "title": "Data Engineer",
        "experience_location": "California, United States",
        "_score": 20.12345
    },
```

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

## Pagination

Examples 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/employee_base/search/filter/preview?page=3' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "headline": "Data",
  "skill": "Front-end"
}'
```

{% endcode %}
{% endtab %}

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

```json
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/employee_base/search/es_dsl/preview?page=5' \
  -H 'accept: application/json' \
  -H 'apikey: {API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
   "query":{
    "query": {
        "bool": {
            "should": [
                {
                    "query_string": {
                        "query": "John Doe",
                        "default_field": "full_name",
                        "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/employee-api/base-employee-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.
