What you’ll learn: How to set up accounts with Claude, OpenAI, and Google Gemini. How to make your first API call. How to choose the right model for each marketing task. Why this matters for your career and your campaigns.
| Script | What It Does | GitHub Repo |
|---|---|---|
| Anomaly Detection | Monitors all campaigns for sudden metric changes, emails alerts | google_ads_anomoly_detection_script |
| Budget Projection | Calculates daily/monthly pacing, projects end-of-month spend | google_ads_budget_projection_script |
| Negative Keyword Manager | Finds wasteful search queries, recommends/adds negatives | googleads_negatives_script |
| Keyword Conflict Resolver | Detects when negatives block positive keywords | google_ads_negative_keyword_conflict_script |
| Impression Share Monitor | Tracks competitive position over time | google_ads_impressionshare_script |
| Out-of-Stock Pauser | Pauses ads for out-of-stock products automatically | google_ads_script_outofstock_items_script |
| Auto Label Manager | Labels campaigns based on performance criteria | google_ads_create_labels_assign_automatically |
| Bid Automation | Adjusts bids based on performance rules you define | google_ads_bid_automation |
| Symbol Remover | Strips ™, ©, ® from ad copy automatically | google-ads-symbol-remover |
| Bulk Uploader | Mass-create campaigns, ad groups, keywords, RSAs from Sheets | google-ads-bulk-uploader |
If you manage paid media in 2026 and you are still using AI only through ChatGPT’s chat interface, you are leaving enormous value on the table. The Stanford HAI 2025 AI Index Report documented that the performance gap between leading AI models has compressed to just 5.4%—meaning the choice of which model to use matters less than how you use it. But using these models through their APIs rather than their chat interfaces unlocks capabilities that the interfaces do not expose: structured outputs, tool use, batch processing, and integration with your advertising platforms.
There are three model families every advertiser should understand: Claude (Anthropic) excels at structured analysis, nuanced reasoning, and following complex instructions—ideal for search query analysis and competitive intelligence. GPT-4o (OpenAI) provides strong general-purpose generation with excellent creative copywriting capabilities. Gemini (Google) integrates natively with Google’s ecosystem and handles multimodal inputs including images and video.
| Tool | What It Does | GitHub Repo |
|---|---|---|
| Google Ads API Agent | 28 automation actions, 6 sub-agents, multi-model AI architecture | google-ads-api-agent |
| Creative Asset Validator | Analyzes ad creative against 50+ platform best practices | creative-asset-validator |
| Account Grader | Comprehensive 10-category account audit with scoring | itallstartedwithaidea_google_ads_account_grader |
| Business Discovery Engine | Lead discovery with email inference, 9 extraction methods | business-discovery-engine |
McKinsey research shows companies using AI for marketing automation reduce customer acquisition costs by 25%. But the key word is using—not subscribing to, not testing, using in production workflows. The difference between a marketer who has a ChatGPT subscription and a marketer who has API access integrated into their campaign management workflow is the difference between owning a gym membership and actually being fit.
| Tool | What It Does | GitHub Repo |
|---|---|---|
| Wrike Calendar Automation | Syncs project management with Google Calendar | wrike-calendar-automation |
| Dealer Email Scraper | Extracts contact information from business directories | dealer_email_scraper |
| Creative Builder (Frontend) | Web-based ad builder with AI-powered copy generation | creative |
| Sheet Shell Demo | Google Sheets as a frontend for terminal/script automation | sheet-shell-demo |
You need Python 3.10+ installed. Open your terminal and verify:
python3 --version # Should show 3.10 or higher
# If not installed, download from python.org
# Then install the essential libraries:
pip install anthropic openai google-generativeai requests pandas
WHY THESE LIBRARIES: anthropic = Claude API. openai = GPT API. google-generativeai = Gemini API. requests = HTTP calls to any API. pandas = Data analysis for campaign data.
You need accounts with each provider. Here is where to go and what to do:
Anthropic (Claude)
# 1. Go to: https://console.anthropic.com
# 2. Create account > Settings > API Keys > Create Key
# 3. Copy the key (starts with sk-ant-)
# 4. Set a spend limit under Settings > Plans & Billing
# Store it safely in your environment:
export ANTHROPIC_API_KEY='sk-ant-your-key-here'
OpenAI (GPT-4o)
# 1. Go to: https://platform.openai.com
# 2. Create account > API Keys > Create new secret key
# 3. Copy the key (starts with sk-)
# 4. Set usage limits under Settings > Limits
export OPENAI_API_KEY='sk-your-key-here'
Google (Gemini)
# 1. Go to: https://aistudio.google.com
# 2. Click 'Get API Key' > Create API key
# 3. Copy the key
export GOOGLE_API_KEY='your-key-here'
Create a file called first_ai_call.py and paste this code. This calls Claude to analyze a Google Ads search query report—something I do thousands of times per year managing campaigns:
import anthropic
import os
client = anthropic.Anthropic(
api_key=os.environ.get('ANTHROPIC_API_KEY')
)
# Example: Analyze search queries for waste
search_queries = '''
Query: best running shoes 2024 | Clicks: 45 | Cost: $38.25 | Conversions: 3
Query: running shoes free | Clicks: 23 | Cost: $19.55 | Conversions: 0
Query: nike store near me | Clicks: 12 | Cost: $10.20 | Conversions: 0
Query: how to clean running shoes | Clicks: 8 | Cost: $6.80 | Conversions: 0
'''
message = client.messages.create(
model='claude-sonnet-4-20250514',
max_tokens=1024,
messages=[{
'role': 'user',
'content': f'''You are a senior PPC analyst with 15 years of
experience. Analyze these search queries and recommend:
1. Which queries to add as negative keywords and why
2. Which queries to promote to exact match and why
3. Estimated monthly savings from the negatives
Search Query Report:
{search_queries}'''
}]
)
print(message.content[0].text)
Here is a script that sends the same prompt to all three models so you can see how each responds differently. This is how I evaluated which models to use for each of GoogleAdsAgent.ai’s 28 automation actions:
import anthropic, openai, google.generativeai as genai
import os
prompt = 'Write 3 Google Responsive Search Ad headlines for a
running shoe brand targeting marathon runners. Max 30 characters each.'
# Claude
claude = anthropic.Anthropic()
r1 = claude.messages.create(
model='claude-sonnet-4-20250514', max_tokens=500,
messages=[{'role':'user','content':prompt}]
)
print('=== CLAUDE ===')
print(r1.content[0].text)
# GPT-4o
gpt = openai.OpenAI()
r2 = gpt.chat.completions.create(
model='gpt-4o', messages=[{'role':'user','content':prompt}]
)
print('\n=== GPT-4o ===')
print(r2.choices[0].message.content)
# Gemini
genai.configure(api_key=os.environ.get('GOOGLE_API_KEY'))
model = genai.GenerativeModel('gemini-2.0-flash')
r3 = model.generate_content(prompt)
print('\n=== GEMINI ===')
print(r3.text)
Everything above is what I did manually for years before building it into a system. GoogleAdsAgent.ai’s multi-model architecture uses this same approach—Claude for search query analysis, OpenAI for creative generation, SearchAPI for competitive intelligence—but orchestrated through 6 specialized sub-agents that run continuously. You do not need to write these scripts. But understanding how they work makes you a better practitioner and a better evaluator of AI tools.
📦 GitHub: https://github.com/itallstartedwithaidea/google-ads-api-agent — The Python agent architecture powering GoogleAdsAgent.ai’s 28 automation actions
Website: https://googleadsagent.ai | GitHub: https://github.com/itallstartedwithaidea | Tools: https://googleadsagent.ai/tools
About the Author
John Williams is a Senior Paid Media Specialist at Seer Interactive with 15+ years managing $48M+ in digital ad spend across Google, Microsoft, Meta, and Amazon. Founder of It All Started With A Idea and creator of GoogleAdsAgent.ai. Speaker at Hero Conf on AI in advertising. Former WSU football player and current assistant football coach at Casteel High School, AZ.
Get a free 30-day audit of your advertising accounts. John will personally review your setup and provide actionable recommendations.
John will review your account and reach out within 24 hours.