Tavily AI search API integration via curl. Use this skill to perform live web search and RAG-style retrieval.
If requests fail, run zero doctor check-connector --env-name TAVILY_TOKEN or zero doctor check-connector --url https://api.tavily.com/search --method POST
All examples below assume you have TAVILY_TOKEN set in your environment.
The base endpoint for the Tavily search API is a POST request to:
https://api.tavily.com/searchwith a JSON body.
Write to /tmp/tavily_request.json:
{
"query": "2025 AI Trending",
"search_depth": "basic",
"max_results": 5
}
Then run:
curl -s -X POST "https://api.tavily.com/search" --header "Content-Type: application/json" --header "Authorization: Bearer $TAVILY_TOKEN" -d @/tmp/tavily_request.json
Key parameters:
query: Search query or natural language questionsearch_depth:"basic" – faster, good for most use cases"advanced" – deeper search and higher recallmax_results: Maximum number of results to return (e.g. 3 / 5 / 10)Write to /tmp/tavily_request.json:
{
"query": "serverless SaaS pricing best practices",
"search_depth": "advanced",
"max_results": 8,
"include_answer": true,
"include_domains": ["docs.aws.amazon.com", "cloud.google.com"],
"exclude_domains": ["reddit.com", "twitter.com"],
"include_raw_content": false
}
Then run:
curl -s -X POST "https://api.tavily.com/search" --header "Content-Type: application/json" --header "Authorization: Bearer $TAVILY_TOKEN" -d @/tmp/tavily_request.json
Common advanced parameters:
include_answer: When true, Tavily returns a summarized answer fieldinclude_domains: Whitelist of domains to includeexclude_domains: Blacklist of domains to excludeinclude_raw_content: Whether to include raw page content (HTML / raw text). Default is false.Tavily returns a JSON object similar to:
{
"answer": "Brief summary...",
"results": [
{
"title": "Article title",
"url": "https://example.com/article",
"content": "Snippet or extracted content...",
"score": 0.89
}
]
}
In agents or automation flows you typically:
answer as a concise, ready-to-use summaryresults to extract title + url as references / citationsTo integrate Tavily in n8n with the HTTP Request node:
POSThttps://api.tavily.com/searchContent-Type: application/jsonAuthorization: Bearer {{ $env.TAVILY_TOKEN }}{
"query": "n8n self-hosted best practices",
"search_depth": "basic",
"max_results": 5
}
This lets you pipe Tavily search results into downstream nodes such as LLMs, Notion, Slack notifications, etc.
advanced only when necessary: it consumes more resources and is best for deep research / high-value questions.query; anonymize or mask when possible.