Amazon Scraper API

How to Scrape Amazon Data into Google Sheets in 2026

Updated at

Getting Amazon prices, titles, and stock status into Google Sheets sounds like a five-minute job. Paste =IMPORTXML(url, xpath) and you are done. In reality, IMPORTXML on Amazon breaks within hours, the formula returns #N/A the next morning, and the price column silently falls out of date before anyone notices. The reliable path is a short Google Apps Script that calls a scraper API, writes the results back to the sheet, and runs on a time-based trigger.

This guide covers all three methods (IMPORTXML, raw Apps Script fetching, and Apps Script with a scraper API), explains why the first two fail on Amazon specifically, and ships a working Apps Script you can paste into any sheet. The script uses the Amazon Scraper API from $0.50 per 1,000 requests on Custom plans ($0.90 on pay-as-you-go) with 1,000 free on signup, which handles Amazon’s CAPTCHA, proxy rotation, and marketplace routing on its side.

The Answer

IMPORTXML works for 5 minutes then breaks because Amazon serves robot check HTML instead of product pages to Google Sheets’ backend. Google Apps Script fetching Amazon directly fails for the same reason. The working setup is Apps Script plus a scraper API: paste ASINs or product URLs in column A, run a script that calls the Amazon Scraper API for each row, write the title, price, and availability back in columns B through D, and schedule it to run daily via a time-based trigger. Full script below.

Why Scrape Amazon Data Into Google Sheets?

You scrape Amazon data into Google Sheets to keep a living, shared spreadsheet of prices, stock status, and Buy Box sellers for a watchlist of ASINs, without building a full backend or database. For small catalogs under 5,000 SKUs, Google Sheets is the simplest tool that still supports automated refreshes, charts, conditional formatting alerts, and team access. Sellers use it to watch competitor pricing, MAP compliance teams use it to monitor unauthorized resellers, affiliates use it to spot commission-worthy deals, and procurement teams use it to catch price drops on regularly ordered supplies.

The trade-off against a real database or BI stack is volume and history depth. Google Sheets caps at 10 million cells per file and IMPORTXML-style functions have low quota limits, so anything above a few thousand ASINs refreshed hourly needs a proper backend. For the watchlist size that most small teams actually track (50 to 2,000 ASINs), Sheets plus a scraper API is the right size.

What Are the Three Ways to Pull Amazon Data Into Google Sheets?

There are three ways to pull Amazon data into Google Sheets: the IMPORTXML formula, a Google Apps Script that fetches Amazon directly, and a Google Apps Script that calls a managed scraper API. Only the third works reliably, but understanding why the first two fail helps you recognize the failure mode when a tutorial claims they still work.

The three methods differ on four axes that matter in practice: success rate on Amazon, data depth per request, refresh frequency, and setup complexity.

MethodSuccess rate on AmazonData fieldsRefresh frequencySetup complexity
IMPORTXML formula~5 to 20% within a daySingle field per formulaEvery 30 to 60 min (Google-controlled)Low
Apps Script + direct fetch<10%FlexibleAny (trigger-based)Medium
Apps Script + scraper API98%+Full product detailAny (trigger-based)Medium

The low success rates for the first two methods are not a configuration problem. They are the expected outcome of hitting Amazon from Google’s own shared IP ranges with a non-browser TLS fingerprint. No amount of XPath tuning fixes that.

How Do You Use IMPORTXML for Amazon in Google Sheets?

You use IMPORTXML for Amazon in Google Sheets by passing the product URL and an XPath expression that targets the price, title, or any other element in the product HTML. The formula runs on Google’s backend servers, fetches the URL, parses the response as HTML, and returns the matched text to the cell. The syntax is simple, but the reliability is not.

What IMPORTXML Formula Returns the Amazon Price?

The IMPORTXML formula that returns the Amazon price uses the a-offscreen class, which holds the fully formatted price string (currency symbol plus amount) in Amazon’s product HTML:

=INDEX(IMPORTXML(A2, "//span[@class='a-offscreen']"), 1)

A2 is the cell containing the product URL. The //span[@class='a-offscreen'] XPath matches all hidden price spans on the page, and INDEX(..., 1) pulls only the first match, which is almost always the Buy Box price. For the title, swap the XPath to //span[@id='productTitle']. For the rating, use //span[@id='acrPopover']/@title.

These formulas work the moment you paste them. If you refresh an hour later, about 80% of them return #N/A. By the next day, virtually all of them do.

Why Does IMPORTXML Stop Working on Amazon?

IMPORTXML stops working on Amazon because Amazon detects the request as coming from Google’s backend IPs with a non-browser TLS fingerprint and returns a “Robot Check” page instead of the product HTML. The CAPTCHA page contains no #productTitle, no a-offscreen price, and no rating element, so every XPath-targeted IMPORTXML formula returns #N/A. The HTTP status is still 200, so Google Sheets treats the response as “successful but empty” and shows the #N/A error rather than a fetch failure.

Three things compound the problem. First, the IP range Google uses for IMPORTXML is shared across every Sheets user in the world, so Amazon has already flagged those IPs through sheer request volume from other users. Second, Google Sheets has no mechanism to present cookies, rotate IPs, or impersonate a browser TLS fingerprint. Third, Amazon ships HTML structure changes regularly, and even when IMPORTXML does reach the real page, a class rename from a-offscreen to a-price-whole or the reverse breaks every formula pointed at the old selector.

The practical consequence: IMPORTXML is a demo tool for one-off lookups on sites that do not run anti-bot detection. It is not a production path for Amazon.

How Do You Pull Amazon Prices Into Google Sheets With Apps Script?

You pull Amazon prices into Google Sheets with Apps Script by writing a JavaScript function that reads ASINs or URLs from the sheet, calls a scraper API for each one, parses the returned JSON, and writes the results back to the adjacent cells. Apps Script is a cloud-based JavaScript environment built into Google Workspace, which means there is nothing to install and no external server to maintain. Functions can be bound to custom menus, triggered on a schedule, or exposed as formulas.

Fetching Amazon directly from Apps Script with UrlFetchApp.fetch() fails for the same reason IMPORTXML does: Google’s egress IPs and non-browser TLS fingerprint get served the robot check. The fix is not to fight Amazon from inside Apps Script. The fix is to call a scraper API endpoint that already solves Amazon’s anti-bot layer.

How Do You Extract the ASIN From an Amazon URL?

You extract the ASIN from an Amazon URL with a regular expression that matches the /dp/ or /gp/product/ path segment followed by a 10-character alphanumeric identifier. Amazon URLs come in several forms: amazon.com/dp/B08N5WRWNW, amazon.com/gp/product/B08N5WRWNW, and the long form with product slug amazon.com/Echo-Dot-4th-Gen/dp/B08N5WRWNW/ref=.... A single regex handles all three.

function extractAsin(urlOrAsin) {
 if (/^[A-Z0-9]{10}$/.test(urlOrAsin)) return urlOrAsin;
 const match = urlOrAsin.match(/\/(?:dp|gp\/product)\/([A-Z0-9]{10})/i);
 return match ? match[1].toUpperCase() : null;
}

The function first checks if the input is already a 10-character ASIN and returns it unchanged. Otherwise it looks for the ASIN inside the URL. Support both inputs in the same column so users can paste either the full URL or the raw ASIN and the script handles both.

How Do You Call an Amazon Scraper API From Apps Script?

You call an Amazon scraper API from Apps Script with UrlFetchApp.fetch() pointed at the API endpoint, passing the ASIN and API key as query parameters. Apps Script egress is allowed for external HTTPS fetches, and the scraper API handles the Amazon side of the request. Here is a complete working script that reads ASINs from column A, pulls product data for each row, and writes title, price, and stock to columns B, C, and D:

const API_KEY = "asa_live_YOUR_KEY";
const ENDPOINT = "https://api.amazonscraperapi.com/api/v1/amazon/product";
const DOMAIN = "com"; // Amazon marketplace TLD - "com", "co.uk", "de", "fr", etc.

function refreshAmazonPrices() {
 const sheet = SpreadsheetApp.getActiveSheet();
 const lastRow = sheet.getLastRow();
 if (lastRow < 2) return;

 const inputs = sheet.getRange(2, 1, lastRow - 1, 1).getValues();
 const output = [];

 for (const [raw] of inputs) {
 if (!raw) { output.push(["", "", ""]); continue; }
 const asin = extractAsin(String(raw).trim());
 if (!asin) { output.push(["Invalid input", "", ""]); continue; }

 try {
 const url = `${ENDPOINT}?query=${asin}&domain=${DOMAIN}`;
 const resp = UrlFetchApp.fetch(url, {
 method: "get",
 headers: { Authorization: `Bearer ${API_KEY}` },
 muteHttpExceptions: true,
 });
 const code = resp.getResponseCode();
 if (code !== 200) { output.push([`HTTP ${code}`, "", ""]); continue; }

 const data = JSON.parse(resp.getContentText());
 output.push([
 data.title || "",
 data.price != null ? data.price : "",
 data.stock || "",
 ]);
 } catch (e) {
 output.push([`Error: ${e.message}`, "", ""]);
 }
 Utilities.sleep(200);
 }

 sheet.getRange(2, 2, output.length, 3).setValues(output);
 sheet.getRange(1, 2, 1, 3).setValues([["Title", "Price", "Stock"]]);
}

function extractAsin(urlOrAsin) {
 if (/^[A-Z0-9]{10}$/.test(urlOrAsin)) return urlOrAsin;
 const match = urlOrAsin.match(/\/(?:dp|gp\/product)\/([A-Z0-9]{10})/i);
 return match ? match[1].toUpperCase() : null;
}

Open any Google Sheet, go to Extensions -> Apps Script, paste the code, replace asa_live_YOUR_KEY with the key from your Amazon Scraper API dashboard, save, and run refreshAmazonPrices. The first run will prompt for authorization so Apps Script can read and write to the sheet and make external HTTPS calls. For 100 ASINs, the script finishes in about 5 minutes against the sequential loop shown here; production scripts can parallelise with UrlFetchApp.fetchAll up to the plan’s concurrency ceiling (10 on Free, 30 on Vibe, 50 on Pro, higher on Custom).

How Do You Schedule the Script to Run Automatically?

You schedule the script to run automatically with an Apps Script time-based trigger, which fires on an interval you choose (every minute, hour, day, or week). Open the Apps Script editor, click the clock icon in the left sidebar to open the Triggers panel, click Add Trigger, select refreshAmazonPrices as the function, pick Time-driven, and choose the interval.

For price monitoring, hourly or every-6-hours triggers are the sweet spot. Daily is enough for MAP compliance checks. Every-5-minutes is available but adds up on the API cost (a 1,000-ASIN watchlist at 5-minute refresh consumes 288,000 requests per day). Set the trigger to Day timer -> Between 3am and 4am for daily catalog refreshes that run off business hours. Apps Script triggers are reliable for this use case, and the dashboard logs every execution with success, skipped, or error status.

How Do You Get Price Drop Alerts in Google Sheets?

You get price drop alerts in Google Sheets by storing yesterday’s price in an adjacent column, comparing it against the refreshed price, and using conditional formatting to highlight drops plus an Apps Script email notification on threshold breaches. The core pattern is a second column (E) that captures =C2 before the refresh runs, and a formula column (F) that computes =(E2-C2)/E2 as the percent drop.

Conditional formatting on column F catches the visual pattern: custom formula =F2>0.1 with a green fill flags anything that dropped 10% or more overnight. For email alerts, add an extension to the Apps Script:

function emailPriceDrops() {
 const sheet = SpreadsheetApp.getActiveSheet();
 const rows = sheet.getDataRange().getValues();
 const drops = [];

 for (let i = 1; i < rows.length; i++) {
 const [url, title, price,, prevPrice, pctDrop] = rows[i];
 if (typeof pctDrop === "number" && pctDrop >= 0.10) {
 drops.push(`${title}: $${prevPrice} -> $${price} (${Math.round(pctDrop * 100)}% off)`);
 }
 }

 if (drops.length === 0) return;
 MailApp.sendEmail({
 to: Session.getActiveUser().getEmail(),
 subject: `Amazon price drops: ${drops.length} items`,
 body: drops.join("\n"),
 });
}

Schedule emailPriceDrops as a second time-based trigger that runs 5 minutes after the price refresh. The mailbox owner gets a daily digest of products that dropped 10% or more. Swap the threshold for a product-specific target price by adding a “target” column and comparing the refreshed price against that.

What About Amazon’s Official Product Advertising API?

The Amazon Product Advertising API (PA-API 5.0) is the official way to pull Amazon product data, but access is gated behind an approved Amazon Associates account that has produced qualifying affiliate sales in the last 180 days. New associates cannot call the API until they drive their first three qualifying sales, and existing associates lose access if their sales volume drops. For non-affiliate use cases (MAP compliance, competitor monitoring, supplier pricing) the PA-API is practically unavailable.

When PA-API is available to you, the advantage is direct, structured data with no HTML parsing and no anti-bot concerns. The disadvantages are rate limits (default 1 request per second per associate), limited field coverage (no Buy Box seller name, no per-variant price grid, no review text), and the affiliate-account dependency. For any team that is not actively running an Amazon affiliate site, a scraper API like Amazon Scraper API is the faster and more reliable path.

Scraping Amazon into Google Sheets for public product data is generally legal in the United States, based on the Ninth Circuit’s ruling in hiQ Labs v. LinkedIn, which established that scraping publicly accessible data does not violate the Computer Fraud and Abuse Act. The ruling covers prices, titles, ratings, and any other field that a logged-out browser can see. It does not cover data behind a login, the Buy Box API, or any scraping that involves fake account creation.

Amazon’s Conditions of Use prohibit automated access, which is a contract matter separate from federal law. The practical consequence is that Amazon can ban IPs, cancel accounts, and send cease-and-desist letters, but it cannot criminally prosecute scrapers of public product data in the United States. For teams operating commercially, the defensible posture is to scrape only what a logged-out user can see, respect rate limits and robots.txt, and avoid any workflow that requires an Amazon login. This is not legal advice, and teams operating at scale should consult counsel in their jurisdiction.

FAQ

Does IMPORTXML work on Amazon at all? IMPORTXML briefly works on some Amazon URLs in some regions for some time windows, but it is not reliable. Over a 24-hour window the success rate drops below 20% because Amazon serves robot check HTML to the Google Sheets backend IPs. Use it for one-off lookups, not a monitoring dashboard.

Can I scrape Amazon reviews into Google Sheets? Reviews are harder than prices because most review text now sits behind a login wall (Amazon changed this on November 5, 2024), leaving only 3 to 8 featured reviews visible to logged-out scrapers. The aggregate rating, review count, and star distribution are still accessible and are the metrics most teams actually need for the sheet.

How much does it cost to run a 500-ASIN daily refresh? At 500 ASINs refreshed once per day, you spend 500 requests per day, or 15,000 requests per month. On the Amazon Scraper API at $0.50 per 1,000 successful requests, the monthly cost is $7.50. The 1,000 free signup requests cover the first two days of a 500-ASIN watchlist.

Can I scrape multiple Amazon marketplaces into the same sheet? Yes. Add a marketplace column (US, UK, DE, FR, etc.) and pass it as the marketplace parameter in the API call. The Amazon Scraper API supports 20+ marketplaces, and the prices come back in local currency automatically.

Why does my Apps Script fail with “Exceeded maximum execution time”? Apps Script has a 6-minute execution limit for simple triggers. For watchlists above roughly 500 ASINs, batch the work across multiple trigger runs or use UrlFetchApp.fetchAll() to parallelize requests, which reduces the total execution time by running up to 25 concurrent fetches.

Can I use the same approach for Walmart, eBay, or Shopify? Yes. The Apps Script pattern (read input column, call an API, write result columns, schedule a trigger) is identical for any scraper API. The Amazon Scraper API is Amazon-specific, but the same architecture with a different endpoint covers Walmart, eBay, and most large e-commerce sites.

Sources