Semantic Search

Semantic Search

Changed on
⚠️ This endpoint is currently in BETA

Perform an AI-powered semantic search. Use the entity-type field in the request body to specify which entity type to search. Currently only supports companies.

post/v2/semantic-search

Request

  • Base URL
    https://api.affinity.co
  • URL
    https://api.affinity.co/v2/semantic-search
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://login.affinity.co/auth/oauth2/authorize
      Token URL: https://login.affinity.co/auth/oauth2/token scopes: api.read

Request body

promptstring required

The search prompt to apply.

limitinteger

Number of items to include in the response.

entityType'companies'

The type of entity to search for.

listIdsinteger[]

The IDs of the lists to filter results by.

Example request

{
  "prompt": "Find companies like OpenAI that are based in the United States",
  "limit": 10,
  "entityType": "companies",
  "listIds": [
    1,
    2
  ]
}

Response

Created

entityType'companies' required

The type of entity that was searched.

explanationstring required

Example response

{
  "data": [
    {
      "id": 1,
      "name": "Horizon Technologies",
      "domain": "horizontech.com",
      "domains": [
        "horizontech.com"
      ],
      "isGlobal": true,
      "score": "0.85"
    }
  ],
  "entityType": "companies",
  "explanation": "This result matched the search criteria."
}

Changes

    • info

      the endpoint scheme security apiKeyAuth was added to the API

    • info

      the endpoint scheme security oauth2 was added to the API

    • info

      added authentication authorization bad-request conflict method-not-allowed not-acceptable not-found not-implemented rate-limit server timeout unprocessable-entity unsupported-media-type validation discriminator mapping keys to the / response property for the response status

    • info

      added bad-request validation discriminator mapping keys to the / response property for the response status