How to Build an n8n Amazon Keyword Rank Tracker with ScrapeHero Cloud

Share:

Tracking Amazon keyword rankings manually takes too much time. Build an n8n Amazon keyword rank tracker to automate the process and see where products rank for the keywords you care about without checking search pages yourself.

This tutorial shows how to build an n8n workflow that:

  1. Reads target keywords from Google Sheets
  2. Fetches Amazon search results for each keyword through ScrapeHero’s Amazon Search API
  3. Maps the data, including each product’s rank, into sheet columns
  4. Compares the new results with the existing records, then updates existing rows, adds new products, and deletes outdated listings

What You’ll Learn

  • How to build an Amazon keyword rank tracker in n8n using ScrapeHero’s Amazon Search API
  • How to read keywords from Google Sheets and process them one at a time with the Loop Over Items node
  • How to extract the rank field by splitting the search_results array into individual products
  • How to compare new results with existing rows using the Merge node, and update the sheet with Append or Update Row
  • How to delete outdated rows from the bottom up to avoid row-shifting bugs in Google Sheets

Before You Begin

Before creating the n8n Amazon keyword rank tracker, prepare the following:

  1. An n8n account or self-hosted n8n installation.
  2. A Google Cloud OAuth client ID and client secret.
  3. A Google Sheets document with a sheet containing keywords. And a sheet for each of those keywords.
  4. A ScrapeHero account and API key.

The sheet containing keywords needs one column with one search term per row:

Google sheet containing a list of keywords

Each sheet corresponding to the keywords should contain eight columns.

  1. ASIN
  2. Rank
  3. Name
  4. Sale Price
  5. Review Count
  6. Monthly Sales Volume
  7. Product URL
  8. Rating

Google Sheet showing the product listings for a specific keyword

 

Create the Workflow

1. Get the Keywords

On your n8n dashboard, click “Create Workflow” to open a new canvas with a big plus sign in the center.

Clicking create workflow on n8n dashboard

Click the plus icon in the center of the canvas. Search for “Schedule trigger” and select it.

Adding a Schedule Trigger node in an n8n workflow

Click the plus icon, search for Google Sheets, and click to add the node. For the Sheet action, choose Get Row(s) in Sheet.

Connecting a Google Sheet node with Get row(s) in sheet action

Next, click Connect to Google Sheets.

Clicking Connect to Google Sheets in an n8n Google Sheets Node

Paste your Google Cloud Client ID and Client Secret, then click Sign in with Google. Complete the authorization process and return to n8n.

Setting up Google Cloud credentials in an n8n Google Sheets node

Now select the Google Sheet document and the sheet inside it that contains the list of keywords. Then, click Execute Step to confirm that the keywords load.

Clicking Execute Step in an n8n Google Sheets node

2. Process Each Keyword Individually

Each keyword needs its own request to the ScrapeHero API. Processing them one at a time prevents rate-limit issues.

To do so, add a Loop Over Items node. Click the plus icon to the right of the Get Queries node, search for Loop Over Items, and click it. Set the Batch Size to 1.

Adding Loop Over Item in a n8n workflow

3. Add the ScrapeHero Node

Next, add the ScrapeHero node to the loop output of the Loop Over Items node. If you are adding the node for the first time, you need to install the ScrapeHero community node first.

Adding ScrapeHero node for n8n Amazon keyword monitoring

In the configuration window, click Connect ScrapeHero to create the credentials. Then:

  1. Go to app.scrapehero.com.
  2. Sign in to your account.
  3. Click your profile icon.
  4. Open API Key.
  5. Copy your API key.
  6. Return to n8n.
  7. Paste the key into the ScrapeHero credential field.
  8. Save the credentials

Pasting the ScrapeHero API key inside the ScrapeHero node

Next, select Amazon Search API from the API dropdown.

Locate the Keyword field and switch to the expression editor, or drag the Keyword value from the Loop Over Items node into it. You can also enter the expression directly:

{{ $json.Keyword }}

Select the Country Code. Use the Pages field to fetch deeper results. Each extra page uses more credits, so keep the number small while testing.

Click Execute Step to test the request. After the test succeeds, pin the output temporarily so that repeated tests do not make unnecessary API requests.

