API Documentation
Web Scraping API
Complete reference for the ScrapeBadger Web Scraping API
Getting Started
Install the ScrapeBadger SDK for your preferred language:
pip install scrapebadgerAuthentication
All API requests require an API key. Send it in the X-API-Key header:
from scrapebadger import ScrapeBadger
client = ScrapeBadger(api_key="your_api_key_here")Scrape
Scrape HTML content from any URL with optional JavaScript rendering:
result = await client.web.scrape(
"https://example.com",
render_js=True,
format="markdown",
)
print(result.status_code)
print(result.content)Screenshot
Capture screenshots of web pages:
result = await client.web.scrape(
"https://example.com",
render_js=True,
screenshot=True,
)
print(result.screenshot_url)AI Extract
Extract structured data using AI:
result = await client.web.extract(
"https://example.com/product",
"Extract the product title, price and availability",
)
print(result.ai_extraction)Rate Limits
Free: 5 requests/min. Starter and Growth: 300/min. Pro and Scale: 10,000/min. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset — read those rather than hard-coding a rate, and honour Retry-After on a 429.