Google API: Paid Ads Extraction and Coordinate-Based Search Targeting
Search APIs usually return organic results and leave paid placements to be filtered out later. This guide covers two request options that change that: an ad-focused search type and coordinate-based geolocation targeting. It explains the parameters, the response fields to read, and how to tell an empty ad section apart from a failed request.
Extracting paid ads from Google SERPs
Set search_type=ads and pass the query you want to monitor. The API returns the paid placements shown for that search rather than a normal result set you would have to filter afterward. Because the ad search type is tuned for ad visibility, it can surface more paid placements per query than a filtered organic response.
A response can contain top ads, bottom ads, full ad copy, display URLs, sitelinks, and extensions, plus the organic results for the same SERP. That combination supports PPC monitoring, competitor ad research, landing page tracking, and paid coverage audits across countries.
Billing works the same way as any other Google search, with no separate ad tier: 10 credits for light requests and 15 credits for heavy requests. The parameters are also identical to a standard search, so switching to ads does not require a different request shape. Confirm the current rates with the account owner before budgeting a pipeline.
Reading ad fields in a Python request
A request for ads sets search_type=ads, chooses a country, and selects light or heavy processing. Ads can appear above the organic results, below them, or in both positions, so a reader script should check both top_ads and bottom_ads and combine them before counting.
For each ad, the useful fields are title, visual_url or displayed_url for the display URL, url for the landing page, and description. The complete request example is supplied as a protected module and is not reproduced here.
Targeting searches from exact coordinates
Country-level targeting is coarse. The latitude, longitude, and radius parameters let you define a search origin in decimal degrees and set the surrounding search area in meters. For example, latitude=40.7128, longitude=-74.0060, and radius=5000 searches within 5 km of lower Manhattan.
This is useful for hyperlocal SERP tracking, local SEO audits, local pack monitoring, and comparing how rankings change between neighborhoods, cities, or store locations. The full parameter reference is in the Google API documentation.
Reading local and organic results from a coordinate search
A coordinate request passes the query, country, latitude, longitude, and radius. Local-intent queries can return local_results; standard web results arrive in organic_results. Local entries expose title, address, rating, and review_count or reviews. Organic entries expose title, domain, and url.
The complete request example is supplied as a protected module and is not reproduced here.
Field map: which array to read
Use this checklist to decide which response section answers your question:
- Paid placements above the organic list:
top_ads. - Paid placements below the organic list:
bottom_ads. - Local business entries for a local-intent query:
local_results. - Standard web results:
organic_results.
If you are auditing paid coverage, combine top_ads and bottom_ads before counting. If you are auditing local visibility, read local_results first and treat organic_results as the broader web layer.
Empty results versus a failed request
An empty ad array is not the same as a broken request. The example scripts separate three failure modes: an HTTP error status, a request timeout after 60 seconds, and a response body that is not valid JSON. Each is raised as a distinct runtime error with the request URL and, where available, the response text.
If the request succeeds but top_ads and bottom_ads are both empty, the query returned no paid placements in that context. If local_results is empty, the query may not have local intent or the area may have no matching local entries. Check the response arrays before assuming the API failed.
Putting the two features together
Paid ads support PPC research; coordinate targeting supports local SERP tracking. Both use the same Google API endpoint and the same credit structure as a standard search. Existing users can test the parameters in their current requests. New users can create an account and receive 1,000 credits to try the API, with no credit card required.
Frequently asked questions
Does search_type=ads replace the organic results?
No. The response can include top ads, bottom ads, and the organic results for the same SERP. The ad search type is optimized for ad visibility, so it captures more paid placements than filtering a regular result set.
What does an ads request cost?
An ads request is billed like a standard Google search rather than as a separate tier: 10 credits for a light request and 15 credits for a heavy request.
What units do latitude, longitude, and radius use?
Latitude and longitude are decimal degrees. Radius is the surrounding search area in meters. For example, latitude=40.7128, longitude=-74.0060, and radius=5000 searches within 5 km of lower Manhattan.
Why are top_ads and bottom_ads empty?
An empty ad array means the query returned no paid placements in that context. It is distinct from an HTTP error, a timeout, or an invalid JSON response, which the example scripts raise as separate runtime errors.