Docs / Guide

Python SDK

The official DataBlue Python SDK is published on PyPI as datablue==2.1.0. It provides sync and async clients for scraping, crawling, search, map, extraction, and documented Data APIs.

Install

Example
pip install datablue==2.1.0

Sync Client

Example
from datablue import DataBlue

with DataBlue(api_key="wh_your_api_key") as client:
    page = client.scrape("https://example.com", formats=["markdown", "links"])
    print(page.data.markdown)

    serp = client.google_serp(
        query="best crm software",
        country="US",
        results=10,
    )
    print(serp["data"])

Async Client

Example
from datablue import AsyncDataBlue

async with AsyncDataBlue(api_key="wh_your_api_key") as client:
    result = await client.scrape("https://example.com")
    print(result.data.markdown)

Core Methods

MethodUse
scrape()Fetch one URL with markdown, HTML, links, screenshot, or extraction options.
crawl() / start_crawl()Crawl a site synchronously or start a job and poll status.
search()Run web search and return results through DataBlue.
map()Discover URLs from a site without scraping every page.
data_api()Call documented /v1/data/* endpoints with current params.
get_data_job_status()Poll native Data API async jobs returned with job_id and status_url.
google_serp()Convenience helper for the documented Google SERP endpoint.

Data APIs

Use named helpers for stable documented APIs, or use data_api() when you want the SDK to follow the live docs without waiting for a new SDK release.

Example
from datablue import DataBlue

with DataBlue(api_key="wh_your_api_key") as client:
    products = client.data_api(
        "amazon/products",
        query="wireless mouse",
        domain="amazon.com",
        num_results=10,
    )
    print(products["data"])

When a heavy Data API returns a queued job, use the returned job_id with the status helper.

Example
job = client.amazon_store(url="https://www.amazon.com/stores/example")
status = client.get_data_job_status(job["job_id"])
print(status["status"])

Compatibility: New code should import from datablue. The published wheel also includes the legacy webharvest import path for existing users.