GSC_TOP_QUERIES
Get top search queries from Google Search Console sorted by clicks.
=GSC_TOP_QUERIES(startDate, endDate, [limit], [siteUrl])Returns: 2D array with columns: Query, Clicks, Impressions, CTR, Position
Overview
GSC_TOP_QUERIES pulls your top-performing search queries directly from the Google Search Console API into Google Sheets. The function returns a comprehensive table of metrics including the query text, clicks, impressions, click-through rate (CTR), and average position for each keyword your site ranks for. Results are sorted by clicks in descending order, making it easy to identify which search terms drive the most traffic to your site.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
startDate | string | Yes | Start date in "YYYY-MM-DD" format or relative format like "-30d" for 30 days ago. |
endDate | string | Yes | End date in "YYYY-MM-DD" format or relative format like "-1d" for yesterday. |
limit | number | No (100) | Maximum number of rows to return. Defaults to 100, max 25000. |
siteUrl | string | No | The site URL property from Search Console. If omitted, uses the default connected property. |
Examples
Last 30 days top queries
Retrieve the top 100 search queries from the last 30 days using relative date format.
=GSC_TOP_QUERIES("-30d", "-1d")Output
| Query | Clicks | Impressions | CTR | Position |
| best project management tools | 1240 | 18500 | 6.7% | 3.2 |
| project management software | 980 | 22100 | 4.4% | 5.1 |
| free task manager | 870 | 15300 | 5.7% | 4.8 |
Top 10 queries for a specific month
Get only the top 10 queries for January 2025.
=GSC_TOP_QUERIES("2025-01-01", "2025-01-31", 10)Output
| Query | Clicks | Impressions | CTR | Position |
| online invoice generator | 2100 | 31000 | 6.8% | 2.9 |
| free invoice template | 1850 | 28400 | 6.5% | 3.4 |
| invoice maker | 1620 | 25800 | 6.3% | 4.1 |
Full export for a specific property
Export up to 25,000 queries from the last 90 days for a specific Search Console domain property.
=GSC_TOP_QUERIES("-90d", "-1d", 25000, "sc-domain:example.com")Output
| Query | Clicks | Impressions | CTR | Position |
| example product review | 5400 | 82000 | 6.6% | 2.1 |
| example vs competitor | 3200 | 45000 | 7.1% | 3.5 |
| buy example online | 2800 | 38000 | 7.4% | 2.8 |
Last 7 days quick overview
Get a quick snapshot of the top 20 queries from the past week for a weekly review.
=GSC_TOP_QUERIES("-7d", "-1d", 20)Output
| Query | Clicks | Impressions | CTR | Position |
| meal prep ideas | 340 | 5200 | 6.5% | 4.2 |
| healthy lunch recipes | 290 | 4800 | 6.0% | 5.1 |
| quick dinner recipes | 265 | 4100 | 6.5% | 3.8 |
Use Cases
Weekly SEO Performance Report
Marketing agencies pull top queries weekly to track client keyword performance, identify ranking improvements, and report on organic search ROI in automated dashboards.
Content Gap Analysis
Editorial teams analyze top queries to discover which topics drive the most search traffic and identify high-impression, low-CTR keywords that need better content or meta descriptions.
E-commerce Product Discovery
Online retailers monitor top search queries to understand how customers find their products, identify trending product searches, and optimize product page titles and descriptions.
Competitor Keyword Benchmarking
SaaS companies export top queries monthly to compare against competitor keyword lists, identify market positioning opportunities, and inform paid search strategy.
Seasonal Trend Detection
Travel companies compare top queries across different time periods to identify seasonal search trends and plan content calendars around peak booking periods.
Pro Tips
Use relative dates like "-30d" and "-1d" to create dashboards that always show the latest data without needing to update date cells manually.
Combine with VLOOKUP or INDEX/MATCH against a previous period's export to calculate week-over-week or month-over-month changes in clicks and position.
Filter the results for queries where impressions are high but CTR is below 3% to find your best opportunities for improving title tags and meta descriptions.
Export 25,000 rows quarterly and use pivot tables to track long-tail keyword trends that may not appear in a shorter top-100 view.
If you manage multiple sites, use the siteUrl parameter to pull data for each property into separate tabs of the same spreadsheet for easy comparison.
This function is essential for SEO professionals who need to regularly monitor keyword performance without manually logging into Google Search Console. You can specify custom date ranges using standard date formats or convenient relative dates like "-30d" for the last 30 days or "-7d" for the past week. The optional limit parameter lets you control how many rows are returned, from a focused top-10 list to a comprehensive export of up to 25,000 queries.
By combining GSC_TOP_QUERIES with other spreadsheet formulas, you can build powerful SEO dashboards that automatically refresh with the latest data. Track week-over-week or month-over-month changes in keyword rankings, identify trending queries, and spot opportunities where you have high impressions but low CTR. The data returned matches exactly what you would see in the Search Console Performance report, but with the added flexibility of being inside a spreadsheet where you can sort, filter, pivot, and chart the data however you need.
Common Errors
NOT_AUTHORIZED: Access to Search Console property deniedCause: The Google account connected to Unlimited Sheets does not have access to the specified Search Console property.
Fix: Ensure your Google account has at least "Full" permission on the Search Console property. Go to Search Console > Settings > Users and permissions to verify access. If using a domain property, make sure you have verified ownership.
INVALID_DATE: Start date must be before end dateCause: The startDate is after the endDate, or one of the dates is in an invalid format.
Fix: Check that your dates are in "YYYY-MM-DD" format and that the start date comes before the end date chronologically. When using relative dates, remember that "-30d" means 30 days ago (earlier) and "-1d" means yesterday (later).
PROPERTY_NOT_FOUND: No Search Console property connectedCause: No default Search Console property has been set and no siteUrl was provided.
Fix: Either provide the siteUrl parameter explicitly (e.g., "sc-domain:example.com") or connect a default property through the Unlimited Sheets Search Console sidebar (Extensions > Unlimited Sheets > Search Console).
Frequently Asked Questions
Google Search Console retains data for the last 16 months. You can use any date range within that window. Dates can be specified in "YYYY-MM-DD" format or as relative dates like "-30d" (30 days ago), "-7d" (7 days ago), or "-1d" (yesterday). The most recent data available is typically from 2-3 days ago due to Google's processing delay.
You can retrieve up to 25,000 queries per request by setting the limit parameter. The default is 100 if no limit is specified. For sites with more than 25,000 ranking queries, consider using GSC_QUERY with date dimension to split data across multiple date ranges.
Results are always sorted by clicks in descending order, showing your highest-traffic queries first. If you need a different sort order, you can use Google Sheets' SORT function on the returned data, for example =SORT(GSC_TOP_QUERIES("-30d", "-1d"), 5, TRUE) to sort by position ascending.
The siteUrl should match your Search Console property exactly. For domain properties use "sc-domain:example.com". For URL-prefix properties use the full URL like "https://www.example.com/". If omitted, the function uses the default property you connected during setup.
Minor discrepancies are normal and can occur due to data sampling, timezone differences, or rounding. The API data and the Search Console UI use the same underlying dataset, but aggregation methods may produce slightly different totals. For the most accurate comparison, ensure you are using the exact same date range and property.
Yes, GSC_TOP_QUERIES works with automated sheets and scheduled refreshes. However, be mindful of API quota limits if you have many formulas refreshing simultaneously. For dashboards with multiple GSC functions, consider using manual refresh triggers or staggering refresh times.
If there is no search performance data for the specified date range (for example, the site was not yet verified or had no impressions), the function returns an empty result with only the header row.
No, GSC_TOP_QUERIES returns only web search data by default. Google Discover and Google News have separate data types in the Search Console API. Use GSC_QUERY with appropriate search type filters if you need Discover or News data.
Related Functions
GSC_TOP_PAGES
Get top pages from Google Search Console sorted by clicks.
GSC_PAGE_QUERIES
Get search queries driving traffic to a specific page.
GSC_KEYWORD_POSITION
Get average position for a specific keyword from Google Search Console.
GSC_QUERY
Custom Google Search Console query with full control over dimensions and filters.
Start using GSC_TOP_QUERIES today
Install Unlimited Sheets to get GSC_TOP_QUERIES and 41 other powerful functions in Google Sheets.