Docs / Guide

Installation

The official Node.js / TypeScript SDK is public on npm, and the Python SDK is public on PyPI as datablue==2.1.0.

Requirements

DependencyVersion
Python>= 3.10
httpx>= 0.27.0
pydantic>= 2.0.0
Node.js>= 18.0.0

Install from npm

Example
npm install @datablue/sdk@1.1.0

Python SDK status: Version 2.1.0 is public on PyPI. Install it with pip install datablue and use from datablue import DataBlue, AsyncDataBlue.

Install from PyPI

Install from PyPI, set your DataBlue API key, and call the same methods as the REST API.

Example
from datablue import DataBlue

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

    serp = client.google_serp(
        query="best crm",
        country="US",
        results=10,
    )
    print(serp["data"])
Example
import { DataBlue } from "@datablue/sdk";

const client = new DataBlue({ apiKey: "wh_your_api_key" });
const result = await client.scrape("https://example.com");
console.log(result.data?.markdown);

const serp = await client.googleSerp({
  query: "best crm",
  country: "US",
  results: 10,
});
console.log(serp.data);

Python async support: Core methods available on DataBlue are also available on AsyncDataBlue with async signatures. Use await and async with for the async variant.

Using with AI Assistants

The SDK is fully typed and mirrors the public REST API, so AI coding assistants can generate reliable examples from the installed package types and this documentation.

Tip: Ask your assistant to use the typed SDK models and the examples on this docs page as the source of truth. The package exposes real method signatures, response models, and error types so generated code stays aligned with the API.

SDK Features

  • Sync + Async clientsDataBlue for synchronous code, AsyncDataBlue for asyncio/FastAPI/Django
  • Pydantic v2 response models — every response is a typed dataclass with autocomplete and validation
  • Automatic retries — exponential backoff on 429 and 5xx errors, configurable max retries
  • Context manager supportwith / async with for clean resource management
  • Data API methods — call google_serp() / googleSerp(), or use data_api() / dataApi() for any /v1/data endpoint
  • Job polling built-in — crawl/search blocking methods poll automatically, and native Data API jobs can be checked with get_data_job_status() / getDataJobStatus()
  • Node/TypeScript support — typed async client with camelCase options mapped to the DataBlue REST API
  • Typed error hierarchy — catch specific errors like RateLimitError, AuthenticationError, etc.
  • Environment variable config — zero-config setup with DataBlue.from_env()