Price scraper in Google Sheets: build a Black Friday price tracker

In short: A price scraper in Google Sheets needs three parts: IMPORTXML to read the price from static product pages (or a browser extension for JavaScript pages), a History tab where you paste dated snapshots, and formulas for % change and the 30-day low. Conditional formatting then highlights every drop before Black Friday.
Black Friday 2026 falls on November 27. A deal only means something if you know what the product cost before, and stores change prices often in the weeks before the sale. A small tracker in Google Sheets gives you that history. Start it this week and you will have more than 30 days of prices by Black Friday.
What do you need before you start?
- A Google account and a new spreadsheet.
- A short watchlist: the product name and the URL of each public product page.
- Sites whose terms allow automated reading of their pages: your own store, a supplier's catalog, or competitor shops that permit it. Check each site's terms of use and its
robots.txtfile first.
Stay on public pages. Only track pages anyone can see without an account. Never log in for a script, solve CAPTCHAs, or work around blocks or rate limits. Many large marketplaces forbid automated data collection in their terms, so leave them out. This is general information, not legal advice; for more, read is web scraping legal?
Step 1: Set up the Tracker and History tabs
The formulas in Step 2 always show the current price and overwrite the old one. The History tab is where old prices survive.
- Rename the first tab Tracker. In row 1, type these headers from A to H: Date, Product, Price, URL, Raw price, Last logged, Change, 30-day low.
- In
A2, enter=TODAY(). Type a product name inB2and paste its page address inD2. Add one row per product, and fill the=TODAY()formula down column A to every product row. - Add a second tab named History with three headers: Date, Product, Price. Leave the rest empty.
- Use exactly the same product names in both tabs. The formulas match rows by name.

