Skip to content

Web Scraping API Documentation

From a URL to usable data. Start with one request, then add structured extraction, browser rendering or background jobs.

On this page

Base URL

https://api.finedata.ai

Quick Start

Create an account, copy your API key from the dashboard, and replace fd_your_api_key below. This request reads a public page and returns markdown.

curl

curl -X POST https://api.finedata.ai/api/v1/scrape \
  -H "Content-Type: application/json" \
  -H "x-api-key: fd_your_api_key" \
  -d '{"url": "https://example.com", "formats": ["markdown"]}'
Python · requests

Install with pip install requests. Run on your server, not in a public client.

import requests

resp = requests.post(
    "https://api.finedata.ai/api/v1/scrape",
    headers={"x-api-key": "fd_your_api_key"},
    json={"url": "https://example.com", "formats": ["markdown"]},
    timeout=130,
)
resp.raise_for_status()
data = resp.json()
if data["success"] is False:
    raise RuntimeError(data)
print(data["data"]["markdown"])
JavaScript · Node.js 18+

Run as an ES module on your server. Never expose your API key in browser code.

const resp = await fetch("https://api.finedata.ai/api/v1/scrape", {
  method: "POST",
  headers: { "Content-Type": "application/json", "x-api-key": "fd_your_api_key" },
  body: JSON.stringify({ url: "https://example.com", formats: ["markdown"] })
});
if (resp.ok === false) throw new Error(await resp.text());
const data = await resp.json();
if (data.success === false) throw new Error(JSON.stringify(data));
console.log(data.data.markdown);

Authentication

All requests require one of:

API Key (recommended)

curl -X POST https://api.finedata.ai/api/v1/scrape \
  -H "x-api-key: fd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","formats":["markdown"]}'

JWT Bearer Token

curl -X POST https://api.finedata.ai/api/v1/scrape \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","formats":["markdown"]}'

Token Pricing

Tokens are API usage credits, not LLM input tokens. A default request uses 3: 1 base + 2 for TLS fingerprinting. Failed scrapes are not billed. Add one rendering mode and any routing, extraction or action costs you need.

1
Base request
+2
Antibot (TLS)
+5
JS Render
+7
Stealth Antibot
+15
Stealth New
+25
Stealth Headful
+20
Stealth Premium
+30
Premium Headful
+2
ISP
+5
AI extraction
+2
Per browser action
+3
Residential
+4
Mobile
+10
Captcha
+1
Per retry
+1
BYOP (own proxy)
+0
Geo-targeting
Examples: HTTP with use_antibot: false = 1 · With antibot = 3 · JS render = 8 · Stealth + residential = 13 · Stealth Headful = 28
Examples assume no retries or extraction. A domain-specific strategy may change the engine or routing: use the response's tokens_used as the actual charge. A Google SERP request is a flat 10 tokens, reported as tokens_charged; a blocked or empty Google response is not billed and gl, hl and start do not change the price.

Scrape Endpoint

POST /api/v1/scrape

Send a JSON body with a target URL and get the page back as markdown, text, HTML or extracted JSON. Add only the options your page needs.

{
  "url": "https://example.com",
  "formats": ["markdown"],
  "only_main_content": true
}

Every option, the response fields and how to read them: Scrape API reference →

Google SERP

POST /api/v1/serp

Run a Google search server-side and get organic results, ads and answer blocks as JSON for a flat 10 tokens. The permitted case is SEO and SERP tracking for your own domains under the Acceptable Use Policy.

curl -X POST https://api.finedata.ai/api/v1/serp \
  -H "Content-Type: application/json" \
  -H "x-api-key: fd_your_api_key" \
  -d '{"q": "rank tracking tool", "gl": "us", "hl": "en", "start": 0}'

Parameters, the response shape, billing and errors: Google SERP API reference →

Output Formats

Use the formats array to control what appears in data.

Format Returns Best for
markdownClean MarkdownLLM input, content extraction
textPlain textSearch indexing, NLP
rawHtmlHTML in data.raw_htmlHTML parsing
linksArray of URLsCrawling, link analysis
screenshotBase64 PNG; requires browser renderingVisual verification
csvCSV string in data.csvAI extraction to a table (sync only)
xlsxBase64 workbook in data.xlsxAI extraction to a spreadsheet (sync only)

