SDK ReferenceTypeScript SDK
Client
Instantiate and configure the Bytekit TypeScript client.
Client
The Bytekit TypeScript SDK is a thin, type-safe wrapper over the REST API. Create a client with your API key, then call resource methods.
import { RapidCrawl } from '@rapidcrawl/sdk';
const client = new RapidCrawl({
apiKey: process.env.RAPIDCRAWL_API_KEY!, // sk_live_… or sk_test_…
});Options (RapidCrawlOptions)
apiKey(required) —stringbaseUrl—stringDefaults tohttps://api.bytekit.com.
Resources
The client exposes one property per resource:
client.scrape— Fetch a URL as raw HTML, clean markdown, or structured content.client.screenshots— Capture full-page or viewport screenshots.client.recordings— Generate a scrolling video of a page.client.bulk— Fan out many URLs in parallel with per-item webhooks.client.fetch— Low-latency raw HTTP fetch with optional conversion.client.monitors— Watch a URL on a schedule and webhook on change.client.sitemap— Discover URLs from a domain's sitemap or by crawling.client.account— Account info and API key management.
Errors
Any non-2xx response throws a RapidCrawlError carrying the HTTP status and the API code.
import { RapidCrawl, RapidCrawlError } from '@rapidcrawl/sdk';
try {
await client.scrape.create({ url: 'https://example.com' });
} catch (err) {
if (err instanceof RapidCrawlError) {
console.error(`${err.status} ${err.code}: ${err.message}`);
}
}