Lightning-fast web scraping Python SDK - 11x faster than traditional scrapers
Project description
browsernative
Python client for the Browser Native web scraping API
Lightweight client for scraping, screenshots, and AI analysis via the Browser Native API. Single dependency (requests).
Install
pip install browsernative
Get an API key at bnca.monostate.ai.
Usage
from browsernative import BrowserNativeClient
client = BrowserNativeClient('your-api-key')
# Scrape
result = client.scrape('https://example.com')
# Force a specific scraping method
result = client.scrape('https://example.com', method='lightpanda')
# Screenshot
screenshot = client.screenshot('https://example.com')
# Quick screenshot (faster, no content extraction)
quick = client.quickshot('https://example.com')
# AI Q&A
answer = client.analyze('https://example.com', 'What is this site about?')
Convenience functions
from browsernative import quick_scrape, quick_shot, quick_analyze, bulk_scrape
content = quick_scrape('https://example.com', 'your-api-key')
shot = quick_shot('https://example.com', 'your-api-key')
answer = quick_analyze('https://example.com', 'What is this?', 'your-api-key')
Bulk scraping
urls = ['https://site1.com', 'https://site2.com', 'https://site3.com']
result = client.bulk_scrape(
urls,
concurrency=5,
continue_on_error=True,
progress_callback=lambda p: print(f"{p['percentage']:.1f}%"),
)
print(f"{result['stats']['successful']}/{result['stats']['total']} succeeded")
Context manager
with BrowserNativeClient('your-api-key') as client:
result = client.scrape('https://example.com')
# Session closed automatically
API Reference
Client options
client = BrowserNativeClient(
api_key='your-api-key',
base_url='https://bnca-api.fly.dev', # API endpoint
timeout=30, # Seconds
retries=2, # Retry attempts
verbose=False, # Debug logging
)
Methods
| Method | Description |
|---|---|
scrape(url, **opts) |
Extract structured content |
screenshot(url, **opts) |
Screenshot with content extraction |
quickshot(url, **opts) |
Fast screenshot only |
analyze(url, question, **opts) |
AI-powered Q&A |
bulk_scrape(urls, **opts) |
Scrape multiple URLs concurrently |
get_usage(days=30) |
Account usage statistics |
health_check() |
API health status |
Scrape options
Pass as keyword arguments:
method--'auto','direct','lightpanda', or'puppeteer'include_screenshot-- Include screenshot in responsewait_for_selector-- CSS selector to wait foruser_agent-- Custom user agent
Response shape
{
'success': True,
'data': { 'title': ..., 'content': ..., ... },
'responseTime': 1234,
'attempt': 1,
}
Requirements
- Python 3.9+
requests(installed automatically)
Changelog
See CHANGELOG.md.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file browsernative-2.0.0.tar.gz.
File metadata
- Download URL: browsernative-2.0.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29f97c808f455a6ecf64a9d8d639da52996d6ece30b32ccd49cc083db9bc851d
|
|
| MD5 |
ab8e73f71f3bf3770a6a7b439f2e2b17
|
|
| BLAKE2b-256 |
5b6d60244d4d49c6ce7086cc6e3677b4687fd8d41c4457d8ebbf9e36e2171b61
|
File details
Details for the file browsernative-2.0.0-py3-none-any.whl.
File metadata
- Download URL: browsernative-2.0.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebf8bf07976167fe01f6dab507de474b0514dfafbba16e9834bf7ef17a414fe7
|
|
| MD5 |
03b103f632e0798a67d638ed4e902a94
|
|
| BLAKE2b-256 |
8ecd276d85f048695e35e0599c5585d81efae10aeeb88addf3b88bc6202bae94
|