SerpApi-compatible endpoint
Code written for SerpApi works here by changing only the base URL: the same engine names, parameters and response fields, at SerpBase prices.
Switching over
Replace https://serpapi.com/search.json with the URL below and use your SerpBase key as api_key. Requests are GET, as on SerpApi. The key can also go in the X-API-Key header, which keeps it out of URLs and logs.
BASH
curl "https://api.serpbase.dev/google/serpapi/search.json?engine=google&q=coffee&gl=us&hl=en" \
-H "X-API-Key: YOUR_API_KEY"
curl "https://api.serpbase.dev/google/serpapi/search.json?engine=amazon&k=headphones&amazon_domain=amazon.com" \
-H "X-API-Key: YOUR_API_KEY"PYTHON
import requests
res = requests.get(
"https://api.serpbase.dev/google/serpapi/search.json",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"engine": "google_news", "q": "semiconductors", "gl": "us"},
)
print(res.json()["news_results"][0]["title"])Engines
Each engine runs on the SerpBase endpoint in the second column and costs what that endpoint costs. An engine not in this list is refused with 400.
| engine | Runs on | Credits per request |
|---|---|---|
google | Google Web Search | 1 |
google_images | Google Images Search | 1 |
google_news | Google News Search | 1 |
google_videos | Google Videos Search | 1 |
google_autocomplete | Google Search Autocomplete | 1 |
google_shopping | Google Shopping Search | 2 |
google_jobs | Google Jobs Search | 2 |
google_scholar | Google Scholar Search | 2 |
google_patents_details | Google Patent Details | 2 |
google_play | Google Play Search | 1 |
google_play_product | Google Play App Details | 1 |
google_trends | Google Trends | 2 |
google_trends_autocomplete | Google Trends Autocomplete | 2 |
google_trends_trending_now | Google Trends Trending Now | 2 |
google_maps | Google Maps Search | 2 |
google_maps_reviews | Google Maps Reviews | 2 |
duckduckgo | DuckDuckGo Search | 1 |
youtube | YouTube Search | 1 |
youtube_video_transcript | YouTube Video Transcripts | 2 |
amazon | Amazon Product Search | 2 |
amazon_product | Amazon Product Details | 2 |
amazon_autocomplete | Amazon Search Autocomplete | 1 |
walmart | Walmart Product Search | 2 |
walmart_product | Walmart Product Details | 2 |
ebay | eBay Product Search | 1 |
ebay_product | eBay Product Details | 2 |
apple_product | Apple Product Details | 1 |
What differs from SerpApi
- Fields are those SerpBase extracts, under SerpApi's names. A field SerpBase does not produce is left out rather than filled with a guess, so check for a key before reading it.
- Not served: output=html (except engine=google), google_maps place lookups (use /google/maps/detail), google_trends data types other than TIMESERIES, Play stores other than apps, and SerpApi's account, archive and async APIs. no_cache, async and json_restrictor are accepted and have no effect.
- Errors follow SerpApi: a refused request gets 400, 401 or 429 with {"error": …}; a search that ran and failed gets 200 with search_metadata.status "Error". Failed searches are not charged.