> ## 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 for companies ids. Includes SDK V2 and CLI requests, input constraints, response fields, and Deepline credit cost.

Search for companies ids.

<Info>
  Tool ID: `theswarm_search_companies_v3`
</Info>

## Run this action

This action has conditional or dynamic input fields that cannot be represented by a reliable static example.

Inspect the live contract before executing it:

```bash theme={null}
deepline tools get theswarm_search_companies_v3 --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "ids": [
      "123e4567-e89b-42d3-a456-426614174000"
    ],
    "total_count": 123
  }
}
```

Use `deepline tools get 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={null}
  {
    "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={null}
  {
    "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](/docs/providers/theswarm/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
