latestOpenAPI 3.1.02026-08-1063122.9 KB

80a1ceebb4e7

AI

AI Web Search

Performs a web search using advanced AI-powered search capabilities. This endpoint leverages the Tavily API to provide comprehensive search results with optional LLM-generated answers, image results, and content extraction.

post/ai/web-search

Request body

querystring required

The query to run a search on

searchDepth'basic' | 'advanced'

The depth of the search. 'advanced' search is tailored to retrieve the most relevant sources and content snippets for your query, while 'basic' search provides generic content snippets from each source

topic'general' | 'news'

The category of the search. Determines which agent will be used

daysinteger

The number of days back from the current date to include in the results. Available only when using the 'news' topic

timeRange'day' | 'week' | 'month' | 'year' | 'd' | 'w' | 'm' | 'y'

The time range back from the current date

maxResultsinteger

The maximum number of search results to return

chunksPerSourceinteger

Maximum number of relevant chunks returned per source. Available only when searchDepth is 'advanced'

includeImagesboolean

Include a list of query-related images in the response

includeImageDescriptionsboolean

Include a list of query-related images and their descriptions in the response

includeDomainsstring[]

A list of domains to specifically include in the search results

excludeDomainsstring[]

A list of domains to specifically exclude from the search results

countrystring

Boost search results from a specific country. This will prioritize content from the selected country in the search results. Available only if topic is general

timeoutinteger

A timeout to be used in requests to the Tavily API

Response

The request has succeeded.

querystring required

Your search query

follow_up_questionsstring

Follow-up questions related to the search

answerstring

The answer to your search query, generated by an LLM based on Tavily's search results. This is only available if includeAnswer is set to true

response_timenumber double required

Your search result response time