# Can I use the Exa SDK with UpRock?

Yes, for search and get_contents. Create the client with the base URL https://edge.uprock.com/compat/exa and your UpRock API key. Search returns live results from several engines in Exa's format, and get_contents loads each page in a real browser and returns its text. Search results carry a short snippet, not the full page, so call get_contents on the URLs you want in full. find_similar and answer aren't available on UpRock.

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

## On this page

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

## Change two values

UpRock answers Exa's search and contents requests under `https://edge.uprock.com/compat/exa` and returns Exa'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 exa-py   env: UPROCK_API_KEY
import os
from exa_py import Exa

exa = Exa(api_key=os.environ["UPROCK_API_KEY"], base_url="https://edge.uprock.com/compat/exa")

found = exa.search("best espresso machine 2026", num_results=5)
for r in found.results:
    print(r.title, r.url)

pages = exa.get_contents([found.results[0].url], text=True)
print(pages.results[0].text[:300])
```

### TypeScript

```ts
// npm i exa-js   (Node 18+)   env: UPROCK_API_KEY
import Exa from "exa-js";

const exa = new Exa(process.env.UPROCK_API_KEY, "https://edge.uprock.com/compat/exa");

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

const pages = await exa.getContents([found.results[0].url], { text: true });
console.log(pages.results[0]?.text?.slice(0, 300));
```

Search takes 5 to 20 seconds. `get_contents` loads each page in a real browser on an opted-in device, so a fresh page usually takes 10 to 40 seconds.

## Which calls and options work

We ran each call below with exa-py 2.28.0 and exa-js 2.28.0 against the live API on 10 Nov 2026.

| Call or option | On UpRock |
|---|---|
| `search` with `query` and `num_results` (up to 20) | Works. Each result has `title`, `url`, `published_date` when known, and a short `text` snippet |
| `include_domains`, `exclude_domains`, `start_published_date` | Work |
| `search_and_contents` with `text` (and `max_characters`) | Works, but `text` is the snippet, not the page. Use `get_contents` for full text |
| `type`, `category`, `highlights`, `summary` | Accepted; `type` and `category` don't change the results, and `highlights` and `summary` come back empty |
| `get_contents` with a list of URLs and `text` (and `max_characters`) | Works. Returns the page's full text and a `statuses` entry per URL |
| `find_similar`, `answer` | 404, raised as `ValueError` in Python and `ExaError` in TypeScript. Keep Exa for these |

A missing or wrong key returns 401, which exa-py raises as `ValueError` and exa-js as `ExaError: Invalid API key`.

We ran both examples above against the live API on 10 Nov 2026. For one Wikipedia page, search with text returned 280 characters and `get_contents` returned 121,174.

## FAQ

### Is it the same search as Exa's?

No. Exa searches its own index by meaning; that index is Exa's and can't be copied. UpRock answers the same request with live results from several search engines, in Exa's response format, so your code keeps working but the results differ. type and category are accepted and don't change the results.

### Why is the text in search results so short?

Search returns a snippet for each result (about 150 to 400 characters), even when you ask for text. For the full page, pass the URLs to get_contents, which loads each page in a real browser. That's two calls instead of one, and only the pages you need are fetched.

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

Almost. Put your UpRock key where your Exa key was, and pass the base URL when you create the client (base_url in Python, the second argument in JavaScript). exa-py 2.28.0 and exa-js 2.28.0 don't read the base URL from an environment variable.

### How do I see why a page failed?

get_contents lists each URL in statuses. A page that answers 404 comes back as status error with the tag CRAWL_HTTP_404, so the HTTP code isn't lost.

### What does it cost?

A search is billed as one web research query, $1 per 1,000 searches by card or USDC. get_contents is billed per page delivered, $0.50 per 1,000 pages.

## Other use cases to explore

- [Add UpRock next to Exa](https://uprock.ai/compare/exa): what Exa does best, published prices side by side, and fallback code.
- [Use the Tavily SDK with UpRock](https://uprock.ai/integrations/tavily-sdk): search and extract through tavily-python or @tavily/core with one changed URL.
- [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 text from pages that need JavaScript, ready for an LLM.

## 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 Tavily SDK with UpRock?](https://uprock.ai/integrations/tavily-sdk.md): Point tavily-python or @tavily/core at UpRock by changing the base URL and key. Search and extract return Tavily's response shape. Which options work, which are ignored, and what each call costs, tested 10 Nov 2026.
- [Integrations: all articles](https://uprock.ai/integrations.md)

## References

1. [Exa Python SDK (exa-py)](https://docs.exa.ai/sdks/python-sdk-specification), checked 10 Nov 2026
2. [Exa TypeScript SDK (exa-js)](https://docs.exa.ai/sdks/typescript-sdk-specification), checked 10 Nov 2026
3. [exa-py on PyPI](https://pypi.org/project/exa-py/), checked 10 Nov 2026
4. [exa-js on npm](https://www.npmjs.com/package/exa-js), checked 10 Nov 2026
5. [UpRock API spec (POST /compat/exa/search and /compat/exa/contents)](https://uprock.ai/openapi.json), checked 10 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
