Docs / Guide

First Request

Make one scrape request and verify its markdown, links, images, and metadata.

Before You Begin

  • For cURL, install curl and optionally jq. For Python, install requests. JavaScript examples use the built-in fetch available in Node.js 18 and newer.
  • Use a public URL that can be opened without signing in. This guide uses https://example.com for predictable output.
  • Keep your API key in an environment variable. Do not paste it directly into source files.

Step 1: Create an Account

Create an account at datablue.dev or register via the API:

Example
curl -X POST "https://api.datablue.dev/v1/auth/register" \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "YourStrongPassword1", "name": "Your Name"}'

Step 2: Generate an API Key

Log into the Dashboard and navigate to API Keys. Click Create New Key to generate a persistent API key with the wh_ prefix.

Step 3: Configure Your Shell

Example
export DATABLUE_API_KEY="wh_your_api_key"
export DATABLUE_BASE_URL="https://api.datablue.dev/v1"

test -n "$DATABLUE_API_KEY" && echo "DataBlue credentials are available"

Step 4: Make Your First Request

curl --fail-with-body --silent --show-error \
  -X POST "$DATABLUE_BASE_URL/scrape" \
  -H "Authorization: Bearer $DATABLUE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["markdown", "links", "images"]
  }'
Example response
{
  "success": true,
  "data": {
    "markdown": "# Example Domain

This domain is for use in illustrative examples.",
    "links": ["https://www.iana.org/domains/example"],
    "images": []
  }
}

Understand every value in this request

ValueRequiredMeaning
POST /v1/scrapeYesProcesses one known URL and returns the requested page outputs directly.
AuthorizationYesSends your API key as a Bearer credential. Keep this request on a trusted backend, worker, terminal, or server runtime.
Content-TypeYesDeclares that the request body is JSON.
urlYesThe public page DataBlue should retrieve and process.
formatsNoSelects the output fields. This example requests markdown, links, and images.

Additional Scrape controls

OptionTypeUse it when
only_main_contentbooleanYou want the primary readable region without navigation, footer, or sidebar content.
timeoutnumberYou need to set the maximum request time in milliseconds.
wait_fornumberThe page reveals necessary content shortly after load.
mobile / mobile_deviceboolean / stringYou need the page's mobile layout or a supported device preset.
css_selector / xpathstringYou want to target one known part of the document.
include_tags / exclude_tagsstring[]You need tag-level control over retained markup.
headers / cookiesobjectAn authorized source requires request-specific headers or cookies.
actionsobject[]The browser must click, wait, scroll, type, hover, press, select, fill a form, evaluate, or capture before extraction.
extractobjectYou want prompt- or schema-guided structured extraction with the page result.
capture_networkbooleanYou explicitly need supported browser network capture.
webhook_url / webhook_secretstringYour integration uses the documented completion notification flow.
Example Response
Example
{
  "success": true,
  "data": {
    "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...",
    "links": ["https://www.iana.org/domains/example"],
    "images": [],
    "metadata": {
      "title": "Example Domain",
      "language": "en",
      "source_url": "https://example.com",
      "status_code": 200,
      "word_count": 28
    }
  }
}

Response anatomy

FieldTypeHow to use it
successbooleanConfirms whether the API operation succeeded. Also check the HTTP status before reading page data.
data.markdownstringLLM-ready readable content when markdown was requested.
data.htmlstringNormalized markup when html was requested.
data.raw_htmlstringOriginal page markup when raw_html was requested.
data.linksarrayDiscovered page links when links was requested.
data.imagesarrayImage records and available labels when images was requested.
data.headingsarrayThe document outline when headings was requested.
data.structured_dataobject / arrayEmbedded structured metadata when requested and available.
data.screenshotstringThe screenshot result when screenshot output was requested.
data.metadataobjectSource URL, title, language, source status, word count, reading time, and content length when available.
data.statusstringClassifies the public content result as successful, empty, thin, or blocked.
data.qualityobjectContains public content counts and an empty reason when the result is not usable.
data.time_takennumberMeasured page-processing time in seconds for this request.
Output fields are conditional. Your integration should require the fields it requested, tolerate documented optional metadata, and avoid assuming every format appears when it was not requested.

Step 5: Inspect the Response Safely

Save the complete response during development so filters do not hide useful errors.

Example
curl --fail-with-body --silent --show-error \
  -X POST "$DATABLUE_BASE_URL/scrape" \
  -H "Authorization: Bearer $DATABLUE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["markdown", "links", "images"]
  }' | tee scrape-response.json

jq '.success' scrape-response.json
jq '.data.metadata' scrape-response.json
jq -r '.data.markdown' scrape-response.json
jq '.data.links | length' scrape-response.json
jq '.data.images | length' scrape-response.json

Turn success into a shell assertion

Example
jq -e '.success == true and (.data.markdown | length > 0)' \
  scrape-response.json > /dev/null \
  && echo "Scrape succeeded" \
  || echo "Scrape failed or returned no markdown"

Select Only the Outputs You Need

FormatReturned fieldUse it for
markdowndata.markdownLLM context, indexing, reading, summarization, and document pipelines
htmldata.htmlNormalized HTML when structure and markup remain important
raw_htmldata.raw_htmlSource-level inspection and custom parsing
linksdata.linksDiscovery, graph building, and follow-up requests
imagesdata.imagesImage URLs, alt text, and visual-content inventory
headingsdata.headingsOutline reconstruction and section-aware processing
structured_datadata.structured_dataJSON-LD, Open Graph, and other embedded structured metadata
screenshotdata.screenshotVisual evidence, QA, and rendered-page archives
Large formats increase response size. Request raw_html or screenshots only when the consumer actually needs them.

Request a full-page screenshot

Example
curl --fail-with-body --silent --show-error \
  -X POST "$DATABLUE_BASE_URL/scrape" \
  -H "Authorization: Bearer $DATABLUE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": [
      "markdown",
      {
        "type": "screenshot",
        "capture": "full_page",
        "full_page": true,
        "width": 1440,
        "height": 900
      }
    ]
  }' > screenshot-response.json

Reader Content and Full-Page Content

only_main_content chooses focused reading content or broader page content.

GoalRecommended settings
Articles, guides, and LLM contextonly_main_content: true with markdown mode reader
Navigation, headers, footers, and complete page contextonly_main_content: false with markdown mode raw
Smaller relevance-focused markdownMarkdown mode prune
Example
curl --fail-with-body --silent --show-error \
  -X POST "$DATABLUE_BASE_URL/scrape" \
  -H "Authorization: Bearer $DATABLUE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "only_main_content": false,
    "formats": [
      {"type": "markdown", "mode": "raw"},
      "links",
      "images"
    ]
  }'

Common First-Request Failures

The request returns 401

Check the environment variable, Bearer header, and key status. Then test GET /v1/auth/me.

The request returns 422

The JSON body failed validation. Confirm that url is a string, formats is an array, and the request uses Content-Type: application/json.

The response is successful but a field is absent

Optional fields may be absent. Check the requested formats before treating that as an error.

The page returns little or no useful content

Check data.metadata, public reachability, content mode, and wait_for.

The request times out

Use a stable page and request only the outputs you need. See Production Readiness for retries.

Move From Test to Integration