import { DataifyClient } from "dataify-sdk";
// Initialize the client with apiKey (you can also use the DATAIFY_API_KEY environment variable)
const client = new DataifyClient({
apiKey: "your_api_key_here",
});DataifyClient constructor parameters (DataifyClientOptions):| Parameter | Description | Default |
|---|---|---|
apiKey | Dataify API token | Required |
scraperBaseUrl | Scraper / SERP base URL | https://scraperapi.dataify.com |
webUnlockerBaseUrl | Web Unlocker base URL | https://webunlocker.dataify.com |
timeoutMs | Request timeout (milliseconds) | Built-in default |
fetchImpl | Custom fetch implementation | Global fetch |
Promise; consume it with await:import { DataifyClient } from "dataify-sdk";
// Read the token from the environment (recommended in production)
const client = new DataifyClient({
apiKey: process.env.DATAIFY_API_KEY!,
});
async function main() {
// Every call returns a Promise; use await to get the result
const result = await client.tools.google({ q: "Dataify", json: "1" });
console.log(result);
}
// Top-level await is not available here, so catch errors on the promise
main().catch(console.error);client.tools and are named after the engine (for example google, bing, googleImages, googleNews). The sections below are grouped by engine.// q is the keyword; json:"1" makes the upstream return JSON instead of HTML
const result = await client.tools.google({
q: "best shoes of 2025",
json: "1",
});
console.log(result);const result = await client.tools.googleImages({
q: "noise cancelling headphones",
});
console.log(result);const news = await client.tools.googleNews({ q: "AI latest" });
const trends = await client.tools.googleTrends({ q: "fashion" });
const maps = await client.tools.googleMaps({ q: "coffee shop near me" });const result = await client.tools.bing({ q: "python tutorial" });
console.log(result);For the full list of SERP methods, see client.tools.specs.
client.tools, with lowerCamelCase method names (for example amazonProductByAsin, linkedinCompanyInformationByUrl). The sections below are grouped by platform.// Scrape a product by ASIN
const product = await client.tools.amazonProductByAsin({
asin: "B0BZYCJK89",
});
console.log(product);
// Scrape comments by product URL
const comments = await client.tools.amazonCommentByUrl({
url: "https://www.amazon.com/dp/B0BZYCJK89",
});// Scrape company information by company URL
const company = await client.tools.linkedinCompanyInformationByUrl({
url: "https://www.linkedin.com/company/example",
});
// Scrape job listings by keyword
const jobs = await client.tools.linkedinJobListingsInformationByKeyword({
keyword: "data engineer",
location: "Remote",
});const profile = await client.tools.insProfilesByUsername({ username: "nasa" });
const video = await client.tools.youtubeProductById({ videoId: "dQw4w9WgXcQ" });
const item = await client.tools.walmartProductByUrl({ url: "https://www.walmart.com/ip/..." });For every tool name (and its parameters), see client.tools.specs, or hover overclient.toolsin your IDE to see the full list and type hints.
// Unlock and scrape any web page
const result = await client.webUnlocker.request({
url: "https://example.com",
type: "html",
js_render: false, // whether to render JavaScript
});
console.log(result);client.aiWeb.| Method | Upstream endpoint | Description |
|---|---|---|
client.aiWeb.search(params) | POST /search | Search news, shopping, or academic results, with optional content extraction |
client.aiWeb.extract(params) | POST /extract | Extract Markdown, HTML, or links |
client.aiWeb.map(params) | POST /map | Discover the URLs, titles, and descriptions of a site's pages |
import { AI_WEB_UNIQUE_IDS, DataifyClient } from "dataify-sdk";
const client = new DataifyClient({
apiKey: process.env.DATAIFY_API_KEY,
aiWebBaseUrl: process.env.AI_WEB_API_BASE_URL,
});
const result = await client.aiWeb.search({
unique_id: AI_WEB_UNIQUE_IDS.searchNews,
query: "OpenAI",
source: "news",
max_results: 5,
time_range: "week",
});
console.log(result.request_id, result.outputs);const extracted = await client.aiWeb.extract({
unique_id: AI_WEB_UNIQUE_IDS.extract,
url: "https://example.com/article",
formats: ["markdown", "links"],
only_main_content: true,
timeout_ms: 60_000,
});const pages = await client.aiWeb.map({
unique_id: AI_WEB_UNIQUE_IDS.map,
url: "https://docs.example.com",
country: "US",
domain_filter: "all",
limit: 100,
sitemap: "include",
});X-Request-Id response header is exposed as result.request_id.null outputs value is normalized to [].client.aiWeb.executeRaw(...) when you need to keep the raw upstream structure.// Download the JSON result by task ID
const json = await client.scraper.downloadTaskResult("task_id_here");
console.log(json);
// Download as a file (format: xlsx / csv / json)
const response = await client.scraper.downloadTaskFile("task_id_here", "csv");
console.log(response.status);| Capability | Endpoint |
|---|---|
| Scraper / SERP | https://scraperapi.dataify.com |
| Web Unlocker | https://webunlocker.dataify.com |
Authorization: Bearer <apiKey>.dataify-sdk → Dataify APIs.ParamRecord, and return value is fully typed. In VS Code or WebStorm, hover over client.tools.amazonProductByAsin and similar symbols to see the parameters and documentation.client.tools.specs lets you introspect every tool's metadata (including params / required / id).Promise; catch errors with try/catch. The error object (network or upstream error) carries status and body fields:try {
const r = await client.tools.google({ q: "Dataify", json: "1" });
console.log(r);
} catch (e: any) {
// The error object carries status (HTTP status code) and body (response body)
console.error("HTTP", e?.status, "body:", e?.body ?? e?.message);
}import { DataifyClient } from "dataify-sdk";
// 1) Initialize the client with the token from the environment
const client = new DataifyClient({
apiKey: process.env.DATAIFY_API_KEY!,
});
async function main() {
// 2) SERP: Google Search
const result = await client.tools.google({
q: "Dataify",
json: "1",
});
console.log(result);
// 3) Platform scraper: Amazon product by ASIN
const product = await client.tools.amazonProductByAsin({
asin: "B0BZYCJK89",
});
console.log(product);
}
main().catch(console.error);| Resource | Description | Link |
|---|---|---|
| 📘 GitHub repository | Browse the source, try the examples, and contribute | GitHub |
| 📦 npm page | Package listing and release history | dataify-sdk |