# Agentic Search API

The Coresignal Agentic Search API is a natural language search API for querying professional data. Instead of writing structured queries, you describe what you need in natural language, and the API handles the rest.

Built for agentic workflows, LLM pipelines, and AI-powered applications, it eliminates the need to manually construct Elasticsearch queries. Whether you are enriching leads, building a recruitment tool, or powering an AI agent with business data, Agentic Search API gives you a faster path from prompt to data.

Depending on your use case, there are several response methods available:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href="#query-output-return_data-false"><strong>Elasticsearch DSL query</strong></a></td><td>Receive a generated Elasticsearch query to run yourself via multi-source API. Useful when you need control over execution or want to inspect query logic.</td></tr><tr><td><a href="#data-output-return_data-true"><strong>Data preview</strong></a></td><td>Receive matching data records directly in a single response – results are ready to use immediately.</td></tr></tbody></table>

## Endpoints

| Endpoint                  | Description                                                               | Best for                                                                                                           |
| ------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `/v2/agentic_search/fast` | Natural language prompts quickly and cheaply translate it into a request. | High-volume, programmatic use cases, powering AI agents, search features in your products, or automated pipelines. |

## Request body

Discover request body parameters. Only `prompt` is required and the remaining parameters let you control what is returned and how many results to include.

<table><thead><tr><th width="173.88671875">Parameter</th><th width="96.66796875">Type</th><th width="112.33984375">Required</th><th width="127.546875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>prompt</code></td><td>String</td><td>Required</td><td>–</td><td>Natural language query describing the employees you want to find.</td></tr><tr><td><code>return_data</code></td><td>Boolean</td><td>Optional</td><td><code>false</code></td><td>When <code>false</code>, returns an Elasticsearch DSL query. When <code>true</code>, returns preview data.</td></tr><tr><td><code>limit</code></td><td>Integer</td><td>Optional</td><td><code>20</code></td><td>Max results to return when <code>return_data</code> is <code>true</code>. Range: 1–100.</td></tr><tr><td><code>entity</code></td><td>String</td><td>Optional</td><td><code>"employee"</code></td><td>Target entity type. Currently only <code>"employee"</code> is supported.</td></tr></tbody></table>

### Prompt examples

Here are a few examples of prompts that can be used for your projects.

> Find founders or co-founders who have previously held an engineering role at Google, Meta, Apple, Amazon, or Microsoft.

> Find VPs of Sales or Chief Revenue Officers who previously worked at Salesforce or HubSpot.

> Find heads of engineering or CTOs at European fintech companies who have US work experience.

## Output modes

The `return_data` parameter controls what is returned. Choose between a generated query for your own pipeline or receiving data directly.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href="#query-output-return_data-false"><strong>Query mode</strong></a></td><td><code>return_data: false</code> (default)<br><br>Returns the generated Elasticsearch DSL query. Use this to integrate it into your own requests or to inspect the generated query logic.</td></tr><tr><td><a href="#data-output-return_data-true"><strong>Data mode</strong></a></td><td><code>return_data: true</code><br><br>Executes the query and returns preview data results directly. Up to 100 results delivered in a single response.</td></tr></tbody></table>

### Query output `return_data: false`

The endpoint with `return_data: false` parameter generates an Elasticsearch DSL query from your natural language prompt and returns it. The query can then be submitted independently to multi-source endpoint accordingly. The Elasticsearch DSL query is not executed in this mode.

#### Example request

```json
// Find senior engineers at fintech companies in New York
curl -X 'POST' \
  'https://api.coresignal.com/cdapi/v2/agentic_search/fast' \
  -H 'accept: application/json' \
  -H 'apikey: {API key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "prompt": "Find heads of engineering or CTOs at European fintech companies who have US work experience.",
  "return_data": false,
  "entity": "employee"
}
```

{% hint style="success" %}
Get your API Key from Coresignal's [self-service platform](https://dashboard.coresignal.com/sign-in).
{% endhint %}

#### Example response

{% code expandable="true" %}

```json
{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "is_deleted": 0
          }
        },
        {
          "term": {
            "is_parent": 1
          }
        }
      ],
      "must": [
        {
          "nested": {
            "path": "experience",
            "query": {
              "bool": {
                "filter": [
                  {
                    "term": {
                      "experience.active_experience": 1
                    }
                  },
                  {
                    "match_phrase": {
                      "experience.company_hq_regions": "Europe"
                    }
                  }
                ],
                "must": [
                  {
                    "bool": {
                      "should": [
                        {
                          "match_phrase": {
                            "experience.position_title": "Head of Engineering"
                          }
                        },
                        {
                          "match_phrase": {
                            "experience.position_title": "CTO"
                          }
                        },
                        {
                          "match_phrase": {
                            "experience.position_title": "Chief Technology Officer"
                          }
                        }
                      ],
                      "minimum_should_match": 1
                    }
                  },
                  {
                    "bool": {
                      "should": [
                        {
                          "match": {
                            "experience.company_categories_and_keywords": {
                              "query": "fintech",
                              "operator": "and"
                            }
                          }
                        },
                        {
                          "terms": {
                            "experience.company_industry.exact": [
                              "Banking"
                            ]
                          }
                        }
                      ],
                      "minimum_should_match": 1
                    }
                  }
                ]
              }
            }
          }
        },
        {
          "nested": {
            "path": "experience",
            "query": {
              "bool": {
                "filter": [
                  {
                    "term": {
                      "experience.active_experience": 0
                    }
                  },
                  {
                    "terms": {
                      "experience.company_hq_country_iso2": [
                        "US"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
  },
  "sort": [
    "_score"
  ]
}
```

