Node SDK
The official @datablue/sdk package is a typed async SDK for Node.js, TypeScript, and modern JavaScript runtimes.
It defaults to https://api.datablue.dev and sends your API key as a Bearer token.
Install
npm install @datablue/sdk
Scrape
import { DataBlue } from "@datablue/sdk";
const client = new DataBlue({ apiKey: "wh_your_api_key" });
const result = await client.scrape("https://example.com", {
formats: ["markdown", "links"],
});
console.log(result.data?.markdown);
Extract with Gemini
const result = await client.scrape("https://example.com/pricing", {
formats: ["markdown"],
extract: {
provider: "gemini",
prompt: "Extract pricing tiers",
schema: {
type: "object",
properties: {
tiers: {
type: "array",
items: {
type: "object",
properties: {
name: { type: "string" },
price: { type: "string" },
},
},
},
},
},
},
});
console.log(result.data?.extract);
Crawl and Map
const crawl = await client.crawl("https://docs.example.com", {
maxPages: 20,
maxDepth: 2,
scrapeOptions: { formats: ["markdown"] },
});
const urls = await client.mapUrl("https://docs.example.com", {
limit: 100,
});
console.log(crawl.status, urls.links.length);
Configuration
| Option | Default | Description |
|---|---|---|
apiUrl | https://api.datablue.dev | Base URL of the DataBlue API |
apiKey | — | API key with wh_ prefix |
timeout | 60000 | Request timeout in milliseconds |
maxRetries | 3 | Max retries on transient network and server errors |