serqo-io / serqo-php
Official PHP client for the Serqo Search API
v0.1.0
2026-10-25 02:52 UTC
Requires
- php: >=8.1
- ext-curl: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Official PHP client for the Serqo Search API. Requires PHP 8.1 or later and the cURL extension.
Install
composer require serqo-io/serqo-php
Quick start
<?php require __DIR__ . '/vendor/autoload.php'; use Serqo\Client; $client = new Client(getenv('SERQO_API_KEY')); $response = $client->search([ 'q' => 'espresso machines', 'engine' => 'google', 'type' => 'web', 'gl' => 'us', 'hl' => 'en', ]); foreach ($response['data']['results'] as $result) { echo $result['title'] ?? '', PHP_EOL; }
Keep the API key in server-side configuration. Methods return the full response envelope as associative arrays.
Methods and errors
search($query, $idempotencyKey = null)sendsPOST /v1/search.engines(),me(), andhealth()call the corresponding endpoints.- API failures throw
Serqo\SerqoErrorwithstatus,apiCode,requestId,retryable,retryAfterMs, anddetailsproperties. - Searches are not retried automatically. Reuse the same idempotency key only for identical parameters.
- See the shared API reference for all search parameters, response fields, and pagination behavior.