SerpApi's Google Search API Offers Reliable Performance with Flexible Integration Options
SerpApi provides a comprehensive Google Search API with reliable performance and flexible integration options. This article explores the company's billing model, service level agreement, and technical specifications, including PHP implementation, organic results parsing, and support for multiple search types.
The company implements a usage-based billing model, charging for successful searches while excluding cached, errored, and failed attempts from their count. Their service level agreement guarantees 99.95% uptime, with penalties that refund up to 100% of the monthly plan price on subsequent invoices if the service falls below this standard. Refunds are issued within seven days of subscription, provided usage does not exceed 20% of the plan volume.
Plans scale with search volume, starting at 1,000 successful searches per hour for the Developer Plan, which encompasses 5,000 searches monthly. Larger plans offer a base limit of 100,000 successful searches per hour, supplemented by 1% of the total monthly volume. Usage is measured on a per-service basis, with separate limits applying to each of SerpApi's multiple search engine APIs.
The company supports integration across multiple programming languages, including PHP, through a comprehensive suite of API services. These services enable developers to interact with Google's diverse set of search capabilities, including Images, News, Shopping, and other specialized APIs. All major search engines are supported, with Google's suite of services requiring the specification of a tbm (to be matched) field to indicate the desired API functionality. For regular Google searches, this field can be omitted, while specific services like Images require setting tbm to isch, News to nws, and Shopping to shop.
To integrate SerpApi in PHP applications, developers must use PHP version 7 or later, along with Composer for dependency management. The API offers several services including Search API, Location API, Search Archive API, and Account API.
The core functionality of the PHP implementation is handled through classes for each supported search engine, including GoogleSearch, BingSearch, BaiduSearch, EbaySearch, YahooSearch, YandexSearch, WalmartSearch, YoutubeSearch, HomeDepotSearch, AppleAppStoreSearch, NaverSearch, and more. These classes format search requests for submission to the SerpApi server, execute GET requests, and parse JSON responses using the built-in PHP JSON standard library.
To configure API access, developers have two primary options. They can use the global singleton pattern to set the SerpApi key:
$client = new GoogleSearch();
$client->set_serp_api_key("Your Private Key");
Alternatively, they can pass the key directly to the constructor:
$client = new GoogleSearch("Your Private Key");
The PHP API supports extensive configuration options for search queries, including the ability to specify:
Search query
Google domain
Location
Device type
Language
Country
Advanced filtering parameters
All search results are returned as standardized JSON responses from the backend, which processes raw HTML search results. The API's response structure includes both organic search results and detailed metadata about the search process, such as timing information and request status.
The Google Organic Results API returns search results in a structured JSON format, containing detailed data about each organic result. This data includes essential fields such as the result's position, title, link, redirect link, displayed link, and thumbnail, with additional metadata like favicon, snippet, and highlighted words.
When processing complex organic results, the API extracts rich snippet data, displaying extensions directly below the main result. For example, a recipe's origin region, introduction date, and ingredient list are all included. The API also provides source information about each result, including security status and icon, as well as language and location details.
The API's response structure reflects its comprehensive approach to search result extraction. Each organic result is contained within an array of objects, with additional nested properties for extended data like key moments (for video results) and sitelinks information. This structured approach enables developers to easily extract and display specific elements of search results while maintaining flexibility for future data types.
SerpApi offers a comprehensive suite of APIs across multiple search platforms, including Google, Baidu, Bing, Yahoo, Yandex, and specialized APIs for eBay, YouTube, and Walmart. These APIs support over 30 different search engines and provide access to specialized features like Google Images, News, Shopping, and Lens.
The company supports integration across multiple programming languages, including PHP, Ruby, JavaScript, Java, Rust, Python, Golang, .NET, Swift, and C++. Each supported search engine has its own API class for handling requests, including GoogleSearch, BingSearch, BaiduSearch, EbaySearch, YahooSearch, YandexSearch, WalmartSearch, YouTubeSearch, HomeDepotSearch, AppleAppStoreSearch, NaverSearch, and YelpSearch.
The API structure allows developers to set various search parameters, such as the search query, Google domain, location, device type, language, and country. Advanced users can also configure additional parameters like advanced filtering criteria and specific search types using the tbm field. For example, Google search requests don't require the tbm parameter, while image searches use tbm=isch, news searches use tbm=nws, and shopping searches use tbm=shop.
The company handles three types of output: JSON, HTML, and cached results. JSON results include detailed metadata about the search process, such as processing times, successful status codes, and raw HTML file URLs. The API supports caching results for up to one hour, with options to control caching behavior through parameters like no_cache and async. Advanced users can enable ZeroTrace mode for specific searches to reduce data storage requirements.
SerpApi structures its plans based on monthly search volume, with tiered pricing and usage limits designed to accommodate both small projects and enterprise needs.
The basic Developer Plan allows 5,000 searches monthly, with 1,000 successful searches per hour. This plan serves as the foundation for integration into development projects, offering a straightforward way to get started with Google's search capabilities.
For larger-scale operations, SerpApi introduces plans supporting 1 million searches per month or more. These plans establish a base limit of 100,000 successful searches per hour, supplemented by an additional 1% of the total monthly search volume. This structure enables businesses and developers to scale their usage while maintaining predictable performance levels.
The company rigorously monitors service reliability through a 99.95% uptime guarantee. In the unlikely event that service falls below this standard, penalties kick in, with customers receiving credits up to 100% of their monthly plan price on the subsequent invoice. These credits are issued within seven days of subscription, as long as usage remains at or below 20% of the plan volume.
To facilitate development across multiple platforms, SerpApi operates a suite of additional APIs built on the same infrastructure. These include specialized services for eBay, YouTube, Walmart, and other major platforms, allowing developers to access diverse data sets through a unified API approach. The company continues to expand its offering, regularly adding new APIs and features to its suite of services.