Skip to main content
The Spidra Laravel package (spidra/spidra-laravel) brings AI-powered web intelligence directly into Laravel:
  • Laravel Auto-Discovery: Automatically registers SpidraServiceProvider and the Spidra Facade.
  • Config Publishing: Configurable via config/spidra.php and .env.
  • Spidra Facade & spidra() Helper: Ergonomic syntax for controllers, queue jobs, Artisan commands, and Blade templates.
  • Dependency Injection: Inject Spidra\SpidraClient or Spidra\Laravel\SpidraManager anywhere in your application.
  • HMAC Webhook Routing & Events: One-line Route::spidraWebhooks() macro with automatic HMAC signature verification and SpidraWebhookReceived event dispatching.
  • Full API Surface: Web Scraping, Recursive Crawling, SERP Search, Batch Scraping, Document Parsing, Domain Mapping, Turnkey Templates, Presets, and Monitors.

Installation

Install the package via Composer:
Publish the configuration file:
This creates config/spidra.php.
Get your API key from app.spidra.io under API Keys. Store it in your .env file.

Configuration

Set your Spidra credentials in .env:

Quickstart

1. In a Controller using the Facade

2. In a Route Closure

3. In a Queueable Job

4. Using the spidra() Helper

Complete Spidra Features Guide

1. Scraping with Browser Actions & Proxies

Handle JavaScript-heavy SPAs, dynamic tables, and login screens using residential proxies:

2. Deep Site Crawling

Initiate recursive domain crawls with depth controls, path filters, and webhook callbacks:
Query web, news, and images to ground AI models with fresh web data:

4. High-Throughput Batch Scraping

Scrape multiple independent URLs concurrently in a single batch job:
Discover all discoverable URLs across a domain without downloading full page bodies:

6. Document Parsing (PDF, Word, Excel, PPTX)

Extract clean markdown and tables from remote URLs or local document files:

7. Turnkey AI Templates & Scheduled Monitors

Execute pre-tuned extraction templates and schedule automated website monitors:

Webhook Handling & Laravel Events

Spidra sends asynchronous webhooks upon completion of crawl jobs, batch scrapes, or monitor alerts.

1. Register Webhook Route

In routes/api.php or routes/web.php:
If registered inside routes/web.php, add spidra/* to the $except array in app/Http/Middleware/VerifyCsrfToken.php or bootstrap/app.php (Laravel 11+).

2. Listen to Webhook Events

When a verified webhook arrives, SpidraWebhookReceived is automatically dispatched. Create a listener:
In app/Listeners/HandleSpidraWebhook.php:
In app/Providers/EventServiceProvider.php (or auto-discovered in Laravel 11+):

Error Handling

All Spidra exceptions are strongly typed:

Testing & Mocking

Test your controllers and jobs using the Spidra facade mock:

PHP SDK

Core PHP client library with Guzzle for vanilla PHP applications.

FastAPI SDK

High-performance async Python integration with FastAPI.