Search by

serqo-io / serqo-php

serqo-io

Official PHP client for the Serqo Search API

Package info

github.com/serqo-io/serqo-php

pkg:composer/serqo-io/serqo-php

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-10-25 02:52 UTC

This package is auto-updated.

Last update: 2026-10-25 02:55:12 UTC


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) sends POST /v1/search.
  • engines(), me(), and health() call the corresponding endpoints.
  • API failures throw Serqo\SerqoError with status, apiCode, requestId, retryable, retryAfterMs, and details properties.
  • 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.