Skip to content
Go To Dashboard

Web Scraping

Extract clean content from any web page, crawl entire sites, or search and scrape in one step — no Firecrawl account, no browser infrastructure, just API calls.

import { createFetch } from "@sapiom/fetch";
const sapiomFetch = createFetch({
apiKey: process.env.SAPIOM_API_KEY,
agentName: "my-agent",
});
// Scrape a page and get clean markdown
const response = await sapiomFetch(
"https://firecrawl.services.sapiom.ai/v2/scrape",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://example.com/blog/article",
formats: ["markdown"],
}),
}
);
const data = await response.json();
console.log(data.data.markdown);

Sapiom routes scraping requests to Firecrawl, which handles browser rendering, content extraction, and anti-bot bypass. The SDK handles payment negotiation automatically — you pay per credit based on the operation.

The service supports several operations:

  1. Scrape — Extract content from a single URL as markdown, HTML, or structured JSON
  2. Map — Discover all URLs on a site by crawling its structure
  3. Search — Search the web and scrape the results in one step
  4. Crawl — Asynchronously crawl an entire site (up to 10,000 pages)
  5. Extract — Asynchronously extract structured data from URLs using AI
  6. Batch Scrape — Asynchronously scrape multiple URLs at once

Powered by Firecrawl. Firecrawl provides reliable web scraping with JavaScript rendering, anti-bot bypass, and clean content extraction.

Base URL: https://firecrawl.services.sapiom.ai

MethodPathDescriptionPricing
POST/v2/scrapeScrape a single URL1+ credits
POST/v2/mapMap site structure1 credit
POST/v2/searchSearch and scrape resultsDynamic
POST/v2/crawlStart async crawlDynamic (async)
GET/v2/crawl/:idGet crawl status (free)Free
DELETE/v2/crawl/:idCancel crawl (free)Free
POST/v2/extractStart async extractionDynamic (async)
GET/v2/extract/:idGet extract status (free)Free
POST/v2/batch/scrapeStart async batch scrapeDynamic (async)
GET/v2/batch/scrape/:idGet batch status (free)Free

Endpoint: POST https://firecrawl.services.sapiom.ai/v2/scrape

Extract content from a single URL. Returns immediately with the scraped content.

ParameterTypeRequiredDescription
urlstringYesURL to scrape
formatsstring[]NoOutput formats: markdown, html, json
proxystringNoProxy type: enhanced, auto, or basic

All other Firecrawl scrape parameters are also accepted and forwarded as-is.

{
"url": "https://example.com/blog/post",
"formats": ["markdown"]
}
{
"success": true,
"data": {
"markdown": "# Article Title\n\nArticle content...",
"metadata": {
"title": "Article Title",
"description": "Article description",
"sourceURL": "https://example.com/blog/post"
}
}
}
ConfigurationCreditsCost
Base scrape1$0.009
+ Enhanced proxy+4$0.045
+ JSON extraction+4$0.045
Both addons9$0.081

Endpoint: POST https://firecrawl.services.sapiom.ai/v2/map

Discover all URLs on a site by crawling its link structure. Useful for building a sitemap before crawling.

ParameterTypeRequiredDescription
urlstringYesURL to map
{
"url": "https://example.com"
}

Flat rate: 1 credit ($0.009).


Endpoint: POST https://firecrawl.services.sapiom.ai/v2/search

Search the web and scrape the results in one step. Returns search results with full page content.

ParameterTypeRequiredDescription
querystringYesSearch query
limitnumberNoMax results (default: 5)
scrapeOptionsobjectNoPer-result scrape options
scrapeOptions.proxystringNoProxy type: enhanced, auto, basic
scrapeOptions.formatsstring[]NoOutput formats: markdown, html, json
{
"query": "TypeScript best practices 2026",
"limit": 5
}

Search pricing combines a base search fee plus per-result scraping:

searchCredits = ceil(limit / 10) * 2
perResultCredits = 1 + (enhanced proxy ? 4 : 0) + (json format ? 4 : 0)
totalCredits = searchCredits + (limit * perResultCredits)
Example (limit=5)CreditsCost
Base search7$0.063
+ Enhanced proxy27$0.243

Endpoint: POST https://firecrawl.services.sapiom.ai/v2/crawl