Configuring ScrapeHero community node in N8N

4. Split the Search Results

The API returns a JSON object with a search_results array. Each item in the array includes fields such as asin, rank, name, sale_price, and product_url.

To output each product as its own item, add a Split Out node after the ScrapeHero node.

Adding Split Out node in an n8n workflow

In the Fields To Split Out box, enter ‘search_results’

Configuring Fields To Split Out in a Split Out node

5. Keep Only Essential Fields

The API returns a lot of data, but we don’t need all of it. Add an Edit Fields node that allows you to keep only the essential fields

Adding Edit Fields node in an n8n workflow

Drag these fields from the Split Out output into the “Drag input fields here” region.

  1. Keyword
  2. ASIN
  3. Rank
  4. Name
  5. Sale Price
  6. Product URL

Edit fields node showing configured fields in an n8n workflow

Update the Rankings

8. Update the Sheet

Add another Google Sheets node after the Edit Fields node and choose Append or Update Row in Sheet as the action.

Connecting a Google Sheet node with Append or update row in sheet action

Select the same document containing the keywords. For the sheet name, drag and drop the Keywords field from the output of the Loop Over Items node. Make sure the sheet is identified by name.

Then set Mapping Column Mode to Map Automatically. For the matching columns, choose ASIN.

Configuring an n8n Google Sheet node with Append or update row in Sheet action

Existing rows are updated with the latest rank and price, and new products are added.

Mapping fields under Values to Send in an Append or update row in sheet node

8. Find the Outdated Listings

The workflow so far updates the rankings and adds rows for products that appear on the first page. However, some products may also fall off the first page, and you need to remove those.

First, find the listings you need to remove. To do so, the workflow gets existing listings from the Google sheet. Then uses a Merge node to keep only those not in the new set of listings obtained with the ScrapeHero node.

Adding Google Sheets Node

Add a Google Sheets node after the Edit Fields node, with the action Get Row(s) in Sheet.

Connecting a Google Sheets node after the Edit Fields node with Get row(s) in sheet action

Select the Keyword Tracker document and the sheet containing the existing listings for the current keyword (drag and drop the name from the Loop Over Items node). Then, under Filters, add a filter on the Keyword column and set the value to the current keyword:

{{ $('Loop Over Items').item.json.Keyword }}

Configuring the Get row(s) in sheet node to get existing listings

This reads only the existing listings for the keyword being processed. The node also returns a row_number for each row, which you need for deletion later.

Adding a Merge Node

Add a Merge node. It has two inputs; connect the Edit Fields node (new data) to Input 1 and the Get Existing Listings node to Input 2.

Adding Edit Fields node (new data) to Input 1 and the Get Existing Listings node to Input 2 of the Merge node.

Configure it as follows:

  1. Set Mode to Combine, then Combine By to Matching Fields.
  2. Set the field to match as ASIN on both inputs.
  3. Set Output Type to Keep Non-Matches.
  4. Set Output Data From to Input 2.

The node now outputs only the rows that exist in your sheet but no longer appear in the new results. These are the outdated listings. You do not need a Code node to find them.

Setting Output Type and Output Data From in Merge node

9. Delete the Outdated Listings

Now remove the listings identified by the Merge node. Deleting rows from the top down shifts the row numbers in Google Sheets, so rows must be deleted from the bottom up.

Add a Sort node after the Merge node.

Adding a Sort node after the Merge node

Set the type to Simple, the Field Name option to row_number, and order to Descending.

Configuring the Sort node in an n8n workflow

Then add a Google Sheets node after the Sort node, and choose Delete Rows or Columns from Sheet as the action.

Adding a Google sheet node with Delete row(s) or column(s) action

Inside the node, select the Keyword Tracker document. And use these configurations.

  1. (By Name) Sheet:
     {{ $('Loop Over Items').item.json.Keywords }}
  2. To Delete: Rows
  3. Start Row Number:
    {{ $json.row_number }}
  4. Number of Rows to Delete: 1

Configuring the Google sheet node to delete rows in N8N

This ensures the node starts deleting from the item’s row number and deletes only one row, effectively removing just the row corresponding to that item.

Test and Complete the Loop

Connect the Loop

