Skip to main content
POST
/
contents
Get contents of documents, many different types
curl --request POST \
  --url https://api.exa.ai/contents \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "ids": [
    "<string>"
  ],
  "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>"
    }
  ]
}
/contents is used to instantly get content for documents, given the IDs of the documents. Also note that “instant” is a little bit of a lie if you are using keyword search, in which case contents might take a few seconds to retrieve.

Get Exa API Key

Follow this link to get your API key

Authorizations

x-api-key
string
header
required

Body

application/json
ids
string[]
required

Array of document IDs obtained from searches

text
object

Parsed contents of the page.

highlights
object

Relevant extract(s) from the webpage.

summary
object

Summary of the webpage

Response

200 - application/json

OK

results
object[]