Docs / Guide

Python SDK

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

Install

Example
pip install datablue==2.2.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(), get_crawl_status(), cancel_crawl()Crawl a site synchronously or manage an asynchronous crawl job.
search(), start_search(), get_search_status()Run web search synchronously or manage an asynchronous search job.
map()Discover URLs from a site without scraping every page.
extract()Start schema-guided extraction for one or more URLs.
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.
get_usage_summary() / get_usage_stats() / get_usage_history()Inspect plan and credit usage, aggregate activity, and filtered job history.
create_schedule() / create_monitor()Automate recurring requests and monitored pages.
list_webhooks() / list_proxies()Inspect delivery history and account proxy configuration.

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.