Documentation

Choose a search API below. Each page has its own examples and field reference; authentication and account endpoints are covered here.

OpenAPI specification: Download YAML

Base URL: https://api.serqo.io

Search APIs

Google

Bing

Before you start

Create an API key in the console, then set SERP_API_KEY to your key.

bash
export SERP_API_KEY='YOUR_API_KEY'

Authentication

Pass your API key in the x-api-key header. Keys are created in the console and shown only once.

http
x-api-key: YOUR_API_KEY

Do not put keys in URL query strings. Keep them server-side.

Official client SDKs

Integrate Serqo directly into your applications using our official language clients:

LanguagePackage & InstallQuick start
JavaScript / TypeScriptnpm install serqo-sdkimport { Serqo } from 'serqo-sdk';
Pythonpip install serqofrom serqo import Serqo
PHPcomposer require serqo-io/serqo-phpuse Serqo\Client;
Gogo get github.com/serqo-io/serqo-goimport "github.com/serqo-io/serqo-go"
Javaio.serqo:serqo-javaimport io.serqo.sdk.SerqoClient;
Rubygem install serqorequire 'serqo'

Use with AI coding assistants (Cursor, Claude, Copilot)

Give your AI assistant the exact specifications, official SDK patterns, and parsing rules to implement search features in one shot:

1. Cursor & Windsurf Rules (.cursorrules)

Download directly to your repository root or copy the full prompt:

curl -o .cursorrules https://serqo.io/.cursorrules
2. AI Agent Skill (SKILL.md / Claude Code)

Equip autonomous AI agents with live Google and Bing search capabilities. See our LangChain & AI Agents Guide for Python examples:

curl -o SKILL.md https://serqo.io/SKILL.md
3. ChatGPT / Claude Project Prompt

Paste into ChatGPT or Claude to initialize a new search integration from scratch:

