Credentials
Add each client by entering their own Amazon Ads API credentials — the app auto-discovers all their marketplaces in one call.
🇮🇳
Demo Account
IN · INR · advertising-api.amazon.com
Add Client Account
Step 1
💡
For each client, ask them to create an Amazon Ads API application (Self type) and share their CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN. Enter those here — the app calls GET /v2/profiles with their credentials and auto-creates an account for every marketplace they sell in. Repeat for each client.
CLIENT NAME your label for this client (e.g. "Brand X" or "Acme India")
CLIENT_ID their Ads API app
CLIENT_SECRET
REFRESH_TOKEN
Obtained once via their OAuth flow — unique per seller account
Fetches an access token via LWA, then calls GET /v2/profiles — one account is auto-created per marketplace, pre-filled with Profile ID, Merchant Token, currency, and API endpoint. Repeat for each client.
⚠️
Browser CORS note: Amazon's token and profiles endpoints block direct browser requests. If Discover fails with a network error, use the CLI fallback in the Export tab → "Discovery CLI", run the curl commands in your terminal, then paste the JSON here.
🔒
All credentials are stored in local browser storage only — never sent to any server other than Amazon's own API endpoints.
🔑 Active Account — API Credentials used for all budget & rule operations
Step 2
CLIENT_ID
CLIENT_SECRET
REFRESH_TOKEN
This client's OAuth refresh token — stored per account, never shared with other clients
📋 Active Account Details auto-populated on Discover
Step 3
PROFILE_ID
MERCHANT_TOKEN (Seller ID)
accountInfo.id from /v2/profiles
ACCOUNT NAME
MARKETPLACE ID
e.g. A21TJRUUN4KGV for India
🌐 Marketplace / Region
BASE_URL
CURRENCY_CODE
Must match this client's Amazon Ads account currency
📡 Live Report Data optional
Demo mode
REPORT_JSON_URL
Raw GitHub URL to docs/report_<PROFILE_ID>.json — generated daily by GitHub Actions. Leave blank to use built-in demo data.
Scope & Safety
Control which campaigns are affected and enable dry run mode for safe testing.
Run Mode
DRY_RUN
Logs all actions — makes ZERO changes to Amazon
⚠️ Always start with Dry Run on. Review changes_*.csv before going live.
🎯 Campaign Allowlist
Optional
Leave empty to run across all active campaigns. Add IDs to limit scope — recommended when going live for the first time.
Campaign IDs (press Enter to add)
One campaign ID at a time. Remove with ×
🔍 Profile Finder
FIND_PROFILE_ID
Enable once to print all Profile IDs, then disable
Target Rules
Each rule has its own lookback window, attribution buffer, conditions and action. Rules are evaluated in order — first match wins for each target.
ℹ️
How rules work: For each target, rules are checked top-to-bottom. When ALL conditions in a rule are met, the action fires and no further rules are checked for that target. Drag to reorder priority.
No rules yet
Rule Presets
Click any preset to add it as a new rule. You can edit all values after adding.
High ACoS → Decrease Bid
For targets with sufficient data where ACoS is too high — reduce the bid to bring costs down.
5-day window 1-day buffer ACoS ≥ 35% Decrease 20%
Low ACoS → Increase Bid
For targets performing well below target ACoS with good order volume — push more traffic.
5-day window 1-day buffer ACoS ≤ 15% Increase 10%
Low Impressions → Increase Bid
Targets getting almost no visibility — raise bids to compete for impressions. Logic Example 2.
30-day window 1-day buffer Clicks ≤ 5 Impr ≤ 500
High Spend + Zero Orders → Pause
Targets burning budget with no conversions over a long window. Logic Example 3.
30-day window 1-day buffer Spend ≥ $15 Pause
Very High ACoS → Pause
Hard ceiling — if ACoS is extreme and there are confirmed orders, pause immediately.
14-day window 7-day buffer ACoS ≥ 70% Orders ≥ 1
Strong Performer → Increase Bid
Targets with solid orders and very efficient ACoS over a longer settled window — scale aggressively.
14-day window 7-day buffer Orders ≥ 5 ACoS ≤ 20%
Dayparting & Weekparting
Spreadsheet view — one row per portfolio. Day columns = absolute $ budget. Hour columns = % of that day's budget (must sum to 100). Dollar amount shown in red is the computed spend for that hour slot.
API Settings
Reliability and performance settings for the Amazon Ads API connection. These live in CONFIG in the script.
⚙️ Timeouts & Retries
REPORT_POLL_TIMEOUT_SECONDS
Max seconds to wait for a report (Amazon can be slow)
REPORT_POLL_INTERVAL_SECONDS
Seconds between poll attempts
API_MAX_RETRIES
Retries on 429/5xx errors
API_RETRY_BACKOFF_SECONDS
Base backoff — doubles each retry attempt
API_WRITE_DELAY_SECONDS
Delay between write calls to avoid rate limits
TOKEN_REFRESH_INTERVAL_MINUTES
Refresh access token every N minutes (expire at 60min)
MAX_TOTAL_BUDGET_REDUCTION_PCT (%)
Safety cap — max collective budget cut allowed per run
Export Config
Complete generated Python file — CONFIG block (credentials, API settings) + TARGET_RULES. Download and replace your script.
This exports the full CONFIG dict and TARGET_RULES list together. Paste both blocks into amazon_ads_optimizer_v3.py, or download the combined file.
Full Python Config
Change Log
Every manual and automated change to Target Rules and Dayparting — one entry per action. Expand an entry for full detail, or download as CSV.
No changes recorded yet. Add or edit a rule or dayparting row to start logging.
Reporting Dashboard
Real-time SP API metrics — KPI cards, breakdown tables, budget pacing, charts, and annotations.
DATE RANGE
COMPARE TO
Export
KPI CARDS
VISUALIZATIONS
Add KPI Card
Configure Widget
Portfolio · hr_09
%
0
0.5
4.17
8.33
10
25
50
90.5
⚙ Client Account Manager
🔍
No clients added yet
Go to Credentials, enter a client's Ads API credentials, and click Discover Marketplaces. Repeat for each client.
CLIENT GROUP
MARKETPLACE
ACCOUNT LABEL
💡
Use this only if Discover didn't find a specific account. Enter Profile ID and credentials manually in the Credentials tab after adding.
⏱ Session expiring soon
Your session will expire due to inactivity.