Getting started
The NodeJS SDK accepts both camelCase and snake_case for all parameters. Use snake_case if you’re building for AI agents, it matches the API’s native field names.
Usage
Scraping
Scrape a single URL with various options:Batch Processing
Process multiple URLs in a single batch:Crawling
Crawl an entire website:Site Mapping
Generate a sitemap of URLs from a website:AI-Powered Answers
Get answers from web pages using AI:Content Retrieval
Retrieve previously scraped content:Advanced Options
Custom Actions
Perform browser actions before scraping:Geographic Location
Scrape from different countries using predefined country codes or any valid country code string:Caching
By default, every scrape request fetches the page fresh (max_age: 0). Pass maxAge to reuse a recent result with the same parameters and improve response time. Value is in seconds; the maximum is 7 days (604800). See Caching for details.
Storage
By default, a scrape result is kept for about 7 days. Passstorage.expires_in as 10d, 30d, 60d, 90d, 180d, 365d, or never to keep it longer. See Storage for details.
LLM Extraction
Extract structured data using LLMs:Client Configuration
Feature highlights
- Async-first client with full TypeScript support.
- Type-safe inputs using TypeScript enums and interfaces (Formats, Countries, Actions, etc.).
- Rich resource namespaces with both shorthand calls (
client.scrapes.create()) and explicit methods (client.scrapes.get()). - Shared transport layer with retries, timeouts, and JSON decoding.
- Comprehensive error hierarchy