Start an asynchronous crawl job. Returns a job ID — poll the status endpoint to get results.

ParameterTypeRequiredDescription
urlstringYesStarting URL to crawl
limitnumberNoMax pages to crawl (default: 10,000, max: 10,000)
scrapeOptionsobjectNoPer-page scrape options
scrapeOptions.proxystringNoProxy type
scrapeOptions.formatsstring[]NoOutput formats
{
"url": "https://docs.example.com",
"limit": 50
}
{
"id": "crawl-abc123",
"status": "started"
}

Endpoint: GET https://firecrawl.services.sapiom.ai/v2/crawl/{id} (free)

{
"status": "completed",
"creditsUsed": 42,
"data": [...]
}

Endpoint: DELETE https://firecrawl.services.sapiom.ai/v2/crawl/{id} (free)

You authorize the maximum cost upfront based on limit. You only pay for pages actually crawled (creditsUsed).

LimitBase CreditsCost (max)
1010$0.09
5050$0.45
100100$0.90

Enhanced proxy and JSON format add +4 credits per page each.


Endpoint: POST https://firecrawl.services.sapiom.ai/v2/extract

Start an asynchronous AI extraction job. Uses LLMs to extract structured data from URLs.

ParameterTypeRequiredDescription
urlsstring[]YesURLs to extract from
promptstringYesExtraction prompt or schema

Endpoint: GET https://firecrawl.services.sapiom.ai/v2/extract/{id} (free)

Pricing is token-based. Estimated at ~334 credits per URL ($3.01). Final cost is based on actual tokens used.


Endpoint: POST https://firecrawl.services.sapiom.ai/v2/batch/scrape

Scrape multiple URLs asynchronously. Returns a job ID.

ParameterTypeRequiredDescription
urlsstring[]YesURLs to scrape
proxystringNoProxy type
formatsstring[]NoOutput formats

Endpoint: GET https://firecrawl.services.sapiom.ai/v2/batch/scrape/{id} (free)

Same per-URL pricing as scrape: 1 credit base + addons per URL. You only pay for URLs actually scraped.


CodeDescription
400Invalid request — check URL and parameters
402Payment required — ensure you’re using the Sapiom SDK
429Rate limit exceeded
502Upstream Firecrawl error
import { createFetch } from "@sapiom/fetch";
const sapiomFetch = createFetch({
apiKey: process.env.SAPIOM_API_KEY,
agentName: "my-agent",
});
const baseUrl = "https://firecrawl.services.sapiom.ai";
async function scrapeArticle(url: string) {
// Scrape a single page
const response = await sapiomFetch(`${baseUrl}/v2/scrape`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url, formats: ["markdown"] }),
});
const data = await response.json();
return data.data.markdown;
}
async function crawlDocs(siteUrl: string, maxPages: number) {
// Start a crawl job
const jobRes = await sapiomFetch(`${baseUrl}/v2/crawl`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: siteUrl, limit: maxPages }),
});
const job = await jobRes.json();
console.log(`Crawl started: ${job.id}`);
// Poll for completion
let result;
do {
const statusRes = await sapiomFetch(`${baseUrl}/v2/crawl/${job.id}`);
result = await statusRes.json();
} while (result.status !== "completed" && result.status !== "failed");
console.log(`Crawled ${result.creditsUsed} pages`);
return result.data;
}
// Usage
const article = await scrapeArticle("https://blog.example.com/post");
console.log("Article:", article.substring(0, 200));
const docs = await crawlDocs("https://docs.example.com", 20);
console.log(`Got ${docs.length} pages`);

All pricing is credit-based. 1 credit = $0.009.

OperationBase CreditsAddons
Scrape1Enhanced proxy (+4), JSON format (+4)
Map1None
Searchceil(limit/10)2 + limit1Per-result: Enhanced proxy (+4), JSON (+4)
Crawllimit * 1Per-page: Enhanced proxy (+4), JSON (+4)
Extract~334 per URLNone (token-based)
Batch Scrapeurls.length * 1Per-URL: Enhanced proxy (+4), JSON (+4)
Status checksFreeN/A

Async operations (crawl, extract, batch) authorize the maximum cost upfront but only charge for actual usage.