Step-by-step guide to scraping Amazon prices into Google Sheets.
Amazon Price Scraper for Google Sheets is a comprehensive tool to extract product prices from Amazon and automatically import them into Google Sheets. Track price changes, monitor competitor pricing, and set up automated alerts using multiple scraping methods - from simple ImportXML formulas to advanced Python APIs with proxy rotation.
Perfect for eCommerce businesses, deal hunters, market researchers, and anyone who needs real-time Amazon price tracking directly in their spreadsheets.
- Multiple scraping methods. Choose from ImportXML, Google Apps Script, or Python API based on your technical needs and scale requirements.
- Real-time price tracking. Monitor Amazon price fluctuations automatically with scheduled updates and instant notifications.
- Anti-blocking measures. Built-in proxy rotation and browser fingerprinting to avoid IP bans and CAPTCHAs.
- Google Sheets integration. Seamlessly import structured price data directly into spreadsheets for analysis and reporting.
- Bulk price extraction. Process multiple products simultaneously with support for thousands of ASINs and product URLs.
- Historical price analysis. Track price trends over time and identify optimal buying opportunities.
- Open Google Sheets and create two columns:
- Column A: Product URL
- Column B: Price
- Add an Amazon product URL to cell A2.
- Use this formula in cell B2:
=INDEX(IMPORTXML(A2,"//span[@class='a-offscreen']"),1)
- Copy the formula down for multiple products.
- Install Requests:
pip install requests
- Get your authentication token from the Decodo dashboard.
- Run the scraper:
python amazon_scraper.py
- Python 3.8+ (for Python API method)
- Google Account with Google Sheets access
- Decodo API credentials (for Python API method)
Step-by-step setup
- Clone the repository:
git clone https://github.com/Decodo/amazon-price-scraper-google-sheets.git
cd amazon-price-scraper-google-sheets
- Install Python dependency:
pip install requests
- Get your Decodo auth token from the dashboard and update it in the Python script.
The simplest approach using Google Sheets built-in functions.
Basic formula:
=INDEX(IMPORTXML(A2,"//span[@class='a-offscreen']"),1)
With error handling:
=IFERROR(INDEX(IMPORTXML(A2,"//span[@class='a-offscreen']"),1),"Price not found")
Limitations:
- Daily usage limits
- May not work with all Amazon pages
- Amazon's anti-bot measures can block requests
For more control and scheduled updates within Google Sheets.
- Open Extensions β Apps Script in Google Sheets
- Copy and paste the provided
google_apps_script.jscode - Save and run the script to populate price data
- Set up triggers for automated daily updates
The script automatically:
- Fetches URLs from Column A.
- Extracts prices using regex patterns.
- Updates Column B with price data.
- Handles errors gracefully.
For large-scale operations with advanced anti-blocking capabilities.
- Pull the code:
git pull https://github.com/Decodo/amazon-price-scraping-google-sheets/blob/main/amazon_scraper.py
- Replace the placeholders:
[YOUR_AUTH_TOKEN]- Your Decodo API authentication token.B084ZGRDM5- The Amazon ASIN you want to scrape.
The scraper extracts structured price data, including:
- Product title and description
- Current price and original price
- Availability status
- Product ratings and review count
- Seller information
amazon-price-scraper-google-sheets/
βββ π amazon_scraper.py # Python API scraper
βββ π google_apps_script.js # Google Apps Script code
βββ π README.md # Documentation
βββ π LICENSE # MIT License
Get your authentication token from the Decodo dashboard:
- Sign up for a Decodo account.
- Navigate to the Scraping APIs section.
- Choose a plan (7-day free trial available).
- Copy your auth token and replace
[YOUR_AUTH_TOKEN]in the code.
The Python API uses ASINs (Amazon Standard Identification Numbers):
- Find the ASIN in the product URL:
amazon.com/dp/B084ZGRDM5 - Use just the ASIN:
B084ZGRDM5
Google Apps Script and ImportXML use full product URLs.
- ImportXML limitations. Google Sheets has daily limits and may not work with JavaScript-heavy pages.
- Rate limiting. Add delays between requests to avoid IP blocks.
- Anti-detection. Use the Python API method for large-scale scraping as it includes proxy rotation.
- Structure changes. Amazon updates its HTML structure regularly, which may break ImportXML selectors.
ImportXML shows #N/A:
- Try alternative selectors or add error handling
- Amazon may be blocking the request
Google Apps Script returns "Price not found":
- Check if the URL is accessible
- Amazon's anti-bot measures may be active
Python API authentication error:
- Verify your auth token is correct
- Check if your account has an active plan
For advanced usage and tips, check out the complete blog post and API documentation.
This project is licensed under the MIT License.
Explore more web scraping tools:

