# Can I use the Tavily SDK with UpRock?

Yes, for search and extract. Create the client with the base URL https://edge.uprock.com/compat/tavily (api_base_url in Python, apiBaseURL in JavaScript) and your UpRock API key. The search call returns live results from several engines in Tavily's format, and extract returns each page as markdown or text. Crawl, map and research aren't available on UpRock, and search never returns an LLM answer.

Updated 10 Nov 2026. Web page: https://uprock.ai/integrations/tavily-sdk

## On this page

- [Change two values](#change-two-values)
- [What comes back](#what-comes-back)
- [Which options work](#which-options-work)
- [FAQ](#faq)
- [Other use cases to explore](#explore)
- [Related articles](#related)
- [References](#references)
- [Get started](#get-started)

## Change two values

UpRock answers Tavily's search and extract requests under `https://edge.uprock.com/compat/tavily` and returns Tavily's response shape, so the official SDKs work once you change the base URL and the key. Get a key at uprock.ai/app/api-keys.

### Python

```python
# pip install tavily-python   env: UPROCK_API_KEY
import os
from tavily import TavilyClient

client = TavilyClient(
    api_key=os.environ["UPROCK_API_KEY"],
    api_base_url="https://edge.uprock.com/compat/tavily",
)

found = client.search("best espresso machine 2026", max_results=5)
for r in found["results"]:
    print(r["score"], r["title"], r["url"])

pages = client.extract([found["results"][0]["url"]], format="markdown", include_usage=True)
print(pages["results"][0]["raw_content"][:300])
print(pages["failed_results"], pages["usage"])
```

### TypeScript

```ts
// npm i @tavily/core   (Node 18+)   env: UPROCK_API_KEY
import { tavily } from "@tavily/core";

const client = tavily({
  apiKey: process.env.UPROCK_API_KEY,
  apiBaseURL: "https://edge.uprock.com/compat/tavily",
});

const found = await client.search("best espresso machine 2026", { maxResults: 5 });
for (const r of found.results) console.log(r.score, r.title, r.url);

const pages = await client.extract([found.results[0].url], { format: "markdown", includeUsage: true });
console.log(pages.results[0]?.rawContent.slice(0, 300));
console.log(pages.failedResults, pages.usage);
```

Use the base URL exactly as written, with no trailing slash: the SDKs add `/search` and `/extract` to it.

## What comes back

Search returns Tavily's fields: `query`, `results`, `answer`, `images`, `follow_up_questions`, `response_time` and `request_id`. Each result has `title`, `url`, `content` (a snippet), `score` and `raw_content`. Extract returns `results` (each with `url`, `title` and `raw_content`), `failed_results` with the URL and the reason, `response_time`, `request_id` and, when you ask for it, `usage.credits`.

## Which options work

We ran each call below with tavily-python 0.8.5 and @tavily/core 1.0.0 against the live API on 8 Nov 2026, and re-ran search and the examples above on 10 Nov.

| Call or option | On UpRock |
|---|---|
| `search` with `query` and `max_results` (up to 20) | Works |
| `country` | Works, but slower: on 10 Nov, 2 of 4 searches with a country came back with no results after 35 seconds |
| `search_depth`, `topic`, `time_range`, `start_date`, `end_date`, `include_domains`, `exclude_domains` | Accepted and ignored |
| `include_answer`, `include_raw_content`, `include_images` | Accepted; `answer` and `raw_content` are null and `images` is empty |
| `extract` with one URL or a list of up to 20, `format` (`markdown` or `text`), `timeout`, `include_usage` | Works. Each page is loaded in a real browser, so `extract_depth` is ignored |
| `crawl`, `map`, `research` | 404 (`HTTPError` in Python). Keep Tavily for these |

A missing or wrong key returns Tavily's 401, which the SDK raises as `MissingAPIKeyError` or `InvalidAPIKeyError`.

## FAQ

### Can I keep my code and change only the URL?

Almost. The SDKs read the key from TAVILY_API_KEY when you don't pass one, so you can put your UpRock key there. The base URL has no environment variable in tavily-python 0.8.5 or @tavily/core 1.0.0; pass it when you create the client.

### Why is answer always null?

UpRock returns search results, not an LLM-written answer, so include_answer is accepted and ignored. The same goes for include_raw_content; to get the full text of the results, pass their URLs to extract.

### What does score mean?

It follows the order of the results, 1 for the first and lower for each one after it. It isn't a relevance score from a model, so use it to keep the order, not to set a cut-off.

### How do I choose the country?

Pass country with Tavily's lowercase country name, such as "canada" or "united states". The search runs from that country. An unknown name returns a 400.

### What does it cost?

A search is billed as one web research query, $1 per 1,000 searches by card or USDC. Extract is billed per page delivered, $0.50 per 1,000 pages. URLs that fail are listed in failed_results and aren't charged; include_usage returns the number of pages billed.

## Other use cases to explore

- [Add UpRock next to Tavily](https://uprock.ai/compare/tavily): what Tavily does best, published prices side by side, and fallback code.
- [Use the Firecrawl SDK with UpRock](https://uprock.ai/integrations/firecrawl-sdk): scrape through firecrawl-py or @mendable/firecrawl-js with one changed URL.
- [Turn web pages into markdown](https://uprock.ai/use-cases/web-pages-to-markdown): clean markdown from pages that need JavaScript, ready for an LLM.
- [See a page as it looks in another country](https://uprock.ai/use-cases/page-from-another-country): one store page from five countries, with five prices, two languages and a cookie banner in one country only.

## Related articles

- [How do I give Claude Code live web access with UpRock?](https://uprock.ai/integrations/claude-code.md): Add UpRock's MCP server to Claude Code with the key kept out of your repo, check it's connected, tell Claude when to use it, and know the output limits that matter for big pages.
- [How do I add UpRock to Cursor?](https://uprock.ai/integrations/cursor.md): Add UpRock's MCP server to Cursor with the key read from your environment, turn it on, pre-approve the fetch tools, add a rule for when to use it, and run it from Cursor's command-line agent.
- [How do I use UpRock as a LangChain tool?](https://uprock.ai/integrations/langchain.md): Load UpRock's MCP tools into LangChain in Python or JavaScript, call them directly or from an agent, and handle the result format, with code we ran against the live server.
- [How do I give a Vercel AI SDK app web access with UpRock?](https://uprock.ai/integrations/vercel-ai-sdk.md): Connect UpRock's MCP server with @ai-sdk/mcp, call its tools directly or let the model choose them in generateText, and avoid the timeout and key-logging traps, with code we ran against the live server.
- [How do I fetch web pages from a chosen country in n8n?](https://uprock.ai/integrations/n8n.md): Install UpRock's verified n8n node, add your key, import a two-node workflow we ran in n8n 2.44, and read the page's markdown in the next step, or give the node to an AI Agent as a tool.
- [How do I add UpRock to OpenAI's Codex CLI?](https://uprock.ai/integrations/codex.md): Add UpRock's MCP server to Codex with one command, keep the API key in an environment variable, raise the 60-second tool timeout, and add your own rules in AGENTS.md.
- [How do I give a CrewAI agent web access with UpRock?](https://uprock.ai/integrations/crewai.md): Load UpRock's MCP tools into CrewAI with MCPServerAdapter and the key in a header, why it beats the mcps field's 30-second limit, and how to read what the tools return, with tested code.
- [How do I give a Mastra agent web access with UpRock?](https://uprock.ai/integrations/mastra.md): Connect UpRock's MCP server with MCPClient from @mastra/mcp, raise its 60-second timeout, and call the tools directly or from an Agent, with tested code.
- [Can I use the Firecrawl SDK with UpRock?](https://uprock.ai/integrations/firecrawl-sdk.md): Point firecrawl-py or @mendable/firecrawl-js at UpRock by changing the API URL and key. Scrape works unchanged. What's supported, what isn't, and a backup client in four lines, tested 8 Nov 2026.
- [Can I use the Exa SDK with UpRock?](https://uprock.ai/integrations/exa-sdk.md): Point exa-py or exa-js at UpRock by changing the base URL and key. Search and get_contents return Exa's response shape. What's supported, what isn't, and how to get full page text, tested 10 Nov 2026.
- [Integrations: all articles](https://uprock.ai/integrations.md)

## References

1. [Tavily Python SDK reference](https://docs.tavily.com/sdk/python/reference), checked 8 Nov 2026
2. [Tavily JavaScript SDK reference](https://docs.tavily.com/sdk/javascript/reference), checked 8 Nov 2026
3. [tavily-python on PyPI](https://pypi.org/project/tavily-python/), checked 8 Nov 2026
4. [@tavily/core on npm](https://www.npmjs.com/package/@tavily/core), checked 8 Nov 2026
5. [UpRock API spec (POST /compat/tavily/search and /compat/tavily/extract)](https://uprock.ai/openapi.json), checked 8 Nov 2026
6. [UpRock, everything in one file (API, CLI, MCP, pricing)](https://uprock.ai/llms-full.txt), checked 10 Nov 2026

## Get started

Get an API key: https://uprock.ai/app/api-keys

Paste this into your agent:

```text
Set up UpRock for me: read https://uprock.ai/agents.md, connect the UpRock MCP server, and run one test crawl. Tell me what it costs before you spend anything.
```

Setup for every client (MCP, skill, CLI): https://uprock.ai/agents.md
