Skip to main content
POST
/
v2
/
semantic-search
Semantic Search
curl --request POST \
  --url https://api.affinity.co/v2/semantic-search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Find companies like OpenAI that are based in the United States",
  "limit": 100,
  "entityType": "<string>"
}
'
{
  "data": [
    {
      "id": 4503599627370496,
      "name": "<string>",
      "domain": "<string>",
      "domains": [
        "<string>"
      ],
      "isGlobal": true,
      "score": "<string>"
    }
  ],
  "entityType": "<string>",
  "explanation": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Semantic search criteria including search prompt and entity type

prompt
string
required

The search prompt to apply.

Required string length: 1 - 500
Example:

"Find companies like OpenAI that are based in the United States"

limit
integer<int32>
default:100

Number of items to include in the response.

Required range: 1 <= x <= 100
entityType
string

The type of entity to search for.

Allowed value: "companies"

Response

Created

Includes the list of entities that matched the search prompt and the explanation for the search.

data
Semantic Search Company · object[]
required

The list of entities that matched the search prompt

Maximum array length: 100
entityType
string
required

The type of entity that was searched.

Allowed value: "companies"
explanation
string
required