> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# The Swarm: Theswarm Search Companies V3

> Search companies with an Elasticsearch-style query and get back the matching company IDs. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Search companies with an Elasticsearch-style query and get back the matching company IDs.

> [!NOTE]
>
> Tool ID: `theswarm_search_companies_v3`

## Run this action

This action has conditional or dynamic inputs. A static example cannot describe these inputs reliably.

Read the live contract before you execute this action:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline describe theswarm_search_companies_v3 --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "ids": [
      "123e4567-e89b-42d3-a456-426614174000"
    ],
    "total_count": 123
  }
}
```

Use `deepline describe theswarm_search_companies_v3 --json` for the latest machine-readable contract.

## Input reference

Search for companies ids using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) format

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.query` | `object` | Yes | — | Search query in the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) format. [Find mapping here](https://docs.theswarm.com/docs/mappings/company-v2) |
| `payload.limit` | `integer` | No | `100` | Limit the number of results. If you want to use stable\_pagination this parameter must be set to 1000 Minimum: 0. Maximum: 1000. |
| `payload.pagination_token` | `string` | No | — | Pagination token received in the previous response |
| `payload.stable_pagination` | `boolean` | No | `false` | When set to true, ensures that pagination results remain consistent, even if the underlying data changes during retrieval. This is useful for retrieving large result sets reliably across multiple requests |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Search for companies ids using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) format",
    "properties": {
      "query": {
        "type": "object",
        "description": "Search query in the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) format. [Find mapping here](https://docs.theswarm.com/docs/mappings/company-v2)"
      },
      "limit": {
        "type": "integer",
        "description": "Limit the number of results. If you want to use stable_pagination this parameter must be set to 1000",
        "default": 100,
        "minimum": 0,
        "maximum": 1000
      },
      "pagination_token": {
        "type": "string",
        "description": "Pagination token received in the previous response"
      },
      "stable_pagination": {
        "type": "boolean",
        "description": "When set to true, ensures that pagination results remain consistent, even if the underlying data changes during retrieval. This is useful for retrieving large result sets reliably across multiple requests",
        "default": false
      }
    },
    "required": [
      "query"
    ],
    "anyOf": [
      {
        "properties": {
          "stable_pagination": {
            "enum": [
              false
            ]
          }
        },
        "additionalProperties": false
      },
      {
        "properties": {
          "limit": {
            "enum": [
              1000
            ]
          }
        },
        "required": [
          "limit"
        ],
        "additionalProperties": false
      }
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.ids` | `array` | Yes | — | List of company ids |
| `result.data.total_count` | `integer` | Yes | — | Total number of companies matching the query |
| `result.data.pagination_token` | `string` | No | — | Pagination token for the next request |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "ids": {
            "type": "array",
            "description": "List of company ids",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "Total number of companies matching the query"
          },
          "pagination_token": {
            "type": "string",
            "description": "Pagination token for the next request"
          }
        },
        "required": [
          "ids",
          "total_count"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [The Swarm provider guide](https://deepline.com/docs/providers/theswarm/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.