What you’ll learn: How to connect to the Amazon Advertising API, automate Sponsored Products bid management, use AI for listing optimization, and build review sentiment analysis.
Amazon Advertising is unique because the advertising platform and the commerce platform are the same system. This means Amazon has conversion data that Google and Meta can only estimate—it knows exactly what people bought, at what price, with what margin. This creates both an opportunity (richer signals) and a risk (Amazon’s AI optimizes for Amazon’s marketplace revenue, not your profitability).
# 1. Go to: https://advertising.amazon.com/
# 2. Register as an advertiser or agency
# 3. Developer Console: https://advertising.amazon.com/API/docs/en-us
# 4. Create a new app > Get Client ID and Client Secret
# 5. OAuth 2.0 flow to get refresh token
# Required credentials:
# - Client ID (from app registration)
# - Client Secret (from app registration)
# - Refresh Token (from OAuth flow)
# - Profile ID (from API call - identifies your ad account)
# - Region endpoint (na = North America, eu = Europe, fe = Far East)
import requests
import json
import time
BASE_URL = 'https://advertising-api.amazon.com'
def get_access_token(client_id, client_secret, refresh_token):
response = requests.post('https://api.amazon.com/auth/o2/token', data={
'grant_type': 'refresh_token',
'refresh_token': refresh_token,
'client_id': client_id,
'client_secret': client_secret
})
return response.json()['access_token']
def get_sp_report(access_token, profile_id):
'''Request Sponsored Products campaign report.'''
headers = {
'Authorization': f'Bearer {access_token}',
'Amazon-Advertising-API-ClientId': CLIENT_ID,
'Amazon-Advertising-API-Scope': profile_id,
'Content-Type': 'application/json'
}
payload = {
'reportDate': '2026-02-18',
'metrics': 'impressions,clicks,cost,sales14d,acos14d,roas14d,orders',
'recordType': 'campaigns'
}
response = requests.post(f'{BASE_URL}/v2/sp/campaigns/report',
headers=headers, json=payload)
report_id = response.json()['reportId']
# Poll for completion
while True:
status = requests.get(f'{BASE_URL}/v2/reports/{report_id}',
headers=headers)
if status.json()['status'] == 'SUCCESS':
download_url = status.json()['location']
break
time.sleep(5)
return requests.get(download_url, headers=headers).json()
import anthropic
client = anthropic.Anthropic()
def optimize_listing(product_title, current_bullets, target_keywords):
response = client.messages.create(
model='claude-sonnet-4-20250514',
max_tokens=2000,
messages=[{
'role': 'user',
'content': f'''You are an Amazon listing optimization expert.
Current Title: {product_title}
Current Bullet Points: {current_bullets}
Target Keywords: {target_keywords}
Optimize this listing:
1. Rewrite title (max 200 chars, front-load primary keyword)
2. Rewrite 5 bullet points (max 500 chars each, keyword-rich)
3. Suggest 5 backend search terms
4. Score the current listing 1-10 and the optimized version 1-10
Follow Amazon Style Guide rules: no ALL CAPS in titles,
no promotional language like "best" or "top-rated",
no competitor brand names.'''
}]
)
return response.content[0].text
Amazon, Google, and Meta each optimize for their own platform’s revenue. None of them will recommend shifting budget to a competitor platform. GoogleAdsAgent.ai’s Budget Orchestration sub-agent evaluates performance across all three and recommends allocation based on your margin contribution—not any single platform’s revenue targets.
Website: googleadsagent.ai | GitHub: https://github.com/itallstartedwithaidea | Tools: googleadsagent.ai/tools
John Williams | Senior Paid Media Specialist, Seer Interactive | $48M+ managed spend | Creator, GoogleAdsAgent.ai | Hero Conf Speaker | github.com/itallstartedwithaidea
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.