ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Extract Google Ads Data from SERP APIs
Tutorial

How to Extract Google Ads Data from SERP APIs

Pull Google Ads/sponsored results from SERP APIs. Extract ad copy, position, sitelinks, and shopping ads. Python walkthrough.

Get Free API KeyAPI Docs

An r/ComplexWebScraping user asked about SERP APIs that return sponsored results. Google Ads data from SERP gives you competitor ad copy, position, and extensions without Google Ads API access. This tutorial shows how.

Prerequisites

  • Scavio API key
  • Python 3.8+

Walkthrough

Step 1: Fetch SERP with ads included

Standard Scavio Google search includes ads by default.

Python
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def get_serp_with_ads(keyword):
    return requests.post('https://api.scavio.dev/api/v1/search',
        headers=H,
        json={'platform': 'google', 'query': keyword}).json()

Step 2: Extract sponsored results

Parse the ads_results or sponsored_results field.

Python
def extract_ads(serp):
    ads = serp.get('ads_results', []) or serp.get('sponsored_results', [])
    return [{'title': ad.get('title'), 'link': ad.get('link'),
             'description': ad.get('description'), 'position': i+1}
            for i, ad in enumerate(ads)]

Step 3: Extract shopping ads

Google Shopping results appear separately.

Python
def extract_shopping(serp):
    return [{'title': s.get('title'), 'price': s.get('price'),
             'source': s.get('source'), 'link': s.get('link')}
            for s in serp.get('shopping_results', [])]

Step 4: Track ad changes over time

Store daily snapshots for competitor ad monitoring.

Python
import json, datetime
def save_snapshot(keyword, ads, shopping):
    snapshot = {'date': str(datetime.date.today()), 'keyword': keyword,
                'ads': ads, 'shopping': shopping}
    with open(f'ad_snapshots/{keyword}.jsonl', 'a') as f:
        f.write(json.dumps(snapshot) + '\n')

Python Example

Python
# Monitor 50 keywords for competitor ads:
# 50 queries/day × $0.005 = $0.25/day = $7.50/mo
# Returns: ad copy, position, sitelinks, shopping ads

JavaScript Example

JavaScript
const serp = await fetch('https://api.scavio.dev/api/v1/search', {
  method: 'POST', headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
  body: JSON.stringify({platform: 'google', query: keyword})
}).then(r => r.json());

Expected Output

JSON
Daily snapshots of competitor Google Ads: ad copy, position, sitelinks, shopping ads. JSONL storage for trend analysis.

Related Tutorials

  • How to Monitor Competitor Ad Copy from SERP Data

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Scavio API key. Python 3.8+. A Scavio API key gives you 50 free credits on signup.

Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Related Resources

Use Case

Google Ads SERP Extraction

Read more
Solution

Google Ads Data from SERP APIs

Read more
Best Of

Best SERP APIs for Google Ads Intelligence (2026)

Read more
Best Of

Best SERP APIs That Return Sponsored/Ad Data (2026)

Read more
Glossary

SERP Sponsored Results

Read more
Comparison

Google Places API vs SERP Local Pack API

Read more

Start Building

Pull Google Ads/sponsored results from SERP APIs. Extract ad copy, position, sitelinks, and shopping ads. Python walkthrough.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy