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

# Affinity: V2 Semantic Search Post

> Semantic Search. Affinity V2 Semantic Search Post reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

Semantic Search.

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

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'affinity_v2_semantic_search_post',
  {
    "prompt": "example"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute affinity_v2_semantic_search_post --input '{
  "prompt": "example"
}' --json
```

## Example response

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

```json theme={null}
{
  "data": {
    "data": [
      {
        "id": 123,
        "name": "Example",
        "domain": "example.com",
        "domains": [
          "example.com"
        ],
        "isGlobal": true,
        "score": "example"
      }
    ],
    "entityType": "companies",
    "explanation": "example"
  }
}
```

Use `deepline tools get affinity_v2_semantic_search_post --json` for the latest machine-readable contract.

## Input reference

Semantic search criteria including search prompt and entity type

| Name                 | Type          | Required | Default | Details                                                                                |
| -------------------- | ------------- | -------- | ------- | -------------------------------------------------------------------------------------- |
| `payload.prompt`     | `string`      | Yes      | —       | The search prompt to apply. Minimum length: 1. Maximum length: 500.                    |
| `payload.limit`      | `integer`     | No       | `100`   | Number of items to include in the response. Format: `int32`. Minimum: 1. Maximum: 100. |
| `payload.entityType` | `"companies"` | No       | —       | The type of entity to search for.                                                      |
| `payload.listIds`    | `array`       | No       | —       | The IDs of the lists to filter results by. Maximum items: 100.                         |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Semantic search criteria including search prompt and entity type",
    "properties": {
      "prompt": {
        "type": "string",
        "description": "The search prompt to apply.",
        "minLength": 1,
        "maxLength": 500
      },
      "limit": {
        "type": "integer",
        "description": "Number of items to include in the response.",
        "default": 100,
        "minimum": 1,
        "maximum": 100,
        "format": "int32"
      },
      "entityType": {
        "type": "string",
        "description": "The type of entity to search for.",
        "const": "companies"
      },
      "listIds": {
        "type": "array",
        "description": "The IDs of the lists to filter results by.",
        "maxItems": 100,
        "items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991,
          "format": "int64"
        }
      }
    },
    "required": [
      "prompt"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name                          | Type             | Required | Default | Details                                                 |
| ----------------------------- | ---------------- | -------- | ------- | ------------------------------------------------------- |
| `result.data`                 | `object`         | Yes      | —       | —                                                       |
| `result.data.data`            | `array`          | Yes      | —       | Maximum items: 100.                                     |
| `result.data.data[].id`       | `integer`        | Yes      | —       | Format: `int64`. Minimum: 1. Maximum: 9007199254740991. |
| `result.data.data[].name`     | `string`         | Yes      | —       | —                                                       |
| `result.data.data[].domain`   | `string \| null` | Yes      | —       | Format: `hostname`.                                     |
| `result.data.data[].domains`  | `array`          | Yes      | —       | Maximum items: 100.                                     |
| `result.data.data[].isGlobal` | `boolean`        | Yes      | —       | —                                                       |
| `result.data.data[].score`    | `string`         | Yes      | —       | —                                                       |
| `result.data.entityType`      | `"companies"`    | Yes      | —       | —                                                       |
| `result.data.explanation`     | `string`         | Yes      | —       | —                                                       |
| `result.meta`                 | `object`         | No       | —       | —                                                       |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991,
                  "format": "int64"
                },
                "name": {
                  "type": "string"
                },
                "domain": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "hostname"
                },
                "domains": {
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "type": "string",
                    "format": "hostname"
                  }
                },
                "isGlobal": {
                  "type": "boolean"
                },
                "score": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "domain",
                "domains",
                "isGlobal",
                "score"
              ],
              "additionalProperties": false
            }
          },
          "entityType": {
            "type": "string",
            "const": "companies"
          },
          "explanation": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "entityType",
          "explanation"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "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

* [Affinity provider guide](/docs/providers/affinity/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)
