Installation

Use the official SDKs for the best developer experience with Supacrawler.

JavaScript / TypeScript

pnpm add @supacrawler/js

Usage

import { SupacrawlerClient } from '@supacrawler/js'

const client = new SupacrawlerClient({ apiKey: process.env.SUPACRAWLER_API_KEY })

// Scrape example
const scraped = await client.scrape({ url: 'https://example.com', format: 'markdown' })
console.log(scraped)

// Screenshot example
const job = await client.createScreenshotJob({ url: 'https://example.com', device: 'desktop', full_page: true })
const status = await client.waitForJob(job.job_id)
if (status.status === 'completed' && 'screenshot' in (status.data || {})) {
  console.log('Screenshot URL:', (status.data as any).screenshot)
}

Python

pip

pip install supacrawler-py

Usage

from supacrawler import SupacrawlerClient, ScreenshotRequest
import os

client = SupacrawlerClient(api_key=os.environ.get('SUPACRAWLER_API_KEY'))

# Scrape example
scraped = client.scrape(ScrapeParams(url='https://example.com', format='markdown'))
print(scraped)

# Screenshot example
job = client.create_screenshot_job(ScreenshotRequest(url='https://example.com', device='desktop', full_page=True))
final = client.wait_for_job(job.job_id)
if final.status == 'completed' and final.data and hasattr(final.data, 'screenshot'):
    print('Screenshot URL:', final.data.screenshot)

Was this page helpful?