Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🛒 Scrape Amazon product prices and sync them automatically with Google Sheets for easy monitoring.

License

NotificationsYou must be signed in to change notification settings

Decodo/amazon-price-scraping-google-sheets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python VersionLicense

Step-by-step guide to scraping Amazon prices into Google Sheets.

What is Amazon Price Scraper?

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.

✨ Features

  • 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.

🚀 Quick start

ImportXML (no-code solution)

  1. Open Google Sheets and create two columns:
  • Column A: Product URL
  • Column B: Price
  1. Add an Amazon product URL to cell A2.
  2. Use this formula in cell B2:
=INDEX(IMPORTXML(A2,"//span[@class='a-offscreen']"),1)
  1. Copy the formula down for multiple products.

Python API (Advanced)

  1. Install Requests:
pip install requests
  1. Get your authentication token from theDecodo dashboard.
  2. Run the scraper:
python amazon_scraper.py

📦 Installation

Prerequisites

Step-by-step setup

  1. Clone the repository:
git clone https://github.com/Decodo/amazon-price-scraper-google-sheets.git cd amazon-price-scraper-google-sheets
  1. Install Python dependency:
pip install requests
  1. Get your Decodo auth token from thedashboard and update it in the Python script.

🛠️Methods

Method 1: ImportXML formula

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

Method 2: Google Apps Script

For more control and scheduled updates within Google Sheets.

  1. Open Extensions → Apps Script in Google Sheets
  2. Copy and paste the providedgoogle_apps_script.js code
  3. Save and run the script to populate price data
  4. 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.

Method 3: Python API

For large-scale operations with advanced anti-blocking capabilities.

  1. Pull the code:
git pull https://github.com/Decodo/amazon-price-scraping-google-sheets/blob/main/amazon_scraper.py
  1. Replace the placeholders:
  • [YOUR_AUTH_TOKEN] - Your Decodo API authentication token.
  • B084ZGRDM5 - The Amazon ASIN you want to scrape.

📊 Output Example

image

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

📁 Project structure

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

🔧 Configuration

Python API authentication

Get your authentication token from theDecodo dashboard:

  1. Sign up for a Decodo account.
  2. Navigate to theScraping APIs section.
  3. Choose a plan (7-day free trial available).
  4. Copy your auth token and replace[YOUR_AUTH_TOKEN] in the code.

ASIN vs URL

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.

⚠️ Limitations & best practices

  • 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.

🆘 Troubleshooting

Common Issues

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

📖 Documentation

For advanced usage and tips, check out the completeblog post andAPI documentation.

📝 License

This project is licensed under theMIT License.

🔗 Related repositories

Explore more web scraping tools:

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2026 Movatter.jp