SERP API
The SerpAPI Connector enables seamless access to SerpAPI services, providing search results, location data, account information, and archived search results. It supports querying search results, retrieving supported locations, fetching account details, and accessing archived searches — including basic and detailed location lookups.
Integration Overview
This document provides a detailed guide for each endpoint, its purpose, configuration, and workflow support using the SerpAPI Connector. The connector forwards HTTP GET requests to SerpAPI, handling query parameters and headers, optionally appending an API key from environment variables.
- get_search_results. Retrieves search results based on a query and optional parameters.
- get_locations. Retrieves supported locations for geolocation-based searches.
- get_account_info. Retrieves account details for a given API key.
- get_search_archive. Retrieves archived search results for a specific search ID.
Detailed Integration Documentation
Search Results Retrieval
| Action | get_search_results |
|---|---|
| Endpoint | GET /search |
| Purpose | Retrieves search results from SerpAPI based on a query and optional parameters — engine, location, language, and pagination. |
| Parameters | Required: q (e.g. “coffee shops Stockholm”); api_key (or CONNECTOR_ENV_SERPAPI_API_KEY). Optional: engine (e.g. google); location; google_domain; hl; gl; tbm; num; start; async. |
| Configuration | Run the app with the correct base URL; optionally set CONNECTOR_ENV_SERPAPI_BASE_URL, CONNECTOR_ENV_SERPAPI_API_KEY, and CONNECTOR_ENV_PORT (default 8081). |
| Output | Successful: JSON with organic results, related searches, or local business data. Failure: 400 / 401 / 500. |
| Workflow example | Execute GET /search with q=coffee shops Stockholm and api_key, then display results. |
Locations Retrieval
| Action | get_locations |
|---|---|
| Endpoint | GET /locations.json |
| Purpose | Retrieves a list of supported locations for geolocation-based searches, filtered by query and limit. |
| Parameters | Optional: q (e.g. Stockholm); limit (e.g. 5); api_key. |
| Output | Successful: JSON with supported locations — city, country, and geolocation details. Failure: 400 / 401 / 500. |
| Workflow example | Execute GET /locations.json with q=Stockholm and limit=5 to populate a location dropdown. |
Account Info Retrieval
| Action | get_account_info |
|---|---|
| Endpoint | GET /account |
| Purpose | Retrieves account details for a given API key — usage limits, plan type, and account status. |
| Parameters | Required: api_key (or CONNECTOR_ENV_SERPAPI_API_KEY). |
| Output | Successful: JSON with remaining searches, plan type, and status. Failure: 400 / 401 / 500. |
| Workflow example | Execute GET /account with api_key, then display details in an admin dashboard to monitor usage. |
Archived Search Retrieval
| Action | get_search_archive |
|---|---|
| Endpoint | GET /searches/{search_id}.json |
| Purpose | Retrieves archived search results for a specific search ID — access to previously executed searches. |
| Parameters | Required: search_id (e.g. 12345); api_key. |
| Output | Successful: JSON with the original query, results, and metadata. Failure: 400 / 401 / 500. |
| Workflow example | Execute GET /searches/12345.json with api_key to display historical search data for analysis. |
Example Workflow: Search & Location Integration
| Retrieve locations | Execute get_locations with q=Stockholm and limit=5 to populate a location picker. |
|---|---|
| Perform search | Execute get_search_results with q=coffee shops Stockholm and location=Stockholm, Sweden. |
| Monitor account | Execute get_account_info to ensure sufficient API quota. |
| Access archives | Execute get_search_archive with search_id=12345 to analyze historical trends. |
Use Case
A digital marketing platform integrates the SerpAPI GCP Connector to deliver real-time, geolocated search insights. Using get_search_results, the platform fetches localized Google results for competitor analysis and SEO reporting; get_locations helps tailor campaigns to regional trends; get_account_info tracks and bills API usage; and get_search_archive supports historical trend analysis — all within a scalable, cloud-native workflow.
For technical support, contact custom-connectors-support@isolutions.sa.