Skip to content
Fieldwork
Get started
Esc
↑↓navigate↵open⌘Jpreview
0.13Several providers behind one agent tool

Search, read and research the web through one API.

Eleven providers behind the same methods.

Read the docs
Providers
11
Capabilities
19
Agent tools
24
Error type
1
import { fieldwork } from "@howells/fieldwork-sdk";import { firecrawl } from "@howells/fieldwork-sdk/firecrawl"; const web = fieldwork({ adapter: firecrawl() }); const { results } = await web.search("Framework Laptop 13 specs");const page = await web.read(results[0].url);const product = await web.product(page.url); page.markdown;     // the page as Markdownproduct.variants;  // sku, values, price, availability, imagesproduct.raw;       // Firecrawl's own response

Change the provider.
Keep every call.

search
Exa, Firecrawl, Tavily, Parallel, Perplexity, Brave, SerpApi, Browserbase
images
Firecrawl, Tavily, Parallel, Brave, SerpApi
reverseImage
SerpApi
read
Exa, Firecrawl, Tavily, Parallel, Browserbase, Kernel
readMany
Exa, Firecrawl, Tavily, Parallel
extract
Exa, Firecrawl, Parallel
product
Firecrawl
map
Firecrawl, Tavily
crawl
Firecrawl, Tavily
answer
Exa, Tavily, Parallel, Perplexity, Brave
research
Exa, Firecrawl, Tavily, Parallel, Perplexity
discover
Parallel
decide
Parallel, Perplexity
act
Firecrawl, Kernel
browser
Firecrawl, Browserbase, Kernel
parse
Firecrawl, LlamaParse, Reducto
download
Firecrawl, Browserbase, Kernel
monitor
Exa, Firecrawl, Parallel
usage
Firecrawl, Tavily, SerpApi, Browserbase

A call the provider can't serve doesn't compile.

  • No fallbacks

    A call goes to the provider you chose, or it doesn't go. Nothing quietly switches to another provider.

  • Refused by the types

    An unsupported method is a type error. In plain JavaScript it throws before any request is sent.

  • The provider's response, kept

    Every result is normalized, and the original response is on it as raw.

  • One error type

    Every failure is a FieldworkError with a code, whether repeating can succeed, and the job's id.

Tavilyhonest.ts
const web = fieldwork({ adapter: tavily() }); // @ts-expect-error Tavily has no browserawait web.act(script); try {  await web.crawl("https://frame.work");} catch (error) {  if (error instanceof FieldworkError) {    error.code;       // "RateLimited"    error.retryable;  // true    error.retryAfter; // 30  }}

One provider for each capability.

router.ts
const web = fieldwork({  adapter: router({    search: parallel(),    read: firecrawl(),    product: firecrawl(),    research: exa(),  }),}); web.supports("crawl");  // false

The same methods in code, in agents, over MCP and over HTTP.

In your code

const { output, sources } =  await web.research(    "Does Framework 13 have USB4?"  );

@howells/fieldwork-sdk

In your agents

const tools = toolsFor(web);tools.map((t) => t.name);// search_web, read_page, extract_values,// answer_question, … only what web's provider serves

@howells/fieldwork-sdk/tools

In your MCP client

$ npx -y @howells/fieldwork-mcp \    --search exa,brave \    --read firecrawl \    --research exa

@howells/fieldwork-mcp

Over HTTP

$ curl $FIELDWORK_URL/api/v1/tools/search_web \    -H "authorization: Bearer $FIELDWORK_AGENT_KEY" \    -H "content-type: application/json" \    -d '{"query":"USB4 laptops"}'
GET /api/v1/openapi.json

Collect a long job after a timeout.

Pass the job's id back as resume instead of paying twice.

How long jobs work →
Exaresume.ts
try {  return await web.research(question, { timeout: 60_000 });} catch (error) {  if (error instanceof FieldworkError && error.jobId) {    return await web.research(question, { resume: error.jobId });  }  throw error;}

Boxes line up across parsers.

Every box is a fraction of the page from its top-left corner. LlamaParse and Reducto place each word and table cell.

LlamaParse puts the box at 0.408 from the left and 0.421 from the top of the page.

const { blocks } = await web.parse(sheet, {  wordBoxes: true,});const table = blocks.find((b) => b.cells); table.cells[1].box;// { left: 0.408, top: 0.421,//   width: 0.067, height: 0.023 }

Choose a provider today. Change it whenever you like.

Read the docs