{% endcode %}

### Data output `return_data: true`

The endpoint with `return_data: true` parameter generates the Elasticsearch DSL query internally, executes it, and returns results directly. The Elasticsearch DSL query is not exposed in this mode.

The `limit` parameter available on this mode controls the maximum number of results returned.  Default value is `20`, and maximum is `100`.

#### Response structure

Here is an overview of the fields that are included in the response.

| Data field                           | Description                                              | Data type |
| ------------------------------------ | -------------------------------------------------------- | --------- |
| `id`                                 | Identification number                                    | Integer   |
| `full_name`                          | Employee's full name                                     | String    |
| `professional_network_url`           | Most recent profile URL                                  | String    |
| `headline`                           | Profile headline                                         | String    |
| `location_full`                      | Employee's full location                                 | String    |
| `location_country`                   | Associated country                                       | String    |
| `connections_count`                  | Count of profile connections                             | Integer   |
| `followers_count`                    | Count of profile followers                               | Integer   |
| `company_name`                       | Company name                                             | String    |
| `company_professional_network_url`   | Company's profile URL                                    | String    |
| `company_website`                    | Company's website                                        | String    |
| `company_industry`                   | Company's industry                                       | String    |
| `active_experience_title`            | Title of employee's current position                     | String    |
| `active_experience_department`       | A list of employee's departments                         | String    |
| `active_experience_management_level` | A list of employee's management levels                   | String    |
| `company_hq_full_address`            | Full address of the company's headquarters               | String    |
| `company_hq_country`                 | The country where the company's headquarters are located | String    |
| `_score`                             | Elasticsearch DSL score                                  | Float     |

#### Example request

```json
curl -X 'POST' \
  'https://api.coresignal.com/cdapi/v2/agentic_search/fast' \
  -H 'accept: application/json' \
  -H 'apikey: {API key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "prompt": "Find founders or co-founders who have previously held an engineering role at Google, Meta, Apple, Amazon, or Microsoft.",
  "return_data": true,
  "limit": 1,
  "entity": "employee"
}
```

{% hint style="success" %}
Get your API Key from Coresignal's [self-service platform](https://dashboard.coresignal.com/sign-in).
{% endhint %}

#### Example response

{% code expandable="true" %}

```json
[
  {
    "id": 123456789,
    "full_name": "John Doe",
    "professional_network_url": "https://www.professional-network.com/john-doe",
    "headline": "Product Development",
    "location_full": "Redmond, Washington, United States",
    "location_country": "United States",
    "connections_count": 500,
    "followers_count": 12345,
    "company_name": "Example Company",
    "company_professional_network_url": "https://www.professional-network.com/company/example-company",
    "company_website": "https://www.example-company.com",
    "company_industry": "Technology, Information and Internet",
    "active_experience_title": "Co-Founder",
    "active_experience_department": "Consulting",
    "active_experience_management_level": "Founder",
    "company_hq_full_address": "1 Fake st; Redmond, Washington 00000, US",
    "company_hq_country": "United States",
    "_score": 20.123123
  }
]
```

{% endcode %}

## Pricing

Search credits are consumed per request. The cost depends on the output mode and, when returning data, on the number of results returned.

| Output mode          | Response                                                                                                                              | Search credits cost           |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| `return_data: false` | Elasticsearch DSL query                                                                                                               | 2                             |
| `return_data: true`  | <p>1–20 results returned<br>21–40 results returned<br>41–60 results returned<br>61–80 results returned<br>81–100 results returned</p> | <p>2<br>4<br>6<br>8<br>10</p> |

{% hint style="info" %}
Credits are charged based on the number of results actually returned, not the value of `limit`. If your query matches fewer results than requested, you are charged for the actual result count.
{% endhint %}

## Response codes

| Response code | Description                                                             |
| ------------- | ----------------------------------------------------------------------- |
| `200`         | A successful request                                                    |
| `400`         | Invalid request payload                                                 |
| `401`         | No valid API Key was provided. Check if your key is valid and try again |
| `402`         | Insufficient credits. Add more credits to continue                      |
| `502` / `503` | Engine timeout / upstream error                                         |
