DEV Community

Cover image for How to get search volume from Google API without paying
SerpScraper.dev
SerpScraper.dev

Posted on Originally published at serpscraper.dev

How to get search volume from Google API without paying

After years of architecting internal search marketing engines, I’ve repeatedly encountered the same engineering challenge: developers trying to fetch raw keyword volume programmatically without racking up massive enterprise API bills. Let's address the technical reality of accessing this data stream, what it actually costs, and how to build a stable integration pipeline.

The Technical Reality of Google's Data Pipelines

Many teams look for undocumented endpoints or try scraping the Keyword Planner (GKP) web UI. From my experience, scraping GKP is a high-maintenance trap. Google constantly rotates CSS selectors, implements sophisticated bot detection, and will quickly rate-limit your proxies.

The only reliable access is via the Google Ads API (specifically the KeywordPlanIdeaService). While Google does not charge per API request, there is a catch: to retrieve exact, granular search volumes instead of broad, useless ranges (e.g., "10K - 100K"), your linked Google Ads developer account must have an active billing profile and historical campaign spend. If you try to query it on a completely cold, zero-spend account, you will only receive bucketed approximations.

Setting Up the Infrastructure

To communicate with the API, you need to establish a secure authorization chain. Here is the blueprint I use:

  1. GCP Project: Create a project in the Google Cloud Console and enable the Google Ads API.
  2. OAuth2 Credentials: Configure your consent screen and generate a Client ID and Client Secret.
  3. Developer Token: Apply for a token via your Google Ads Manager Account (MCC). Note that basic access is typically approved quickly.
  4. Billing Link: Ensure your Google Ads account has an active billing method and a history of small ad runs.

Programmatic Execution with Python

Do not try to write raw REST requests. The Google Ads API relies heavily on gRPC and Protobuf serialization. Always use the official client library.

Here is a conceptual architecture of how I structure our keyword fetch services:

from google.ads.googleads.client import GoogleAdsClient

# Load credentials securely from configuration
client = GoogleAdsClient.load_from_storage("google-ads.yaml")
keyword_service = client.get_service("KeywordPlanIdeaService")

# Define your request payload
request = client.get_type("GenerateKeywordIdeasRequest")
request.customer_id = "YOUR_ADS_CUSTOMER_ID"
request.keyword_plan_network = client.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH

# Add seed keywords for volume retrieval
request.keyword_seed.keywords.extend(["api integration", "backend performance"])

# Execute request (simplified)
# response = keyword_service.generate_keyword_ideas(request=request)
Enter fullscreen mode Exit fullscreen mode

Scaling & Rate Limit Mitigation

When processing keywords at scale, you will quickly hit API quotas. To avoid 429 Too Many Requests exceptions, implement these two strategies in your code:

  • Batching: Don't query keywords one by one. Group up to 1,000 keywords into a single request. This drastically reduces network overhead and token usage.
  • Exponential Backoff: Wrap your API calls in a retry loop using a backoff algorithm to handle temporary throttling gracefully.

Understanding the Data Output

Finally, remember that Google does not return precise, real-time counters. The metrics are 12-month averages mapped to roughly 80 logarithmic bands. Treat this data as relative search intent rather than exact transactional logs. Ensure your data pipeline caches these results locally to minimize redundant API calls and stay within your developer token's rate limits.


Originally published at How to get search volume from Google API without paying

Top comments (0)