IMPORTXML and Google Trends: why it fails and what works
You pasted a Google Trends link into IMPORTXML and got #N/A. Here is why, and how to get the numbers into Google Sheets anyway.
Why IMPORTXML returns nothing
IMPORTXML, IMPORTHTML and IMPORTDATA read the page exactly as the server sends it. Google Trends sends an almost empty page, then draws the charts in your browser with JavaScript. The functions never run that JavaScript, so there is nothing for an XPath to find.
The CSV you download from a Trends chart does not help either: its address is generated for your browser session and stops working, so IMPORTDATA on it fails sooner or later.
The options in 2026
- Download the CSV by hand from each chart, then import it. Fine once, tedious every week.
- The official Google Trends API: still an alpha in October 2026, open only to testers Google selects (Google's page).
- Unofficial Python libraries and scripts: they need code, a place to run it, and they break when Google changes its pages.
- A Sheets add-on that does the request for you and returns the value in a cell. That is what SheetSonar does.
One formula instead of IMPORTXML
=SONAR_TREND("e-bike", "US")
returns the average Google Trends interest (0–100) over the last 12 months. Two more arguments choose the period and what you get back:
=SONAR_TREND("e-bike", "US", "3m"): the last 3 months. Also1m,5y,7d,1d,all, or two dates such as"2025-01-01 2025-06-30".=SONAR_TREND("e-bike", "US", "12m", "last"): the latest complete week instead of the average.=SONAR_TREND("e-bike", "US", "12m", "curve"): the whole curve, dates and values, ready for a chart.=SONAR_TREND(A2:A20, "GB"): a whole column of keywords at once (up to 50).
Leave the country empty to use the spreadsheet's country, or write "world".
Start from a template
The keyword research template has five keywords with their 12-month average, their latest week and the momentum between the two. Download it (CSV), then in Google Sheets: File › Import › Upload › Replace current sheet.
Good to know
- Each keyword is scored on its own scale, like a single-term search on Google Trends: 100 is its own peak. To compare the volume of several keywords on one scale, use Extensions › SheetSonar › Google Trends report… (up to 5 keywords in one comparison).
- A fresh search can take up to a minute; the cell shows ⏳ meanwhile.
- Cells showing
#NAME?in a new spreadsheet: open Extensions › SheetSonar › My quota once and they recalculate. - The free plan gives 20 results a month (one keyword is one result). The same keyword asked again within 12 hours (1 hour for
7dand1d) is not counted twice, whatever the last argument.