{
  "name": "Amazon Customer Review & Rating Summary Scraper - clean export",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "triggerAtHour": 8,
              "triggerAtMinute": 0
            }
          ]
        }
      },
      "id": "e283fa2d-aa52-4dd8-a4a0-59a390e534c9",
      "name": "Daily trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -80,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Edit this object for your run. The Actor's full input schema is linked in the sticky note.\nconst input = {\n  \"keywords\": [\n    \"wireless earbuds\"\n  ],\n  \"country\": \"amazon.com\",\n  \"maxProductsToDiscover\": 2,\n  \"maxReviews\": 20,\n  \"includeAggregates\": true\n};\n\nreturn [{ json: input }];"
      },
      "id": "69e69038-6f5a-466a-a4d0-cd251d3e96fa",
      "name": "Configure input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        160,
        0
      ],
      "notes": "Edit the input object for your city, keyword, URLs or limit."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/vexaloom-labs~amazon-customer-review-and-rating-summary-scraper/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "56aa6a28-ac20-40e1-a2d8-92b60c59c8f1",
      "name": "Run Apify Actor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        0
      ],
      "notes": "Select the Apify API Token (Query Auth) credential."
    },
    {
      "parameters": {
        "jsCode": "const rows = $input.all().flatMap((item) => (Array.isArray(item.json) ? item.json : [item.json]));\nconst failed = rows.find((row) => row && row.error && typeof row.error === 'object' && Object.keys(row).length === 1);\nif (failed) throw new Error(`Apify: ${failed.error.type || 'error'} ${failed.error.message || ''}`.trim());\nconst keyField = \"reviewId\"; // a stable identity from the Actor output\nconst kindField = rows.some((row) => row && row.recordType !== undefined) ? 'recordType' : null;\nconst scrapedAt = new Date().toISOString();\nconst seen = new Set();\nconst clean = [];\nfor (const row of rows) {\n  if (!row || typeof row !== 'object') continue;\n  const out = {};\n  for (const [k, v] of Object.entries(row)) {\n    if (v === null || v === undefined) continue;\n    out[k] = typeof v === 'string' ? v.trim() : v;\n  }\n  const value = keyField ? out[keyField] : undefined;\n  const id = (kindField ? `${out[kindField]}|` : '') + (value === undefined || value === '' ? JSON.stringify(out) : String(value).toLowerCase());\n  if (seen.has(id)) continue;\n  seen.add(id);\n  out._source = \"https://apify.com/vexaloom-labs/amazon-customer-review-and-rating-summary-scraper\";\n  out._scrapedAt = scrapedAt;\n  clean.push(out);\n}\nreturn clean.map((json) => ({ json }));"
      },
      "id": "646b4eaf-9e44-4c83-a428-8bfb22c61c88",
      "name": "Normalize + dedupe",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        0
      ]
    },
    {
      "parameters": {},
      "id": "f1279585-94ea-4acd-a6f4-c3a2ae41dccb",
      "name": "Rows ready",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        880,
        0
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Rows",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {}
        },
        "options": {}
      },
      "id": "91897d43-ba16-4143-a0e4-257d029b231e",
      "name": "Google Sheets (optional)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1120,
        0
      ],
      "disabled": true,
      "notes": "Enable this after adding your Google Sheets credential and sheet ID."
    },
    {
      "parameters": {
        "content": "## Amazon Customer Review & Rating Summary Scraper\n\n**Actor:** [Amazon Customer Review & Rating Summary Scraper](https://apify.com/vexaloom-labs/amazon-customer-review-and-rating-summary-scraper)\n\n**Docs:** https://scraperfinder.com/n8n/amazon-customer-review-and-rating-summary-scraper/\n\n### Setup\n1. Create an Apify account and copy an API token.\n2. In n8n, create a **Query Auth** credential:\n   - Name: `Apify API Token`\n   - Query parameter name: `token`\n   - Value: your Apify token\n3. Open **Run Apify Actor** and select that credential.\n4. Click **Execute workflow**. The rows appear in **Rows ready**.\n5. Optional: enable **Google Sheets** and set your document and sheet.\n\n### Notes\n- This calls the public Actor endpoint. No API token is stored in this file.\n- `run-sync-get-dataset-items` waits up to 300 seconds. For large runs, switch to the async run + dataset endpoint.\n- Public data only. Respect the target site's terms and local law.\n\n### Input fields\n- `productUrls` (array)\n- `keywords` (array)\n- `categoryUrls` (array)\n- `maxProductsToDiscover` (integer)\n- `country` (string)\n- `maxReviews` (integer)\n- `extendedHistory` (boolean)\n- `mergeMarketplaces` (array)\n- `sortBy` (string)\n- `filterByStar` (string)\n- `verifiedPurchasesOnly` (boolean)\n- `filterKeywords` (array)\n\n### Output fields\n- `productAsin` (ASIN)\n- `ratingScore` (Rating)\n- `reviewTitle` (Title)\n- `reviewDescription` (Review Description)\n- `isVerified` (Verified)\n- `reviewedIn` (Reviewed In)\n- `reviewReaction` (Review Reaction)\n- `variant` (Variant)\n- `reviewImages` (Review Images)\n- `reviewId` (Review ID)\n- `helpfulCount` (Helpful)\n- `reviewDate` (Date)",
        "height": 640,
        "width": 560,
        "color": 4
      },
      "id": "f05526fb-236d-4247-a2a2-9a60b5766992",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -80,
        -700
      ]
    }
  ],
  "connections": {
    "Daily trigger": {
      "main": [
        [
          {
            "node": "Configure input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure input": {
      "main": [
        [
          {
            "node": "Run Apify Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Actor": {
      "main": [
        [
          {
            "node": "Normalize + dedupe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize + dedupe": {
      "main": [
        [
          {
            "node": "Rows ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rows ready": {
      "main": [
        [
          {
            "node": "Google Sheets (optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": [],
  "versionId": "aaf5c945-9dca-474f-a977-872fc9fdacfd",
  "description": "Amazon review scraper: runs the Amazon Customer Review & Rating Summary Scraper Apify Actor, returns productAsin, ratingScore, reviewTitle, reviewDescription, isVerified and more, then normalizes and dedupes the rows before an optional Google Sheets append."
}
