Skip to main content
POST
/
search
Search
curl --request POST \
  --url https://api.exa.ai/search \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "query": "Here is an article about the state of search:",
  "useAutoprompt": true,
  "type": "<string>",
  "category": "company",
  "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>"
    }
  ],
  "autopromptString": "<string>"
}
/search returns a list of links relevant to your query. There are two search types - neural and keyword.

Get API Key

Follow this link to get your API key

Authorizations

x-api-key
string
header
required

Body

application/json
query
string
required

The query string.

Example:

"Here is an article about the state of search:"

useAutoprompt
boolean

If true, your query will be converted to a Exa query. Default false. Neural or Auto search only.

type
string

The Type of search, 'keyword', 'neural', or 'auto' (decides between keyword and neural). Default neural.

category
enum<string>

(beta) A data category to focus on, with higher comprehensivity and data cleanliness. Categories right now include company, research paper, news, github, tweet, movie, song, personal site, and pdf.

Available options:
company,
research paper,
news,
github,
tweet,
movie,
song,
personal site,
pdf
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.

autopromptString
string

The Exa query created by the autoprompt functionality.