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
| Dependency | Version |
|---|---|
| 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.0Install 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);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.
SDK Features
- Sync + Async clients —
DataBluefor synchronous code,AsyncDataBluefor 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 support —
with/async withfor clean resource management - Data API methods — call
google_serp()/googleSerp(), or usedata_api()/dataApi()for any/v1/dataendpoint - 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()
