spidra-django) brings the full Spidra API into Django as a proper installed app: configure credentials in settings.py, include ready-made URL patterns in urls.py, receive webhook events as native Django Signals, and run scraping tasks from the terminal with python manage.py spidra_* management commands.
Installation
Get your API key from app.spidra.io under API Keys.
Store it in an environment variable and reference it from
settings.py. Never hardcode it.Setup
1. Add to INSTALLED_APPS
2. Configure in settings.py
Using the client
spidra-django exports a global spidra proxy that is ready to use anywhere in your project without passing configuration around:
get_spidra() and get_async_spidra():
Scraping
Extract markdown or structured JSON from any URL, with browser rendering, CAPTCHA bypass, and residential proxies:spidra_json_response() recursively serializes Spidra dataclasses and returns a JsonResponse. It accepts the same arguments as Django’s JsonResponse, including status.
Searching
sources: "web", "news", "images", "videos", "research", "developer". Defaults to ["web"].
Crawling
Mapping
Batch scraping
Parsing documents
Async views
Django 4.1+ supports nativeasync def views. Use spidra.async_client for non-blocking calls:
Webhooks
Spidra sends signed webhook events to your endpoint. Use@spidra_webhook_required to verify HMAC-SHA256 signatures automatically:
SPIDRA_WEBHOOK_SECRET from settings, verifies X-Spidra-Signature against the raw body, and returns a 401 response if the signature is invalid.
Django Signals
spidra-django dispatches a native Django Signal — spidra_webhook_received — whenever a verified webhook event is received through the built-in URL routes:
@receiver decorator:
Event listeners
Alternatively, register listeners on thespidra proxy object. These fire when spidra.dispatch_event() is called manually from your own webhook endpoint:
Built-in URL routing
Include the pre-built URL patterns to expose a complete Spidra REST API without writing any views:Management commands
spidra-django adds management commands for automation scripts, cron jobs, and debugging:
Error handling
All Spidra exceptions inherit fromSpidraError and are re-exported from spidra_django:
Flask
Flask extension with Blueprint routing,
flask spidra CLI, and HMAC webhook decorator.FastAPI
Native async-first integration with dependency injection, Pydantic models, and OpenAPI docs.

