gads_keyword_ideas
Google Ads read low risk
Part of the Keyword Research Agent.
What it does
Generate keyword ideas with REAL Google search metrics (KeywordPlanIdeaService.GenerateKeywordIdeas) from seed keywords and/or a URL: avg_monthly_searches, competition (LOW/MEDIUM/HIGH) + competition_index, low/high top-of-page bid (returned in micros -> divide by 1e6 for currency), and recent monthly search-volume trend. Also fetches exact historical metrics for the seed keywords (GenerateKeywordHistoricalMetrics). All numbers are live Google data — never estimate or modify them. The account currency (customer.currency_code) is fetched once and returned as targeting.currency_code so the micros can be labelled; bids themselves are returned in micros. Read-only; rate-limited (~1 QPS). Returns {keyword_ideas:[...], seed_keyword_metrics:[...], targeting}.
When to use it
When the user asks for NEW keyword suggestions or ideas from a seed keyword, topic, or landing-page URL. ALSO the competitor-keyword tool: to discover which keywords a competitor could rank or bid on, pass their paid landing page as `url` — no separate competitor keyword tool exists, this is it.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. Its currency is returned as targeting.currency_code. |
keywords | array | no | Seed keywords. Provide keywords and/or url; at least one required. seed_keyword_metrics (GenerateKeywordHistoricalMetrics) is returned only when keywords are given. |
url | string | no | Seed URL (site/page) for idea expansion. At least one of keywords/url required. |
language_id | string | no | Language constant ID (default '1000' = English). |
location_ids | array | no | Geo target constant IDs (default ['2840'] = United States). |
network | string | no | GOOGLE_SEARCH (default) or GOOGLE_SEARCH_AND_PARTNERS. |
include_adult_keywords | boolean | no | Default false. |
page_size | integer | no | Max ideas to return (default 50). |
manager_id | string | no | Optional MCC login-customer-id. |
Safeguards
Policy
Keyword volumes and bids are Google's real data — present them verbatim, never fabricate or round into invented numbers. Do not surface adult keywords unless explicitly requested. Research only; targeting on these keywords is a separate write.
Reminder
Report Google's live volumes/bids exactly; never estimate or hallucinate keyword metrics.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
VALIDATION_ERROR | Neither keywords nor url provided, or invalid network. | Provide at least one seed keyword or a URL; use a valid network enum. | no |
RESOURCE_EXHAUSTED | KeywordPlanIdeaService rate limit (~1 QPS) or daily quota exceeded (HTTP 429). | Exponential backoff 5/10/20s (cap 60s), honor retryDelay, and serialize requests (avoid bursts). | yes |
INVALID_ARGUMENT | Bad language_id/location_id/seed. | Surface the platform message; correct the targeting IDs. | no |
TOKEN_REVOKED | OAuth token expired/revoked. | Refresh and retry once; else prompt reconnect (needs_reauth). | yes |
CUSTOMER_NOT_FOUND | Customer ID not found/accessible. | Verify the CID is authorized. | no |
PERMISSION_DENIED | No access or out-of-bearer-scope read. | Confirm read access; else refuse. | no |
INTERNAL_ERROR | Transient Google server error (5xx). | Retry after backoff. | yes |
Edge cases
- Bids are micros -> divide by 1e6 before display; format with the account currency.
- avg_monthly_searches can be 0 or null for niche terms -> report as 0/unknown, don't invent.
- competition may be UNKNOWN/UNSPECIFIED -> surface as UNKNOWN.
- ~1 QPS limit -> serialize and back off; don't burst.
- No ideas returned (too-narrow seed) -> success with empty list and a note.
- Volumes are rounded buckets by Google and may differ slightly from the UI's own rounding.
- Expired token -> refresh once and retry.