What SerpApi PHP Library does
This is a PHP client for SerpApi, a hosted service that scrapes and parses search engine results. It covers the Search API, Location API, Search Archive API and Account API. A query array holds parameters such as the search term, location and Google domain, and the client returns the response as JSON. The repository is written in PHP and was created in February 2018.
The README states that support for this package is ending in favor of serpapi-php, and recommends migrating to the newer implementation. Installation needs PHP 7 or later and Composer. The package sits on Packagist as serpapi/google-search-results-php, or the repository can be cloned and the classes linked manually. It carries the MIT licence.
Key features
- Search API client
- Sends a query array to Google, Bing or Baidu through SerpApi and returns the parsed response as JSON.
- Location API lookup
- Provides location data for search queries; the README example passes Austin, Texas as the location value.
- Search Archive API
- Runs a search, returns a search_id, then fetches that stored search later from the archive.
- Account API call
- Retrieves account information for the API key the client was initialised with.
- Google Images example
- README includes a Google Images query built with the same GoogleSearch client class.
- Composer installation
- Package is on Packagist and added with composer require serpapi/google-search-results-php, including the vendor autoload file.
- Global API key
- The SerpApi api_key can be set globally once instead of being passed into every request.
- Script builder reference
- Points to the SerpApi demo page, which builds query scripts to start from before editing.
- Manual clone install
- Without Composer, the repository can be cloned and the RestClient and GoogleSearch classes required by path.
How it works
- Install PHP 7 or later and the Composer dependency manager on the machine.
- Add the package with composer require serpapi/google-search-results-php.
- Load vendor/autoload.php, or clone the repository and require the class files by path.
- Copy the secret API key from the SerpApi dashboard.
- Create a GoogleSearch client with the key, or set the api_key globally.
- Pass a query array with fields such as q, location and google_domain to get_json.
- Read the parsed JSON response inside the script.
Plans and pricing
The repository page prints no prices; usage runs through a SerpApi API key obtained from the SerpApi dashboard.
Integrations and platforms
Works with
- Bing
- Baidu
- SerpApi
- Composer
- Packagist
Available as
- API
- Web
Repository facts
- Repositoryserpapi/google-search-results-php
- LanguagePHP
- Stars71
- Forks52
- LicenceMIT
- Created2018-02-19
- Last commit2026-08-18
- Open issues7
- php
- php-api
- serp-api
Services and details
Does SEO work itself
YesFree plan or free tools
YesAPI or MCP server
Yes
No information yet on keyword research, content optimization, writes content with AI, technical audits, rank tracking, backlinks and link building, local SEO, AI search visibility, free trial, WordPress plugin, browser extension, built for agencies. The website did not say; check with the vendor.
About the company
- Company serpapi
- Website: github.com/serpapi/google-search-results-php
Listing compiled from public sources and the product's own website. Last updated 2026-11-12. Report a correction or request removal. Back to GitHub repos.