How to pull data from a website into Google Sheets
Maksim Norkin (opens in a new tab)Product
· 8 min read
How to pull data from a website into Google Sheets: the four import functions, how often they refresh, why they come back empty, Excel's From Web, and the manual route.
What the page holds, and the function that reads it
If you're working out how to pull data from a website into Google Sheets, start with the four import functions Sheets already has. Each one reads a different kind of thing from a page's address: a table or a list, one element, a CSV file, or a feed. This guide covers all four from Google's own help, read on 30 October 2026, says how often they refresh and why they sometimes come back empty, does the same for Excel's From Web, and ends with the manual route for pages you have to sign in to see.
Pick the function by what the page holds. Each takes the address in quotation marks, with its https://, or a cell that holds it.
| Function | What it reads | What you give it |
|---|---|---|
| IMPORTHTML | A table or a list on a page | The address, "table" or "list", and which one, counting from 1 |
| IMPORTXML | Whatever an XPath query picks out of a page, such as every link | The address, the query, and optionally a locale |
| IMPORTDATA | A .csv or .tsv file at an address | The address |
| IMPORTFEED | An RSS or Atom feed | The address, and optionally what to return, a header row, and how many items |
Google's IMPORTHTML help gives the shape: the address, the word "table" or "list", and which one on the page you want, counting from 1.
=IMPORTHTML("https://rates.example/fees", "table", 1)Tables and lists are counted separately, so a page can have a table 1 and a list 1. If the first one is the wrong table, try 2, then 3. The count follows the page's HTML source, not only what you notice on screen. To copy a table by hand instead, our guide to table capture extensions shows how.
When what you want isn't a table, IMPORTXML takes an XPath query: a short path that picks parts of a page by their tags. Google's own example returns the address of every link on a page. The second line below returns a page's main heading.
=IMPORTXML("https://en.wikipedia.org/wiki/Moon_landing", "//a/@href")
=IMPORTXML("https://shop.example/lamp", "//h1")A third, optional argument sets the language and region used to read the data; leave it out and the sheet's own locale is used. Google's help links to an introduction to XPath if you need more than these two. If you see "Result too large", narrow the query so it returns less.
IMPORTDATA reads a .csv or .tsv file at an address, and nothing else. If a site gives you a download link for its CSV, that link may be all the formula needs. IMPORTFEED reads an RSS or Atom feed. Its second argument picks what comes back: "items" (the default) for a row per item, "feed" for the feed's own title and description, or one field such as "items title" or "items url". Then TRUE for a header row, and how many items you want, newest first.
=IMPORTDATA("https://reports.example/orders.csv")
=IMPORTFEED("https://news.example/feed", "items title", TRUE, 10)- 1Every hourWhile the file is open
- 2Reopening doesn’t refresh itNor does reloading the tab
- 3To refresh it at onceDelete the formula and add it back
Google's page on how import functions work says they check for updates every hour while the file is open, and its calculation settings page gives the same hour for all four, and 30 minutes for IMPORTRANGE, which reads another spreadsheet. The rest is worth knowing before you rely on one:
- Reopening the file does not refresh it. Neither does reloading the browser tab. Deleting the formula and adding it back, or typing the same formula over it, does.
- A formula can't lean on NOW or RAND. An import may not reference NOW, RAND, RANDARRAY or RANDBETWEEN, directly or through another cell, so the old trick of adding one to force a refresh gives an error. TODAY is the exception, since it changes once a day.
- The first import asks first. A banner says the sheet will send and receive data from outside parties, and every import in it waits until you choose Allow access. Google says you can't take that back afterwards except through version history, and that you have to allow it from a desktop browser.
- There are limits. They count against whoever created the file, across all their open files, and a collaborator's edit can count too. Too many imports at once and you see "Loading data may take a while because of the large number of requests."
So an import is a sheet that reads the page again about once an hour while someone has it open. For a price list or a public table that changes slowly, that's usually plenty.
- The rows arrive after the page loads. Google's help counts tables and lists "in the HTML source". If you see the rows in your browser but the formula finds nothing, open your browser's View page source and search for one of them. If it isn't there, the page fills its rows in after it loads, and the import never sees them.
- The page needs you signed in. Google's help doesn't say an import can use your sign-in. If the same formula works on a public page and comes back empty or with an error on a page you can only see when signed in, treat that page as out of reach for it and use the manual route below.
- Your admin has blocked it. On a work or school account you may see a message asking you to contact your admin to allow imports from that address.
- 1Enter the addressData › From Web, then OK
- 2Pick a tableIn the Navigator, then Load
- 3Set the refreshThe query’s Properties, Usage tab
Excel's version is a connector rather than a formula. Microsoft's help on importing data from the web says it comes with an Office 365 subscription, and the steps are these, with details from the Power Query Web connector docs:
- Data › From Web. Choose Basic, enter the page's address and choose OK. Advanced builds the address from parts and adds a timeout and request headers.
- Say how to sign in. The first time, Excel asks: Anonymous for a page that needs no credentials, or Windows, Basic, Web API or Organizational account for a page that needs those.
- Pick the table. The Navigator lists the tables it found, and Web View highlights them on the page. If what you want isn't a table, Add Table Using Examples lets you type sample values for each column instead.
- Load it, or shape it first. Load puts it on the sheet; Transform Data opens it in the Power Query Editor.
Unlike Sheets, Excel lets you choose how often it refreshes. Microsoft's help on refreshing an external data connection puts it under Data › Queries & Connections: on the Connections tab, right-click the query and choose Properties. On the Usage tab, tick Refresh every and enter the minutes, or tick Refresh data when opening the file. That help describes these settings for desktop Excel, not Excel for the web.
If the page is one you sign in to with your own account in the browser, and none of Excel's sign-in choices matches how the site signs you in, the connector may not reach it either. The route below works the same for Excel.
The formula
Copied by hand
- 1Look for its exportThen File › Import in Sheets
- 2Or copy the listPaste values only
- 3Copy again for newer rowsA pasted copy stays as it was
For a list in a site you use, such as your orders, your project's issues or a report in an admin panel, work down this list and stop at the first step that gets you the rows.
- Look for the site's own export. Next to the list, in a "⋯" menu, or under Settings or Reports. Download it as CSV or XLSX, then in Sheets choose File › Import and pick the file. Google's import help lists the options, from Insert new sheets to Append rows to current sheet, and the file can't be password-protected.
- Copy the list into the sheet. Set the filters and sort first, select from the first row to the last, and paste as values only. If it lands as one long column, our guide to exporting data from a website to CSV or XLSX shows how to fold it back into rows.
- Do it again when you need newer rows. A pasted or imported copy stays as it was. Append rows to current sheet adds the next file under the last, so check the join for rows you already had. To stack several downloads before you import them, merge the CSV files into one.
For some sites we have the steps written out: Google Search Console, Jira, Shopify orders and Airtable. Whichever route you take, it's for lists you're entitled to see, for your own work, and the site's own rules still apply.
Tabless is a browser extension that builds what you ask for from the sites you allow; nothing is typed or submitted without your OK. It isn't open yet.
It's designed for the pages the import functions can't reach. You ask in plain words for the list you want, such as "the open invoices in my billing dashboard, with customer, amount and due date", and it reads that page through the session your browser already has, asking before it reads each site, and builds a view you can download as CSV or XLSX for your sheet. Opening the view again is designed to read its pages again. What it reads to build a view goes to Tabless's server and an AI provider. It's for lists you're entitled to see, for your own work, and the site's own rules still apply. You sign in to Tabless with a Wix account.
From a page anyone can open, yes. Google's help says the import functions check for updates every hour while the file is open. Reopening the file doesn't refresh them, and you can't force a refresh with NOW or RAND. To refresh one at once, delete the formula and add it back.
Usually one of three things: the number points at another table or list, so try the next; the page fills in its rows after it loads, so they aren't in its source; or the page needs you signed in. For the last two, copy the rows by hand or use the site's own export.
Yes, in desktop Excel. In the query's Properties, on the Usage tab, tick Refresh every and enter the minutes, or Refresh data when opening the file. Microsoft's help doesn't describe either setting for Excel for the web.
Not yet. Tabless isn't open, and getting a list out of a site you use, as a file for your sheet, is among the jobs we're building it for. Join the waitlist, and we'll let you know when you can try Tabless.