PDF and other files

A URL that returns a PDF is handled like a page: markdown and text contain the document's extracted text (pages marked with <!-- page N -->), data.metadata has title and pdf_pages, and the original file stays in body as base64 with data.content_type set to application/pdf. Links that trigger a download work in every mode, including the stealth and browser modes.

  • Only the PDF's text layer is extracted. Scanned PDFs (images of pages) return empty text and metadata.pdf_text_empty: true; OCR is not supported.
  • Up to 500 pages are converted; longer files set metadata.pdf_pages_truncated_at. A file that cannot be parsed sets metadata.pdf_error and is still returned in body.
  • Other binary files (images, archives) are returned as base64 in body with data.content_type. With raw_output: true and no text format you get the raw bytes.

Content without the wrapper

REST returns raw HTML in body if you omit formats. Request a format explicitly. For content-only output, add raw_output: true with exactly one format.

{
  "url": "https://example.com",
  "formats": ["markdown"],
  "raw_output": true
}

The response is markdown, not JSON. Metadata moves to X-Tokens-Used, X-Request-Id and X-Status-Code headers. CSV/XLSX require extract_prompt or extract_schema; use the synchronous endpoint for these exports.

AI Extraction

Extract with CSS/XPath selectors (no extra extraction fee) or AI (+5 tokens). AI-only results are in data.extract; when combined with selector results, AI data is nested under data.extract.ai_extract. These product URLs and selectors are illustrative.

CSS Selectors (no extra fee)

{
  "url": "https://example.com/product",
  "extract_rules": {
    "title": "h1",
    "price": ".product-price",
    "images": {"selector": "img.product-image", "type": "list", "output": "@src"}
  }
}

AI with Natural Language (+5 tokens)

{
  "url": "https://example.com/product",
  "formats": ["markdown"],
  "extract_prompt": "Extract product name, price, rating, and availability"
}

AI with JSON Schema (+5 tokens)

{
  "url": "https://example.com/product",
  "extract_schema": {
    "type": "object",
    "properties": {
      "name": {"type": "string"},
      "price": {"type": "number"},
      "in_stock": {"type": "boolean"}
    }
  }
}

For AI extraction, ai_content_mode: "full" is the default and includes sidebars and structured data. Use "main" for article-focused extraction. Check extracted fields against your application's requirements before relying on them.

Render, wait, then extract

For JavaScript pages, wait for the content you need rather than adding an arbitrary delay. This illustrative sequence expands a product description before extraction; replace the URL and selectors with your page's.

{
  "url": "https://example.com/product",
  "use_js_render": true,
  "js_wait_for": "selector:.product",
  "js_actions": [
    {"action": "click", "selector": ".expand-description"},
    {"action": "wait_for", "selector": ".description-expanded"}
  ],
  "extract_prompt": "Extract the product name and full description"
}

Up to 10 actions: click, wait, wait_for, scroll, type, hover, screenshot, evaluate. Browser interactions can change the target site: use only actions you are authorized to perform.

Async & Batch Scraping

Background processing for large-scale scraping or slow pages.

POST /api/v1/async/scrape

Submit a job, get job_id immediately. Use webhook or poll for results.

{
  "url": "https://example.com",
  "formats": ["markdown"]
}
GET /api/v1/async/jobs/{job_id}

Poll status: pending, processing, completed, failed, cancelled

GET /api/v1/async/jobs

List your jobs with pagination

DELETE /api/v1/async/jobs/{job_id}

Cancel a pending job. A processing job cannot be cancelled and returns HTTP 400.

POST /api/v1/async/batch

Submit up to 100 URLs in one request

Submit a batch and collect results

POST this body to /api/v1/async/batch. REST uses requests, an array of request objects; the MCP batch_scrape tool uses urls instead.

{
  "requests": [
    {"url": "https://example.com", "formats": ["markdown"]},
    {"url": "https://example.org", "formats": ["markdown"]}
  ]
}