I want to integrate search engine results into my project using the Serqo Search API (https://serqo.io).

API Details:
- Endpoint: POST https://api.serqo.io/v1/search
- Autocomplete (Google): GET/POST https://api.serqo.io/v1/autocomplete
- Trends (Google): GET/POST https://api.serqo.io/v1/trends
- Live Capabilities: GET https://api.serqo.io/v1/engines
- Authentication Header: x-api-key: <SERP_API_KEY>
- Content-Type: application/json
- Supported Engines: "google", "bing"
- Available Search Types (ready for production use):
  - Google: "web", "news", "images", "videos" (via /v1/search), plus "autocomplete" (/v1/autocomplete) and "trends" (/v1/trends)
  - Bing: "web", "news", "images", "videos" (via /v1/search)
- Maintenance Search Types (returns HTTP 503 SEARCH_TYPE_UNAVAILABLE, retryable: true, 0 credits):
  - Google: "maps", "shopping", "forums", "books", "patents"
  - Bing: "maps"
- Unsupported on Bing (returns HTTP 400 UNSUPPORTED_VERTICAL): "shopping", "forums", "books", "patents", "autocomplete", "trends"
- Standard Parameters: q (string, required), engine (string), type (string), gl (country code, e.g. "us"), hl (language code, e.g. "en"), tbs (Google time filter, e.g. "qdr:d" or "qdr:w"), start (integer offset).

Official Client SDKs:
- Python: `pip install serqo` -> `from serqo import Serqo; client = Serqo(api_key=...)`
- Node.js / TypeScript: `npm install serqo-sdk` -> `import { Serqo } from 'serqo-sdk'; const client = new Serqo({ apiKey: ... })`
- PHP: `composer require serqo-io/serqo-php` -> `use Serqo\Client; $client = new Client(...)`

Response Structure:
The API returns a JSON envelope:
{
  "success": true,
  "requestId": "...",
  "data": {
    "engine": "google",
    "type": "web",
    "results": [
      { "position": 1, "title": "...", "url": "...", "domain": "...", "snippet": "..." }
    ],
    "pagination": {
      "hasNext": true,
      "nextStart": 10
    }
  }
}

My Requirements:
[Describe your feature requirements here: language/framework, use case, and target engines/types].

Please write the complete, production-ready implementation with clean JSON parsing and the following error handling:
- HTTP 429: respect error.retryAfterMs and account rate limits before retrying.
- HTTP 503 SEARCH_TYPE_UNAVAILABLE: check GET /v1/engines first; if the search type is under maintenance, stop retrying it automatically.
- Fall back to an available type (such as web or news) or return a clear temporarily-unavailable status when no alternative fits.
- Never retry indefinitely. Only delay-retry a maintenance type with an explicitly configured finite retry count.
- Do not treat a 503 maintenance response as 400 UNSUPPORTED_VERTICAL.

Endpoints

MethodPathDescription
POST/v1/searchRun a search. Set type to choose the search type.
POST / GET/v1/autocompleteReal-time search suggestions and multi-round SEO keyword expansion.
GET/v1/enginesList engines and their supported search types.
GET/v1/meThe account and key making the request.
GET/v1/healthAPI health check. No API key required; does not test search engines.

Supported search types

Choose a search type with type. Omit it for a web search. web, news, images, and videos are currently active on Google and Bing (alongside Google autocomplete and trends). Types marked Maintenance are temporarily unavailable; a dash means the engine does not support that type.

Call GET /v1/engines with your API key to check available engines and their verticals before sending a search. Types temporarily under maintenance are omitted.

Search typeRequest valueGoogleBing
Webweb✓✓
Newsnews✓✓
Imagesimages✓✓
Videosvideos✓✓
MapsmapsMaintenanceMaintenance
ShoppingshoppingMaintenance—
ForumsforumsMaintenance—
BooksbooksMaintenance—
PatentspatentsMaintenance—

GET /v1/engines

List available search engines and the search types each supports. Use the engine id and a supported vertical in your search request.

API key required. No query parameters or request body needed.

Request example

bash
curl https://api.serqo.io/v1/engines \
  -H "x-api-key: $SERP_API_KEY"

200 response

JSON
{
  "success": true,
  "requestId": "req_example",
  "data": {
    "engines": [
      {
        "id": "google",
        "displayName": "Google",
        "verticals": [
          "web",
          "news",
          "images",
          "videos",
          "autocomplete",
          "trends"
        ],
        "maintenanceVerticals": [
          "maps",
          "shopping",
          "forums",
          "books",
          "patents"
        ],
        "unsupportedVerticals": [],
        "statuses": {
          "web": "available",
          "news": "available",
          "images": "available",
          "videos": "available",
          "autocomplete": "available",
          "trends": "available",
          "maps": "maintenance",
          "shopping": "maintenance",
          "forums": "maintenance",
          "books": "maintenance",
          "patents": "maintenance"
        },
        "pagination": "offset"
      },
      {
        "id": "bing",
        "displayName": "Bing",
        "verticals": [
          "web",
          "news",
          "images",
          "videos"
        ],
        "maintenanceVerticals": [
          "maps"
        ],
        "unsupportedVerticals": [
          "shopping",
          "forums",
          "books",
          "patents",
          "autocomplete",
          "trends"
        ],
        "statuses": {
          "web": "available",
          "news": "available",
          "images": "available",
          "videos": "available",
          "maps": "maintenance",
          "shopping": "unsupported",
          "forums": "unsupported",
          "books": "unsupported",
          "patents": "unsupported",
          "autocomplete": "unsupported",
          "trends": "unsupported"
        },
        "pagination": "offset"
      }
    ]
  }
}
Response pathTypeContents
data.enginesarrayAvailable engines.
data.engines[].idstringValue to pass as engine.
data.engines[].displayNamestringEngine name for display.
data.engines[].verticalsstring[]Currently available search types for this engine.
data.engines[].maintenanceVerticalsstring[]Search types temporarily under maintenance (return 503 SEARCH_TYPE_UNAVAILABLE).
data.engines[].unsupportedVerticalsstring[]Search types not supported on this engine (return 400 UNSUPPORTED_VERTICAL).
data.engines[].statusesobjectLifecycle status map by search type (available, maintenance, unsupported, planned).
data.engines[].paginationstringPagination mode, currently offset.

This request does not consume search credits. Invalid keys return 401; engine-list failures can return 5xx.

GET /v1/me

Check which account and API key are making the request. The response does not include the full API key or credit balance.

API key required. No query parameters or request body needed.

Request example

bash
curl https://api.serqo.io/v1/me \
  -H "x-api-key: $SERP_API_KEY"

200 response

JSON
{
  "success": true,
  "requestId": "req_example",
  "data": {
    "account": {
      "id": "account_example",
      "email": "developer@example.com",
      "role": "user"
    },
    "key": {
      "id": "key_example",
      "prefix": "sk_example"
    }
  }
}
Response pathTypeContents
data.account.idstringAccount ID.
data.account.emailstringAccount email.
data.account.rolestringRole assigned to this account.
data.key.idstringID of the API key used.
data.key.prefixstringKey prefix for identifying the key.

Example account values are illustrative. This request does not consume search credits. An invalid, revoked or expired key returns 401 UNAUTHORIZED.

GET /v1/health

Check whether the API service responds. This does not test search engines, account access or available credits.

No API key, query parameters or request body needed.

Request example

bash
curl https://api.serqo.io/v1/health

200 response

JSON
{
  "success": true,
  "data": {
    "status": "ok"
  }
}

data.status is ok when the service responds. This endpoint does not use the usual requestId response body. It does not consume search credits.

Errors

Check the error reason and retry guidance when a search fails. Provide the request ID when troubleshooting.

JSON
{
  "success": false,
  "requestId": "req_01H…",
  "error": {
    "code": "INVALID_PARAM",
    "message": "Invalid search parameter",
    "retryable": false
  }
}

Common errors

400 · BAD_REQUEST
Check that the request is valid JSON and includes a non-empty query.
400 · UNSUPPORTED_VERTICAL
Choose a search type supported by the selected engine.
503 · SEARCH_TYPE_UNAVAILABLE
This search type is temporarily unavailable while under maintenance. Check GET /v1/engines for its current status. Do not automatically retry a type marked as maintenance; use an available alternative when appropriate.
400 · GEO_CONFLICT
The requested region conflicts with the search connection. Check the country code and provide the request ID if the error persists.
401 · UNAUTHORIZED
Provide an active, unexpired API key for an active account. Invalid, revoked and expired keys return UNAUTHORIZED.
402 · INSUFFICIENT_CREDITS
Your available balance cannot cover the request.
422 · INVALID_PARAM
Check the parameter name, type and allowed values.
429 · QUOTA_EXCEEDED / QUEUE_FULL
For QUOTA_EXCEEDED, wait for retryAfterMs before retrying. QUEUE_FULL also returns 429; follow its retry guidance.
502/503/504
Upstream failures are not charged. Follow the response’s retry guidance.
500 · INTERNAL_ERROR
Keep the request ID for troubleshooting.

Check the HTTP status before reading JSON. Network failures and responses from a proxy may not contain the API error body. Preserve the request ID when one is available.

Retry only when error.retryable is true. If error.retryAfterMs is present, wait at least that many milliseconds. To safely retry after a lost response, send the same Idempotency-Key with the same parameters; the original successful response is replayed without another search or charge for 24 hours. Without that header, a retry is a new request and uses the applicable credit rate.

The request ID is available in the response body and the x-request-id response header.

Handling 503 SEARCH_TYPE_UNAVAILABLE

When a search type is temporarily under maintenance, POST /v1/search returns HTTP 503 with error.code: "SEARCH_TYPE_UNAVAILABLE" and error.retryable: true, consuming 0 credits. Check GET /v1/engines before routing requests, fall back to available search types (such as web or news), and avoid tight retry loops.

TypeScript
const res = await fetch("https://api.serqo.io/v1/search", {
  method: "POST",
  headers: { "x-api-key": process.env.SERP_API_KEY!, "Content-Type": "application/json" },
  body: JSON.stringify({ q: "coffee shops", engine: "google", type: "maps" }),
});
if (res.status === 503) {
  const err = await res.json();
  if (err?.error?.code === "SEARCH_TYPE_UNAVAILABLE") {
    // 0 credits charged.
    // Do not automatically retry a maintenance type.
    // Check GET /v1/engines and use an available alternative if appropriate.
  }
}

Rate limits and credits

Rate limits

Each API key is limited by the account’s requests-per-second allowance. Playground sessions are counted separately. A 429 response includes the wait time in milliseconds; wait before retrying.

Credit usage

Cost depends on search type, engine, country and cache status. Failed searches and timeouts are not charged. View your available balance and credit history in Plan and credits.

Cache hits are free at the default rate. Before a search starts, your available balance must cover the full request cost, even if the result later comes from cache.