Back to Search API in Excel
SheetXAI logo
Search API logo
Search API · Excel Guide

Pull Geo-Targeted Google Results for Query-City Pairs From a Excel workbook

2026-05-14
5 min read

The Scenario

Your agency handles local SEO for 12 clients across three service categories. Someone on the account team built a workbook three weeks ago with 20 rows — service queries in column A, target cities in column B. The ask was simple: pull the top 3 Google local pack results for each combination so the team could do a competitor NAP audit before Monday's client call.

That workbook has been sitting untouched because nobody had time to write the API calls.

The bad version:

  • Manually combine each query with its city, open Search API, configure the geo-targeting parameter, run the search, extract the local pack results from the response
  • Repeat for all 20 query-city pairs, keeping track of which row you're on
  • Reformat the three business names, addresses, and ratings from each search into the right columns without transposing two rows that look nearly identical

Monday's client call is in two days. The audit slide is still blank.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Excel workbook. It reads the query-city pairs you've already organized, understands the structure of the task, and through its built-in Search API integration it runs geo-targeted searches for each combination and writes the local pack data back into the workbook.

For each row in this workbook, combine the service query in column A with the city in column B and search Google using Search API targeted to that location — write the top 3 local pack result names into columns C, F, and I, their addresses into columns D, G, and J, and their ratings into columns E, H, and K.

What You Get

  • 20 rows of geo-targeted local pack data, with three competitor listings per row organized across named columns
  • Business names, addresses, and ratings written in the expected structure for a NAP audit
  • Results from Search API's location-targeted engine so the data reflects what someone in that city actually sees

What If the Data Is Not Quite Ready

Some cities in column B are ambiguous and could match multiple metros

For each row, combine the query in column A with the city name in column B and search Google using Search API with city-level geo-targeting — if the city name is ambiguous, default to the largest matching metro — then write the top 3 local pack result names, addresses, and ratings into columns C through K.

You also have state names in column C and want to use both city and state for precision targeting

For each row, combine the service query in column A with the city in column B and state in column C to build a geo-targeted Search API query, then write the top 3 local pack result names, addresses, and phone numbers into columns D, G, J, E, H, and K respectively.

You want results for multiple service categories per city, with each category getting its own grouped row block

For each unique city in column B, run a geo-targeted Google search for every service query associated with that city (column A), and write the top 3 local pack results per query into grouped rows below a city header row — include business name, address, and rating in the three adjacent columns.

You want to pull the local pack data, flag any results that appear across multiple query-city combinations, and note which queries a business dominates — all at once

For each row, run a geo-targeted Search API search combining columns A and B, write the top 3 local pack result names, addresses, and ratings into columns C through K, then scan the full result set and mark column L with "repeat listing" for any business name that appears in results for more than one query-city combination.

Asking for the deduplication check alongside the data pull saves a separate manual review pass.

Try It

Get the 7-day free trial of SheetXAI and open your local SEO research workbook with service queries in one column and target cities in another, then ask it to pull geo-targeted Google local pack results for every combination. Related reading: the Google Maps competitor research spoke or the Search API hub overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more