Perform a search with an Exa prompt-engineered query and retrieve a list of relevant results. Optionally get contents.

post/search

Request

  • Base URL
    https://api.exa.ai
  • URL
    https://api.exa.ai/search
  • Auth
    • API key in header x-api-key
    • or HTTP bearer

Request body

includeDomainsstring[] nullable

List of domains or domain paths to include in the search. Each entry can be a hostname (for example, example.com), a hostname with a path prefix (for example, example.com/docs), or a wildcard subdomain (for example, *.example.com). If specified, results will only come from the matching domains or paths. Use this parameter for domain or path filtering instead of adding a site: operator to the query.

excludeDomainsstring[] nullable

List of domains or domain paths to exclude from search results. Each entry can be a hostname (for example, example.com), a hostname with a path prefix (for example, example.com/docs), or a wildcard subdomain (for example, *.example.com). If specified, no results will be returned from the matching domains or paths. Use this parameter for domain or path filtering instead of adding a site: operator to the query.

startPublishedDatestring date-time nullable

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

endPublishedDatestring date-time nullable

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

numResultsinteger nullable

Number of results to return. Limits vary by search type. The maximum public limit is 100 results. Contact sales (hello@exa.ai) to discuss higher limits.

moderationboolean nullable

Enable content moderation to filter unsafe content from search results.

querystring required

The query string for the search.

additionalQueriesstring[] nullable

Additional query variations for deep-search variants. Only works with a deep-search type. When provided, these queries are used alongside the main query for broader results.

category'company' | 'publication' | 'news' | 'personal site' | 'financial report' | 'people' nullable

A data category to focus on. Other strings are accepted and used as category hints. people and company return higher-quality people profiles and company pages. publication returns scholarly publications such as research papers, preprints, and journal articles, with metadata like authors, venue, and citations. company and people do not support startPublishedDate or endPublishedDate, and people also does not support excludeDomains. Requests that set an unsupported filter return a 400 error.

compliance'hipaa' nullable

Enterprise-only compliance mode. Set to hipaa for HIPAA mode. Requires cache-only retrieval with supported parameters. See the HIPAA docs for details.

objectivestring nullable

The broader goal this search serves: the task the caller is working on, beyond the query itself. When exposing this field to an agent as a tool parameter, describe it as: "Goal for this search turn; say which documents should rank first, which should be excluded, and what specific facts or figures to pull from them."

userIdentifierstring nullable

An opaque ID your platform assigns to the end user this request is made for, such as a UUID. Lets Exa attribute usage to that end user rather than your whole team. Must not contain personal information such as an email address, phone number, username, or name. Hash such values before sending them. 1 to 64 characters: letters, digits, underscores, and hyphens. Retained even when your team has Zero Data Retention enabled. Does not affect results.

systemPromptstring nullable

Additional instructions that guide generated output or agent behavior. Use this for source preferences, novelty constraints, duplication constraints, or other behavior guidance.

streamboolean nullable

Requests server-sent events for synthesized output streaming. Streaming is currently used only when outputSchema is provided; otherwise the endpoint returns the normal JSON search response.

startCrawlDatestring date-time nullable

Deprecated. Ignored by the API. Setting it adds an IGNORED_FIELD warning to the response's warnings.

endCrawlDatestring date-time nullable

Deprecated. Ignored by the API. Setting it adds an IGNORED_FIELD warning to the response's warnings.

includeTextstring[] nullable

Deprecated. List of strings that must be present in the webpage text of results. Matching is approximate (word-level rather than exact phrase), so a multi-word entry can match pages where its words appear separately. Up to 50 strings, each up to 4096 characters.

excludeTextstring[] nullable

Deprecated. List of strings that must not be present in the webpage text of results. Matching is approximate (word-level rather than exact phrase). Up to 50 strings, each up to 4096 characters.

Example request

{
  "userIdentifier": "7f3a9c52-1d4e-4b8a-9e60-2c5d8a1f0b37"
}

Response

OK

OR

Example response

{
  "warnings": [
    {
      "code": "IGNORED_FIELD",
      "path": "/startCrawlDate"
    }
  ],
  "notices": [
    {
      "code": "RESTRICTIONS_RELAXED",
      "path": "/query"
    }
  ]
}

Changes

    • info

      request property //////// deprecated

    • info

      request property //////// deprecated

    • info

      request property ////// deprecated

    • info

      request property ////// deprecated

    • info

      request property //////// deprecated

    • info

      request property //////// deprecated

    • info

      request property ////// deprecated

    • info

      request property ////// deprecated