serpcheap/laravel

Laravel integration for the serp.cheap Google SERP API — ServiceProvider, Facade, cached client, and an artisan command.

Maintainers

Package info

github.com/SerpCheap/serpcheap-laravel

Homepage

pkg:composer/serpcheap/laravel

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.0 2026-06-16 21:18 UTC

This package is auto-updated.

Last update: 2026-06-16 21:30:05 UTC


README

Laravel integration for the serp.cheap Google Search API — real-time Google SERP data wrapped with a ServiceProvider, Facade, cached client, and an artisan command.

It's the cheapest Google Search API we know of — $0.0003 per cached search, $0.0006 fresh, no monthly minimum (~10× cheaper than SerpApi).

Wraps the serpcheap/serpcheap PHP SDK with a ServiceProvider, a SerpCheap Facade, transparent result caching, and an artisan command.

Install

composer require serpcheap/laravel

Set your API key (get one at app.serp.cheap):

SERPCHEAP_API_KEY=your-key

The provider and SerpCheap alias are auto-discovered. To customize, publish the config:

php artisan vendor:publish --tag=serpcheap-config

Usage

use SerpCheap\Laravel\Facades\SerpCheap;

$results = SerpCheap::search('best running shoes', ['gl' => 'us']);
$page    = SerpCheap::scrape('https://example.com');
$rank    = SerpCheap::rank('example.com', 'best running shoes');

Results are cached by default (keyed by query + options) so repeat calls don't spend credits. Reach the raw, uncached SDK client when you need it:

SerpCheap::client()->searchPages('best running shoes', 1, 3);

Dependency injection

use SerpCheap\Laravel\SerpCheapManager;

public function __construct(private SerpCheapManager $serp) {}

Artisan

php artisan serpcheap:search "best running shoes" --gl=us --page=1
php artisan serpcheap:search "best running shoes" --json

Configuration

Env Default Description
SERPCHEAP_API_KEY API key (required)
SERPCHEAP_BASE_URL https://api.serp.cheap API base URL
SERPCHEAP_TIMEOUT_MS 15000 Per-request timeout
SERPCHEAP_MAX_RETRIES 2 Retry count on transient errors
SERPCHEAP_CACHE true Toggle result caching
SERPCHEAP_CACHE_STORE default store Cache store to use
SERPCHEAP_CACHE_TTL 3600 Cache TTL in seconds

License

MIT