7 Ways to Check Keyword Position with Google's APIs (and What Each One Actually Tells You)
This guide explains seven ways to handle a Google API check keyword position task, covering the Search Console API for organic data, the Google Ads API for paid data, and practical workarounds. Each method states what it measures and what it misses, so you can report rank numbers accurately.
If you've typed "google api check keyword position" into a search box, you probably want one of two things: organic rank data for a site, or a read on where your ads show for a keyword. Google doesn't offer a single rank checker API for either. What it offers are several data sources that each answer a slightly different question, and mixing them up is how people end up reporting numbers that don't mean what they think.
The seven approaches below map the real options: the Search Console API for organic, the Google Ads API for paid, a few workarounds, and what to do with the results. Each one says what it tells you, what it doesn't, and how to set it up without tripping over the usual traps.
1. Search Console API average position
This is the closest Google gets to organic rank data. The searchAnalytics.query method returns clicks, impressions, CTR, and position for your own verified property, broken out by query, page, country, device, and date. "Position" here is the average of the topmost position your site held across the impressions it received. It is not a live ranking, and it will never match what you see when you search yourself.
For example (illustrative), suppose a 28-day pull by query and page shows "ppc audit checklist" at an average position of 7.3 with 1,200 impressions. That tells you the page is usually on page one, often around the middle, and that people are seeing it. It doesn't tell you it ranks seventh today for any particular searcher.
To pull it:
- Enable the Search Console API in a Google Cloud project.
- Set up OAuth credentials and authorize with an account that has access to the property.
- Confirm the property URL matches exactly what's in Search Console (domain property versus URL-prefix property are different).
- Send a searchAnalytics.query request with a start and end date, the dimensions you want (for example query and page), and a row limit.
- Paginate using startRow until a response returns fewer rows than your limit.
The common mistake is treating the average as an exact live ranking. A page can sit at position 1 for one searcher and position 12 for another, and the average blends both. Personalization, location, device, and SERP features all move it. Also note that the API only returns a limited window of history (roughly 16 months, as of this writing, so check Google's documentation), which is why strategy 4 matters.
What to measure: the position trend for clusters of related queries over time, read alongside impressions and CTR. A rising impression count with a slightly worse average position is often good news, because you've started appearing for more queries further down the page.
2. Google Ads API keyword position metrics
Paid visibility works differently. Google Ads retired its old "average position" metric in 2019 (confirm the details in Google Ads Help), and if you go looking for it in the API you'll waste an afternoon. The replacement is a set of impression share and position-bucket metrics, which tell you how often your ad appeared in the top areas of the results compared to how often it could have.
You query them with GAQL, the Google Ads Query Language, a SQL-like syntax for pulling reports. The keyword_view resource gives you performance by keyword (a keyword being the thing you bid on, as opposed to the search term someone typed).
For example (illustrative), imagine a keyword with 30% absolute top impression share. Your ad is rarely the very first result. If lost impression share due to rank is high, the limit is bid or Quality Score. If it's mostly lost to budget, the fix is spending, not relevance.
- Apply for and receive a developer token through a Google Ads manager account.
- Authenticate with OAuth and set your customer ID (and login customer ID if you work through an MCC).
- Run a GAQL query selecting the keyword text, match type, and the search top and absolute top impression share metrics, plus lost impression share due to rank, filtered to a date range.
Field names and API versions change, so check the current reference rather than copying a query from an old blog post. That's the pitfall: people search for the retired average position metric, find forum answers from years ago, and build on fields that no longer exist.
What to measure: search top impression share, search absolute top impression share, and lost impression share due to rank. Watch them per keyword, and weigh them against conversion value so you don't chase top position on terms that don't pay.
3. search_term_view for matched queries
Keyword-level position tells you how a keyword performs. It doesn't tell you what it's actually showing for. The search_term_view resource in the Google Ads API returns the real queries that triggered your ads, which is the same data as the Search Terms Report in the interface. Search terms are what people typed; keywords are what you bought. Those two lists drift apart, especially on phrase and broad match.
Suppose (illustrative) a phrase match keyword shows a surprisingly high impression count. Pull the search terms and you find a chunk of the impressions come from queries that have nothing to do with your offer. The keyword's "visibility" was inflated by irrelevant matches, so the impression share story you built in strategy 2 needs a caveat.
To work with it:
- Query search_term_view with the search term text, status, impressions, clicks, cost, and conversions, segmented by date.
- Include the ad group (and campaign) so you can tie each term back to where it matched.
- Sort for high-impression, low-conversion terms and review them manually.
The mistake to avoid is assuming these totals reconcile with keyword-level reports. Google applies privacy thresholds, so some low-volume queries are hidden, and the search term rows won't always add up to the keyword totals. Don't treat a gap as a bug in your pipeline.
What to measure: the share of impressions and spend going to relevant terms versus irrelevant ones. If a meaningful slice of spend sits on terms you'd never choose, that's your first cleanup target.
4. Scheduled reporting pipeline
One-off pulls answer "where are we now?" but not "did that content update help?" The fix is a pipeline that saves a snapshot every day. This matters most for Search Console, where the API only keeps a limited window of history, so anything you don't store is eventually gone.
For example (illustrative), an agency stores a daily snapshot of query and page data per client. When a client rewrites a service page, the team can chart the average position for that page's queries before and after the change, rather than guessing from memory.
Your options, roughly from lightest to heaviest:
- Apps Script into Google Sheets: fine for a handful of properties and modest row counts.
- BigQuery bulk data export: Search Console offers a bulk export to BigQuery, and Google Ads data can be moved there too through its transfer options. Check current availability and setup in each product's documentation.
- A scheduled script or cloud job that calls the APIs and writes to a database you control.
Whichever you pick, schedule it daily, write rows with a date stamp, and build one dashboard that charts position trend lines per query cluster.
The classic mistake is pulling data only when a client asks, which leaves you with a hole exactly where the interesting period was. Start collecting before you need it.
What to measure: pipeline completeness, meaning the number of days with no gaps, and then the trend lines themselves. A dashboard with missing days produces misleading slopes.
5. Third-party SERP APIs
If you need a genuine live rank, meaning "where does this URL appear for this keyword, in this city, on this device, right now," Google's own APIs won't give it to you. The Custom Search JSON API is not a substitute: it doesn't mirror what google.com returns to real users, and its availability and quotas have changed, so verify its current status before relying on it. This is where SERP data vendors come in.
For example (illustrative), checking a local service keyword in three cities might show your position ranging from 2 in one to 8 in another. Search Console would blend those into a single average and hide the spread.
- Choose a vendor and read its pricing and limits.
- Define a tight keyword list, plus the location and device for each check.
- Schedule checks at a frequency that matches how fast the rankings move for you (weekly is plenty for many sites).
- Store results with a timestamp, location, and device so they stay comparable.
Two mistakes come up repeatedly. The first is ignoring terms of service and compliance: scraping Google directly is against its terms, and vendors differ in how they source data, so ask. The second is paying to track thousands of low-value keywords because the tool makes it easy.
What to measure: cost per tracked keyword, and how far the vendor's numbers diverge from your Search Console averages. Some divergence is expected, since one is a point-in-time check and the other is an average across real impressions. Wild gaps are a reason to investigate.
6. Segment by brand, non-brand, and intent
An average position across every query on a site is almost always misleading. Branded queries tend to rank at or near position 1, and they usually have the most impressions, so they drag the blended number toward flattering.
For example (illustrative), a blended position of 6 looks healthy. Split it, and brand queries sit at 1.2 while non-brand queries sit at 13, which is page two. The second number is the one that reflects your SEO and content work.
In the Search Console API, you can do this at the request level with dimensionFilterGroups. Add a filter on the query dimension using the excludingRegex operator with your brand name and common misspellings. Then group what remains by intent, for example:
- Informational (how to, what is, template)
- Commercial investigation (best, vs, alternatives, pricing)
- Transactional (buy, hire, near me, trial)
You can build these clusters with simple regex patterns first, and refine by hand where the patterns misfire.
The mistake is reporting a blended average to clients. It either hides a problem or takes credit for rankings you'd have anyway. Report brand and non-brand separately, always.
What to measure: non-brand average position, and clicks by intent cluster. Position improvement on informational terms with no clicks matters less than a modest gain on transactional terms.
7. Act on data in the Search Terms Report
Position data is only useful if it changes something in the account. The Search Terms Report is where organic and paid data meet: it shows what people searched that triggered your ads, and you can compare it against the queries Search Console says you appear for organically.
For example (illustrative), a query shows high organic impressions with a weak average position. It's clearly a relevant, demand-bearing term where organic isn't winning yet. That's a candidate for a new exact match keyword in a paid campaign. Meanwhile, queries in the Search Terms Report that clearly don't fit your offer become negative keywords, which block those searches from triggering your ads.
- Export or review your Search Console queries with their positions and impressions.
- Compare them with the Search Terms Report for the same period.
- Add the relevant, high-intent terms as keywords and choose a match type on purpose (exact for proven terms, phrase where you want controlled variation).
- Add junk terms as negatives at the right level: ad group, campaign, or a shared list.
Doing this one term at a time through spreadsheets is slow. Keywordme is a Chrome extension that works inside the Search Terms Report, so you can add keywords, apply match types, and add negatives without leaving the Google Ads interface. It's an option, not a requirement. You still decide what gets added; it just removes the copying and pasting.
The mistake is the most common one: collecting position data, building a lovely dashboard, and never changing the account. Set a recurring review, and treat each pass as a short list of actions.
What to measure: wasted spend on irrelevant terms (before and after), and conversions from the keywords you newly added.
Which to start with, and how they fit together
Start with the question you actually have. For organic, begin with the Search Console API. For paid, begin with the Google Ads impression share metrics. Add segmentation next, because it makes both datasets more honest, and set up the daily storage early so history builds while you work on everything else. Only pay for a SERP API if you truly need live, location-specific rank, and then keep the keyword list short.
Then close the loop by acting on what you found in the Search Terms Report. That's the step that turns reporting into results.
Optimize Google Ads Campaigns 10X Faster. Without Leaving Your Account. Keywordme lets you remove junk search terms, build high-intent keyword lists, and apply match types instantly, right inside Google Ads. No spreadsheets, no switching tabs, just quick, seamless optimization. Start your free 7-day trial (then just $12/month) and take your Google Ads game to the next level.