Skip to main content
POST
/
findSimilar
Find similar links
curl --request POST \
  --url https://api.exa.ai/findSimilar \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "url": "https://slatestarcodex.com/2014/07/30/meditations-on-moloch/",
  "numResults": 10,
  "includeDomains": [
    "example.com",
    "sample.net"
  ],
  "excludeDomains": [
    "excludedomain.com",
    "excludeme.net"
  ],
  "startCrawlDate": "2023-01-01T00:00:00.000Z",
  "endCrawlDate": "2023-12-31T00:00:00.000Z",
  "startPublishedDate": "2023-01-01T00:00:00.000Z",
  "endPublishedDate": "2023-12-31T00:00:00.000Z",
  "includeText": [
    "electron",
    "positron"
  ],
  "excludeText": [
    "neutron",
    "elon"
  ],
  "contents": {
    "text": {
      "maxCharacters": 123,
      "includeHtmlTags": true
    },
    "highlights": {
      "numSentences": 123,
      "highlightsPerUrl": 123,
      "query": "<string>"
    },
    "summary": {
      "query": "<string>"
    }
  }
}'
{
  "results": [
    {
      "title": "<string>",
      "url": "<string>",
      "publishedDate": "<string>",
      "author": "<string>",
      "score": 123,
      "id": "<string>",
      "text": "<string>",
      "highlights": [
        "<string>"
      ],
      "highlightScores": [
        123
      ],
      "summary": "<string>"
    }
  ]
}

Get Exa API Key

Follow this link to get your API key

Authorizations

x-api-key
string
header
required

Body

application/json
url
string
required

The url for which you would like to find similar links

Example:

"https://slatestarcodex.com/2014/07/30/meditations-on-moloch/"

numResults
integer

Number of search results to return. Default 10. Max 10 for basic plans. Up to thousands for custom plans.

Example:

10

includeDomains
string[]

List of domains to include in the search. If specified, results will only come from these domains.

Example:
["example.com", "sample.net"]
excludeDomains
string[]

List of domains to exclude in the search. If specified, results will not include any from these domains.

Example:
["excludedomain.com", "excludeme.net"]
startCrawlDate
string<date-time>

Crawl date refers to the date that Exa discovered a link. Results will include links that were crawled after this date. Must be specified in ISO 8601 format.

Example:

"2023-01-01T00:00:00.000Z"

endCrawlDate
string<date-time>

Crawl date refers to the date that Exa discovered a link. Results will include links that were crawled before this date. Must be specified in ISO 8601 format.

Example:

"2023-12-31T00:00:00.000Z"

startPublishedDate
string<date-time>

Only links with a published date after this will be returned. Must be specified in ISO 8601 format.

Example:

"2023-01-01T00:00:00.000Z"

endPublishedDate
string<date-time>

Only links with a published date before this will be returned. Must be specified in ISO 8601 format.

Example:

"2023-12-31T00:00:00.000Z"

includeText
string[]

List of strings that must be present in webpage text of results. Currently, only 1 string is supported, of up to 5 words.

Example:
["electron", "positron"]
excludeText
string[]

List of strings that must not be present in webpage text of results. Currently, only 1 string is supported, of up to 5 words.

Example:
["neutron", "elon"]
contents
object

Response

200 - application/json

OK

results
object[]

A list of search results containing title, URL, published date, author, and score.