Tavily Search
Execute a search query using Tavily Search.
Authorizations
Body
Parameters for the Tavily Search request.
Controls the latency vs. relevance tradeoff and how results[].content is generated:
advanced: Highest relevance with increased latency. Best for detailed, high-precision queries. Returns multiple semantically relevant snippets per URL (configurable viachunks_per_source).basic: A balanced option for relevance and latency. Ideal for general-purpose searches. Returns multiple semantically relevant snippets per URL (configurable viachunks_per_source).fast: Prioritizes lower latency while maintaining good relevance. Returns multiple semantically relevant snippets per URL (configurable viachunks_per_source).ultra-fast: Minimizes latency above all else. Best for time-critical use cases. Returns one NLP summary per URL.
Cost:
basic,fast,ultra-fast: 1 API Creditadvanced: 2 API Credits
See Search Best Practices for guidance on choosing the right search depth.
advanced, basic, fast, ultra-fast Chunks are short content snippets (about 500 characters each for basic and fast, 800 for advanced) pulled directly from the source. Use chunks_per_source to define the maximum number of relevant chunks returned per source and to control the content length. Chunks will appear in the content field as: <chunk 1> [...] <chunk 2> [...] <chunk 3>. Adjacent chunks may be joined into one longer passage, so chunk length is a target, not a hard limit. Available when search_depth is advanced, basic or fast.
1 <= x <= 3The category of the search.news is useful for retrieving real-time updates, particularly about politics, sports, and major current events covered by mainstream media sources. general is for broader, more general-purpose searches that may include a wide range of sources.
general, news, finance The time range back from the current date to filter results by publish date. Continuously updated pages, such as weather forecasts and prices, keep old publish dates and get filtered out. For those, leave time_range unset and use max_age_hours. By default, results with no detectable published date are not removed; set filter_by_published_date to true to remove them.
day, week, month, year, d, w, m, y Include a published_date field in each result. The date is Tavily's best estimate of when the source was published or last updated, so it can be later than the original publish date. Results with no detectable date return null. Automatically enabled when topic is news.
Note: this feature is currently in beta.
Remove results whose published date falls outside the time_range, start_date, or end_date window. Results with no detectable published date are also removed. Setting this to true also enables include_published_date.
If you want date-window filtering but don't want to lose sources without a detectable date, leave this false and set include_published_date: true together with a date range instead.
The maximum age in hours of Tavily's cached copy of each result.
Accepted values:
- unset (default): Tavily serves cached copies and fetches pages live as needed.
1to720(30 days): only return a cached copy fetched within that many hours.0: always fetch the page live.-1: never fetch live.
Use this for continuously updated pages, such as weather forecasts and prices, where time_range drops results. You can combine the two.
Lower values do not cost more credits, but fetching live adds latency. Results whose cached copy is too old and can't be fetched live are left out, so you may get fewer than max_results.
On non-paying plans, live fetching is best-effort. While Tavily is under heavy load, requests that set max_age_hours may be refused with 434 Flex tier capacity exceeded.
-1 <= x <= 72024
Controls how include_domains is applied. restrict limits results to only the listed domains. prefer also searches the rest of the web, so results outside include_domains can still surface, rather than excluding them. Defaults to restrict, so include_domains acts as a hard filter unless set to prefer. Setting it without include_domains returns a 400 error.
restrict, prefer 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.
afghanistan, albania, algeria, andorra, angola, argentina, armenia, australia, austria, azerbaijan, bahamas, bahrain, bangladesh, barbados, belarus, belgium, belize, benin, bhutan, bolivia, bosnia and herzegovina, botswana, brazil, brunei, bulgaria, burkina faso, burundi, cambodia, cameroon, canada, cape verde, central african republic, chad, chile, china, colombia, comoros, congo, costa rica, croatia, cuba, cyprus, czech republic, denmark, djibouti, dominican republic, ecuador, egypt, el salvador, equatorial guinea, eritrea, estonia, ethiopia, fiji, finland, france, gabon, gambia, georgia, germany, ghana, greece, guatemala, guinea, haiti, honduras, hungary, iceland, india, indonesia, iran, iraq, ireland, israel, italy, jamaica, japan, jordan, kazakhstan, kenya, kuwait, kyrgyzstan, latvia, lebanon, lesotho, liberia, libya, liechtenstein, lithuania, luxembourg, madagascar, malawi, malaysia, maldives, mali, malta, mauritania, mauritius, mexico, moldova, monaco, mongolia, montenegro, morocco, mozambique, myanmar, namibia, nepal, netherlands, new zealand, nicaragua, niger, nigeria, north korea, north macedonia, norway, oman, pakistan, panama, papua new guinea, paraguay, peru, philippines, poland, portugal, qatar, romania, russia, rwanda, saudi arabia, senegal, serbia, singapore, slovakia, slovenia, somalia, south africa, south korea, south sudan, spain, sri lanka, sudan, sweden, switzerland, syria, taiwan, tajikistan, tanzania, thailand, togo, trinidad and tobago, tunisia, turkey, turkmenistan, uganda, ukraine, united arab emirates, united kingdom, united states, uruguay, uzbekistan, venezuela, vietnam, yemen, zambia, zimbabwe Boost search results in a specific language. Accepts an ISO 639-1 code (e.g. en, fr, zh-cn) or an English language name (e.g. english, french). By default this only boosts matching-language results in ranking; pass filter_by_language: true to strictly filter out non-matching results instead. For best results, write your query in the same language you set here.
"en"
When auto_parameters is enabled, Tavily automatically configures search parameters based on your query's content and intent. You can still set other parameters manually, and your explicit values will override the automatic ones. The parameters include_answer, include_raw_content, and max_results must always be set manually, as they directly affect response size. Note: search_depth may be automatically set to advanced when it's likely to improve results. This uses 2 API credits per request. To avoid the extra cost, you can explicitly set search_depth to basic.
Ensure that only search results containing the exact quoted phrase(s) in the query are returned, bypassing synonyms or semantic variations. Wrap target phrases in quotes within your query (e.g. "John Smith" CEO Acme Corp). Punctuation is typically ignored inside quotes.
Response
Search results returned successfully
A short answer to the user's query, generated by an LLM. Included in the response only if include_answer is requested (i.e., set to true, basic, or advanced)
"Lionel Messi, born in 1987, is an Argentine footballer widely regarded as one of the greatest players of his generation. He spent the majority of his career playing for FC Barcelona, where he won numerous domestic league titles and UEFA Champions League titles. Messi is known for his exceptional dribbling skills, vision, and goal-scoring ability. He has won multiple FIFA Ballon d'Or awards, numerous La Liga titles with Barcelona, and holds the record for most goals scored in a calendar year. In 2014, he led Argentina to the World Cup final, and in 2015, he helped Barcelona capture another treble. Despite turning 36 in June, Messi remains highly influential in the sport."