API Documentation

SerpApi.Org is a REST API that returns structured JSON data scraped live from Bing (and Google for Scholar). Every endpoint below is documented from the actual source — parameters, response shape, and error codes are exactly what the API returns.

Official PHP Client SDK

Building a PHP or Laravel application? Skip raw HTTP requests. Use our official client library to query the API in minutes with native object wrappers, built-in rate-limiting exceptions, and local defaults.

composer require tienphat/serpapi-php View GitHub Repo →

Quickstart

Every request is a plain GET with your API key passed as the token query parameter. Grab your key from the Dashboard → API Key page after signing up.

cURL Example
curl "https://serpapi.org/api/v1/webs-search?keyword=tesla+model+y&gl=US&hl=en&token=YOUR_API_KEY"
PHP SDK Example
// composer require tienphat/serpapi-php
use SerpApiOrg\SerpApiClient;

$client = new SerpApiClient('YOUR_API_KEY');
$results = $client->webSearch('tesla model y', [
    'gl' => 'US',
    'hl' => 'en'
]);

foreach ($results as $item) {
    echo $item['title'] . "\n";
}

Official PHP SDK Client

If you are integrating SerpApi.Org into a PHP or Laravel project, we highly recommend using our official PHP SDK. It provides clean, object-oriented abstractions, default country/language parameters, and type-safe response handling.

View SDK on GitHub →

Authentication

Pass your secret key as the token query parameter on every request. There is no header-based auth.

ParameterTypeRequiredDescription
tokenstringYesYour account's secret API key.

Missing or invalid tokens return 401. See Error codes.

Response format

Every successful response shares the same envelope:

{
  "request": { /* echo of the normalized parameters used */ },
  "data": { /* endpoint-specific results, see each endpoint below */ },
  "in_seconds": 0.31
}

Failed requests always return HTTP status ≠ 200 with:

{
  "status": false,
  "message": "Invalid token key!"
}

Common parameters

These apply to Web, Image, Video, News, and Shopping search (each endpoint's own table below notes any it doesn't accept).

ParameterTypeDefaultDescription
keywordstringRequired. The search query.
glstringUSCountry code to search from (e.g. US, GB, VN).
hlstringautoResult language. Auto-detected from gl if omitted.
pageinteger1Page of results.
sizeinteger40Results per page. Capped at 100.
timestringRecency filter: d (day), w (week), m (month), y (year).

Endpoints

Base URL for all endpoints below: https://serpapi.org/api/v1

GET/autocomplete

Bing search-suggestion autocomplete for a partial or full keyword.

ParameterTypeRequired
keywordstringYes
GET /api/v1/autocomplete?keyword=tesla+model+y&token=YOUR_API_KEY
{
  "request": {"keyword":"tesla model y","gl":"US","hl":"en"},
  "data": {
    "suggestions": [
      {"value": "tesla model y"},
      {"value": "tesla model y 2026"},
      {"value": "tesla model y price"}
      // ...more items
    ],
    "search_type": "autocomplete"
  },
  "in_seconds": 0.32
}
GET/webpage

Extracts clean article content, metadata, and images from any public URL.

ParameterTypeRequiredDescription
urlstringYesFull URL of the page to extract.
include_htmlbooleanNoInclude raw sanitized content_html in the response. Default false.
GET /api/v1/webpage?url=https://www.nasa.gov/news/&token=YOUR_API_KEY
{
  "request": {"url":"https://www.nasa.gov/news/","include_html":false},
  "data": {
    "url": "https://www.nasa.gov/news/",
    "title": "NASA News",
    "description": "Resources for news media, including NASA news contacts and archived news material",
    "canonical_url": "https://www.nasa.gov/news/",
    "content": "Receive NASA News Releases\n\nResources for News Media\n...",
    "images": [
      {"src": "https://www.nasa.gov/wp-content/uploads/.../image.jpg", "alt": "NASA News"}
    ],
    "metadata": {
      "domain": "www.nasa.gov",
      "language": "en",
      "word_count": 59,
      "reading_time_minutes": 1
    }
  },
  "in_seconds": 0.04
}

Error codes

HTTP statusMeaningExample message
400Missing required parameter."Missing keyword!" / "Missing url!" / "Unsupported type."
401Missing or invalid token."Missing token key!" / "Invalid token key!"
403Plan, subscription, or requested service is inactive."Your subscription has expired..." / "This API service is currently disabled."
429Monthly request quota exceeded."Your request quota has been exceeded. Please upgrade your plan or contact support."
500Unexpected server-side error.Generic failure message.

All errors share the same body shape: {"status": false, "message": "..."}.

Rate limits & plans

Free tier allows 1 request/second; paid tiers support up to 50 concurrent requests. Each plan's monthly request quota:

PlanMonthly requests
Free 5,000
Basic 25,000
Medium 100,000
Pro 300,000
Pro Max 800,000
Super 1,500,000
Ultra 3,500,000
Ultra Max 10,000,000

See Pricing for current rates, or contact us for custom volume.

Top