Connect the output of the Delete node back to the Loop Over Items node. This tells the loop to continue with the next keyword.

If a keyword has no outdated listings, the Merge node outputs nothing, and the loop stops early. To prevent this, turn on Always Output Data in the Merge node, and add a Filter node before the Sort node that keeps only items where row_number exists.

The complete workflow to track product listings using for specific keywords

Test the Workflow

Unpin all the pinned outputs and click Execute Workflow at the bottom of the canvas.

When the run finishes, open the Rankings tab. You should see each product with its keyword, ASIN, rank, name, price, and URL. Run the workflow a second time and confirm that existing rows are updated instead of duplicated.

What This n8n Amazon Keyword Rank Tracker Unlocks for Your Business

Building this workflow to track Amazon keyword rankings with n8n helps you:

  • Monitor rankings without manual checks. The workflow checks every keyword automatically, so you see ranking changes as soon as they appear in the sheet.
  • Validate SEO changes. Track rank movements after you update product titles or backend search terms.
  • Analyze share of voice. See how many placements your brand holds for core keywords compared with competitors.
  • Adjust PPC campaigns. Use organic ranking positions to decide where to pause or increase bids.
  • Watch competitor prices. The sale price is stored next to each rank, so you can see how competitors price the products that rank near yours.

Prefer not to handle API integration? Check out the ScrapeHero Cloud Amazon scrapers instead.

Next Steps

You can extend this n8n Amazon Keyword Rank tracker with:

  • Rank drop alerts: Add an If node after the Merge node or the Edit Fields node. If the rank of a key product moves beyond your chosen position, route the output to a Slack or Gmail node.
  • Rank history: Instead of updating and deleting rows, append each day’s rank to a separate History tab with a Google Sheets Append Row node. Skip the delete steps.
  • Scheduled runs: Add a Schedule Trigger before the Get Queries node to run the tracker daily.
  • Competitor monitoring: Use ScrapeHero’s Amazon Product Details and Pricing API to track changes in competitor prices and reviews.

Wrapping Up

Building your own n8n rank tracker gives you full control over your data. You can customize exactly which metrics matter to your Amazon business.

The ScrapeHero API, accessed via the ScrapeHero node, handles the data extraction part. You just have to focus on building the workflow that improves your business.

Sign up for a ScrapeHero API key and build your rank tracker. Do you want additional data points? Tell us your requirements, and we will build a custom API just for you.

ScrapeHero is your #1 web scraping service provider for fully outsourcing data extraction. If your data needs grow beyond a DIY workflow, our fully managed Amazon scraping services can build and maintain custom scrapers and deliver clean, structured data to your preferred databases. Contact ScrapeHero today to get started.

FAQs

What should you store if your ASIN isn’t in the results?

This workflow stores every product in the search results, so a product that drops out is removed by the delete step. If you want to track specific ASINs over time, log a default “unranked” value, such as 0 or above your page limit, in a separate History tab. That keeps the trend line continuous.

Should you count sponsored results when tracking Amazon rank?

It depends on what you want to measure. Excluding sponsored results gives you the organic rank. Including them shows the full share of voice and competitor ad activity. Check the API response for a field that marks sponsored listings, then filter on it or store it in its own column.

How do you handle pagination in n8n for Amazon search results?

Set the Pages parameter in the ScrapeHero node to fetch deeper results. You can also build a loop that follows the next_page value from the response.

Table of contents

Scrape any website, any format, no sweat.

ScrapeHero is the real deal for enterprise-grade scraping.

Clients love ScrapeHero on G2

Ready to turn the internet into meaningful and usable data?

Contact us to schedule a brief, introductory call with our experts and learn how we can assist your needs.

Continue Reading

Automate Amazon Rating Monitoring

How to Automate Amazon Rating Monitoring with n8n and ScrapeHero

Automate Amazon rating tracking with n8n and ScrapeHero.
Automate Google Maps Data Collection with n8n

How to Automate Google Maps Data Collection With n8n and ScrapeHero

Automate Google Maps scraping with n8n and ScrapeHero.
Automate Amazon product scraping with n8n

How to Automate Amazon Product Scraping With n8n and ScrapeHero

Automate Amazon price tracking with n8n
ScrapeHero Logo

Can we help you get some data?