Docs / API reference

POST/v1/scrape

Scrape

Scrape a single URL and return normalized content in your requested formats.

Execution model

Live request

Runtime depends on endpoint, target, pagination, rendering mode, and active plan limits.

Credit weight

Live catalog

Current weights are managed from the Data API Weights admin table and shown on pricing before use.

Parameters

NameTypeRequirementDescription
urlstringRequiredThe URL to scrape. Protocol is auto-prepended if missing.
formatsArray<string | object>OptionalOutput formats. Strings remain supported. Object configs support markdown mode ("reader", "raw", "prune") and screenshot options: { "type": "screenshot", "capture": "viewport|full_page|after_actions", "full_page": true, "width": 1440, "height": 900 }.
only_main_contentbooleanOptionalExtract only the main content, removing navs, footers, sidebars.
mobilebooleanOptionalEmulate a mobile device viewport.
mobile_devicestringOptionalDevice preset name: "iphone_14", "pixel_7", "ipad_pro".
timeoutnumberOptionalRequest timeout in milliseconds.
wait_fornumberOptionalWait this many ms after page load before extracting.
css_selectorstringOptionalOnly extract content matching this CSS selector.
xpathstringOptionalXPath expression for targeted extraction.
include_tagsstring[]OptionalOnly include these HTML tags in extraction.
exclude_tagsstring[]OptionalExclude these HTML tags from extraction.
headersobjectOptionalCustom HTTP headers to send (e.g. { "Cookie": "session=abc" }).
cookiesobjectOptionalCustom cookies to send as name/value pairs.
actionsActionStep[]OptionalBrowser actions to perform before extraction: click, wait, scroll, type, screenshot, hover, press, select, fill_form, evaluate.
extractobjectOptionalLLM extraction config: { prompt: string, schema: JSONSchema }.
webhook_urlstringOptionalWebhook URL for job completion notification.
webhook_secretstringOptionalHMAC secret for webhook signature verification.
capture_networkbooleanOptionalCapture browser network requests/responses.

Response fields

FieldTypeDescription
data.statusstring"success", "empty", "thin", or "blocked" — the outcome classification for this result.
data.qualityobjectContent quality metrics: markdown_len, word_count, links_count, headings_count, images_count, has_title, and empty_reason (set when the result is empty/thin/blocked/skipped).
data.time_takennumberElapsed processing time in seconds for this page result.

Request and response

curl -X POST "https://api.datablue.dev/v1/scrape" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://news.ycombinator.com",
  "formats": [
    "markdown",
    "links"
  ],
  "only_main_content": true
}'
Example response
{
  "success": true,
  "data": {
    "markdown": "# Hacker News\n\n1. Show HN: I built an open-source web scraper with strategy caching\n2. Why Rust is eating the world...",
    "links": [
      "https://news.ycombinator.com/item?id=39912345",
      "https://news.ycombinator.com/item?id=39912346",
      "https://news.ycombinator.com/newest"
    ],
    "status": "success",
    "quality": {
      "markdown_len": 12340,
      "word_count": 1847,
      "links_count": 42,
      "headings_count": 8,
      "images_count": 3,
      "has_title": true,
      "empty_reason": null
    },
    "metadata": {
      "title": "Hacker News",
      "description": null,
      "language": "en",
      "source_url": "https://news.ycombinator.com",
      "status_code": 200,
      "word_count": 1847,
      "reading_time_seconds": 7,
      "content_length": 12340
    },
    "time_taken": 0.48
  }
}