Save the returned batch_id. Poll with a delay between requests, adding include_results=true to retrieve individual results.

curl "https://api.finedata.ai/api/v1/async/batch/YOUR_BATCH_ID?include_results=true" \
  -H "x-api-key: fd_your_api_key"

Stop polling at completed, partial or failed. For a single job, terminal states are completed, failed and cancelled; completed output is in result.data. An optional callback_url notifies your public endpoint when work finishes.

Captcha Solving

Set solve_captcha: true to auto-detect and solve (+10 tokens).

reCAPTCHA v2/v3hCaptchaCloudflare TurnstileYandex SmartCaptchaFunCaptchaGeeTest

TLS Profiles

Set tls_profile to mimic a browser fingerprint.

Chrome

chrome136 (default)chrome131chrome124chrome123chrome120

Firefox · Safari · Mobile

firefox133safari184safari18_0safari17_0chrome131_androidsafari18_0_ios

VIP (Premium auto-rotate)

vipvip:iosvip:androidvip:windowsvip:mobile

Proxy & Geo-Targeting

Geo-Targeting

Set proxy_country to an ISO-2 country code to request a proxy exit IP from that country. Works with datacenter, residential, ISP, and mobile proxies at no extra cost. Returns 422 if the country isn't currently supported for the resolved proxy type.

{
  "url": "https://example.com",
  "use_residential": true,
  "proxy_country": "DE"
}

Bring Your Own Proxy (BYOP)

Save your own proxy list as a profile in the dashboard, then reference it with proxy_profile_id. Proxies are encrypted at rest. BYOP charges a flat +1 token instead of the vendor proxy surcharge, and is mutually exclusive with use_residential / use_isp / use_mobile / proxy_country.

{
  "url": "https://example.com",
  "proxy_profile_id": 42,
  "proxy_sticky": true
}

Available on PAYG, Team S/M/L and Scaling, or with an account override. Combine with proxy_sticky: true to keep the same exit IP for an entire browser session — useful for anti-bot flows where warmup and API calls must share one IP.

Error Codes

These are API HTTP errors. Inspect the response's detail for the cause. A target-page failure can instead arrive in a scrape result with success: false; inspect its status_code and metadata before retrying.

Code Description Action
401 Invalid or missing API key / JWT token Check your API key
402 Payment required Upgrade plan or pay invoices
403 Account or feature access denied Read the error; check plan, scopes or account status
422 Validation error Check request parameters
429 Rate limit exceeded Reduce request frequency; respect Retry-After when present
500 Internal server error Retry or contact support
503 Service unavailable Retry after a moment

MCP Integration

Connect FineData to Claude Desktop, Cursor IDE, and other AI agents via MCP (v0.3.2). Full setup, tool reference, OAuth sign-in and cost guidance: the MCP server page. Tools: scrape_url (GET), send_http_request (POST/PUT/PATCH/DELETE), scrape_async, get_job_status, cancel_job, list_jobs, batch_scrape, get_batch_status, get_usage. Start with a default request. Add rendering or routing only when the page needs it; use the tool's error hints rather than enabling the most expensive mode by default.

{
  "mcpServers": {
    "finedata": {
      "command": "npx",
      "args": ["-y", "@finedata/mcp-server"],
      "env": { "FINEDATA_API_KEY": "fd_your_api_key" }
    }
  }
}

Remote (Streamable HTTP):

{
  "mcpServers": {
    "finedata": {
      "url": "https://mcp.finedata.ai/mcp",
      "headers": { "Authorization": "Bearer fd_your_api_key" }
    }
  }
}

Rate Limits

Plan Requests/second Tokens/month Overage
Free Trial 5 10,000 Blocked
Free 2 1,000 Blocked
PAYG 10 Unlimited $0.55/1K
Personal 20 100,000 $0.55/1K
Team S 50 1,000,000 $0.55/1K
Team M 100 3,000,000 $0.55/1K
Team L 200 5,000,000 $0.55/1K
Scaling 400 10,000,000 $0.55/1K

Free plans block when exhausted. Paid plans allow overage at $0.55/1K tokens.