Python SDK
DataBlue / 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

pip install datablue==2.1.0

Sync Client

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

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

Method Use
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.
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.

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"])

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