Temporarily unavailable
This feature is switched off for now. Its calls answer 503 feature_disabled and cost no credits. Please check back later.
A Google Search API for results, ads and Trends
Get Google search results as JSON for any country, language and device, plus Google Trends data, with Python, JavaScript and curl code examples.
· 6 min read
Almost every marketing and data project ends up needing Google results. SEO teams track where their pages rank. Agencies report on competitors' visibility. Market researchers want to know which sites own a topic. AI agents need fresh search results to answer questions about this week instead of last year.
Google does not make this easy. Its Custom Search JSON API searches a search engine you configure yourself, has a small free quota and returns results that differ from google.com. Scraping the results page with your own browser automation works for a few hundred queries, then you meet CAPTCHAs, consent screens and a layout that changes every few weeks.
This guide shows how to get the real results page as JSON with one HTTP call, from any country and device, and how to add Google Trends data to see where interest is going.
One call, one results page
The Google Search API of ScrapeCrate has one search endpoint:
GET https://api.scrapecrate.com/v1/google/searchIts parameters are few:
| Parameter | Default | What it does |
|---|---|---|
q | required | The query, operators like site: and quotes included |
country | us | The country to search from (Google's gl) |
language | en | The interface language (Google's hl), e.g. it or pt-BR |
page | 1 | The results page, 1 to 10, 10 organic results each |
device | desktop | desktop or mobile |
curl "https://api.scrapecrate.com/v1/google/search?q=best%20running%20shoes&country=gb&language=en&device=mobile" \
-H "X-API-Key: YOUR_API_KEY"What is in the response
data describes the whole results page:
query,pageandtotal_results, Google's estimate of the matches;organic_results: each withposition,title,url,displayed_url,domain,snippetandsitelinks(a list oftitleandurl);ads: the paid results, each withposition,block(topor bottom of the page),title,url,displayed_url,domainanddescription;people_also_ask: the questions of the "People also ask" box;related_searches: the searches Google suggests at the bottom;featured_snippetandknowledge_panel, ornullwhen the page has none;has_next_pageandno_results.
Optional blocks are empty or null when Google does not show them, so your code never has to guess whether a key exists.
Rank tracking in twenty lines
The most common use is checking where a domain ranks for a list of keywords. Read the first pages until you find it:
from scrapecrate import ScrapeCrate
client = ScrapeCrate(api_key="YOUR_API_KEY")
def rank(keyword: str, domain: str, country: str = "us", max_pages: int = 3) -> int | None:
for page in range(1, max_pages + 1):
serp = client.google.search(q=keyword, country=country, page=page)
for r in serp.data["organic_results"]:
if r["domain"].endswith(domain):
return r["position"]
if not serp.data["has_next_page"]:
break
return None
for kw in ["trail running shoes", "running shoes for flat feet"]:
print(kw, rank(kw, "example.com"))Run it once a day from a scheduler and save the positions: you have your own rank tracker for a cent per keyword-page. Tracking 100 keywords on the first page every day is 3,000 searches a month.
A few more patterns that work well:
Content gaps. Collect
people_also_askandrelated_searchesfor your main topics: they are the questions your pages should answer.Competitor share of voice. Count the domains that appear in the top 10 for a basket of keywords. The ones that keep showing up are your real competitors, whoever you thought they were.
Paid pressure. The
adsblock shows who bids on your brand and category keywords, and the ad library guide shows how to see what those advertisers run on social media.Fresh context for LLMs. Give an agent the top results, then fetch the pages as Markdown, as explained in web scraping for LLM and RAG.
Google Trends: where interest is going
Search results tell you who ranks today; Google Trends tells you whether people will still be searching tomorrow. Three endpoints read it, each taking up to 5 keywords separated by commas:
/v1/google/trends/interest-over-time: atimelineof points, each withdateand onevaluefrom 0 to 100 per keyword, plusaverages;/v1/google/trends/interest-by-region:regionswithgeo_code,nameand the values, at theresolutionyou pick (country,region,metroorcity);/v1/google/trends/related-queries: for each keyword, thetopandrisingsearches.
Filter them with geo (US, or a region such as US-CA), time_range (from past_hour to past_5_years, or all since 2004), or a custom from_date and to_date, plus category and property (web, images, news, youtube or shopping).
curl "https://api.scrapecrate.com/v1/google/trends/interest-over-time?keywords=trail%20running,road%20running&geo=US&time_range=past_5_years" \
-H "X-API-Key: YOUR_API_KEY"Values are relative: 100 is the highest point of that chart, not an absolute number of searches. Compare keywords in the same call when you want them on the same scale. The last point of a timeline can be partial, still being counted, so leave it out of averages. When Google has too little data, no_data is true. A rising query marked breakout grew by more than 5,000%, which is often the earliest sign of a new trend.
Use property=youtube to see what people search on YouTube, and property=shopping for buying intent.
What it costs
A Google search costs 10 credits per successful call, one cent at the list price. A Trends call costs 3 credits. Errors are never billed, and every account gets 100 free credits per month: ten searches or thirty-three Trends charts to try it on your own keywords. Monthly subscriptions bring the price per credit down by 20% to 50%; the pricing page has the calculator.
Good practice
Respect the rate limits. Calls are limited to 300 a minute per key and to a few requests in flight at once (2 on the free plan). A rank tracker does not need more: spread the keywords over the day.
Store the raw response. SERP features change. Keep the JSON you received so you can recompute a metric later without paying for the search again.
Localise properly.
countryandlanguageare separate. A Spanish speaker in the US iscountry=us&language=es.Do not chase every position. Rankings move several places a day; look at weekly averages before acting on a change.
Want to see the results of your own keywords? Create a free account and run the first call above, or read every field in the Google Search API reference. If you are comparing providers, our guide to choosing the best web scraping API lists what to check.
Frequently asked questions
Does Google have an official search API?
Google offers a Custom Search JSON API, but it searches a custom search engine you configure, with a small daily free quota and results that do not match what people see on google.com. For rank tracking and SERP research you need the real results page, which is what this API returns.
Can I search from another country or on mobile?
Yes. country sets the country Google searches from (Google's gl), language the interface language (hl), and device=mobile returns the results as a phone sees them. Rankings often differ between desktop and mobile, so track both if you can.
How many results do I get per call?
One results page, about 10 organic results, plus the ads, People also ask, related searches, featured snippet and knowledge panel on that page. Use page=2 up to page=10 for deeper results; each page is a call.
Can I use search operators like site:?
Yes. The q parameter goes to Google as written, so site:, quotes, minus and the other operators work as in the browser.
How much does a search cost?
10 credits per successful search, one cent at the list price. Google Trends calls cost 3 credits. Failed calls are free, and the first 100 credits of every month are free.
Try it with free credits every month
One API key for every source in this guide. No card needed, and only successful calls are billed.