Step 2: Pull the price with IMPORTXML
IMPORTXML reads a page through Google's servers and returns the elements that match an XPath query. Many product pages mark the price with structured data, so try this in E2 first:
=INDEX(IMPORTXML(D2, "//*[@itemprop='price']/@content"), 1)
If that returns #N/A, find the price element yourself:
- Open the product page, right-click the price and choose Inspect.
- Right-click the highlighted node and choose Copy > Copy XPath.
- Paste it as the second argument of
IMPORTXML, and change any double quotes inside it to single quotes.
The raw result is often text such as $1,299.00. Turn it into a number in C2:
=IFERROR(VALUE(REGEXREPLACE(TO_TEXT(E2), "[^0-9.]", "")), "")
This keeps only digits and the decimal point, so $1,299.00 becomes 1299. It assumes prices with a decimal point and a US-locale spreadsheet. If the page shows the sale price and the old price in one element, point the XPath at the sale price only. Google lists a one-hour recalculation interval for IMPORTXML, so the price refreshes on its own.
If the formula returns nothing for every XPath you try, the page probably draws its prices with JavaScript after it loads. Google fetches the raw HTML, so the price is not there for the formula to see. Our guide to scraping data into Google Sheets covers the other common errors.
| Page type | Method | Updates |
|---|---|---|
| Static HTML | IMPORTXML | About hourly |
| JavaScript-rendered | Browser extension | When you run it |
| Three or four items | Copy by hand | When you check |
Step 3: Save a dated snapshot to the History tab
Do this once a day, or a few times a week:
- On the Tracker tab, select
A2:Cdown to your last product. - Copy it, then click the first empty cell in column A of the History tab.
- Choose Edit > Paste special > Values only (
Ctrl+Shift+V). The date becomes fixed, and so does each price. - Format History column C as a number with two decimals.
Each paste adds one row per product. After a few weeks, you can filter History by product and chart any price over time.
Step 4: Add % change and lowest-price formulas
Back on the Tracker tab, add three formulas in row 2 and fill them down.
Last logged price
In F2, find the most recent price in History before today:
=IFERROR(INDEX(SORT(FILTER(History!A$2:C, History!B$2:B=B2, History!A$2:A<A2), 1, FALSE), 1, 3), "")
% change
In G2, compare today's price with that value, and format the column as a percentage:
=IFERROR(IF(OR(C2="", F2=""), "", (C2-F2)/F2), "")
A kettle that was logged at $54 and now costs $44 shows -18.52%.
Lowest price in the last 30 days
In H2:
=IF(COUNTIFS(History!B$2:B, B2, History!A$2:A, ">="&(A2-30))=0, "", MINIFS(History!C$2:C, History!B$2:B, B2, History!A$2:A, ">="&(A2-30)))
The COUNTIFS check stops the cell from showing 0 when a product has no history yet. The 30-day low is the number to watch. In the EU, as a general rule, a store that announces a price reduction on a product must show its prior price, defined as the lowest price it applied during a period of at least 30 days before the reduction (Article 6a of Directive 98/6/EC). Member States may set different rules for perishable goods, new products, and progressive reductions. In the US, the FTC's Guides Against Deceptive Pricing say a former price is a legitimate basis for a comparison when it is the actual, bona fide price at which the item was offered to the public on a regular basis for a reasonably substantial period of time. Your own history lets you check a Black Friday "was" price against what you actually saw.
Highlight drops with conditional formatting
- Select
C2:Con the Tracker tab and open Format > Conditional formatting. - Under Format rules, choose Custom formula is and enter
=AND(ISNUMBER($C2), ISNUMBER($F2), $C2<$F2). Pick a green fill. This marks any drop since the last snapshot. - Click Add another rule, enter
=AND(ISNUMBER($C2), ISNUMBER($H2), $C2<=$H2), and choose bold text. This marks a price at or below its 30-day low.
How to do it with ScrapeSheet
If IMPORTXML works on your pages, you do not need an extension. It helps when the prices are drawn with JavaScript, or when you want a whole category page in one go. ScrapeSheet reads the page as your browser shows it. Our price monitoring page shows the full workflow.
- Install ScrapeSheet from the Chrome Web Store and pin it.
- Open the product or category page you want to track.
- Click the ScrapeSheet icon to open the panel, then click Extract. It detects the tables and lists on the page on its own.
- Copy the result to the clipboard and paste it into a spare tab, or export a CSV file.
- Copy the product names and prices into History, add the date in column A, and paste as values. If prices arrive with currency symbols, clean them with the
REGEXREPLACEformula from Step 2.
Know the limits. The free plan exports up to 20 rows per export and one page per run. ScrapeSheet Pro (€12.99 per month) removes the row limit and follows pagination and infinite scroll; see how to scrape multiple pages. ScrapeSheet also has a price monitoring mode that reads the list on screen and spots the cheapest option. The free plan lets you try each mode, and Pro unlocks them all. The extension runs when you click it; it does not check prices on a schedule.
More step-by-step guides are on the ScrapeSheet blog.
FAQ
Can Google Sheets track prices automatically?
Partly. IMPORTXML refreshes the current price on its own, and Google lists a one-hour recalculation interval for it. It does not keep old values, so you need to paste dated snapshots into a History tab to build a price history.
Why does IMPORTXML return #N/A for a price?
Usually the XPath does not match, or the page draws its prices with JavaScript after loading. Google fetches the raw HTML, so script-added prices are invisible to the formula. Try another XPath, or extract the rendered page with a browser extension.
Is there a free price tracking tool for a spreadsheet?
Google Sheets itself is free, and IMPORTXML plus the formulas in this guide cover static product pages. ScrapeSheet has a free plan that exports up to 20 rows per export from one page per run, which is enough for a short watchlist.
How do I know if a Black Friday discount is real?
Compare the sale price with your own 30-day low for that product. If the price rose shortly before the sale, the discount is smaller than it looks. In the EU, stores that announce a reduction must show the lowest price they applied in at least the previous 30 days, with some national exceptions.
Sources
- Directive 98/6/EC on price indication, consolidated text, Article 6a (EUR-Lex)
- 16 CFR Part 233, Guides Against Deceptive Pricing (eCFR)
General information, not legal advice. Always check the website's terms and the data-protection rules that apply to you.