{"id":20709912,"url":"https://github.com/oxylabs/amazon-asin-scraper","last_synced_at":"2025-04-12T22:20:25.400Z","repository":{"id":184450818,"uuid":"671885705","full_name":"oxylabs/amazon-asin-scraper","owner":"oxylabs","description":"Amazon ASIN Scraper for effortless product ASIN extraction.","archived":false,"fork":false,"pushed_at":"2025-02-10T12:48:00.000Z","size":80,"stargazers_count":243,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-04T05:01:32.612Z","etag":null,"topics":["amazon","amazon-asin","amazon-price-tracker","amazon-product-scraper","amazon-scraper","amazon-scraper-api","asin","scraper-api","scraper-api-github","url-scraper"],"latest_commit_sha":null,"homepage":"https://oxylabs.io/products/scraper-api/ecommerce/amazon/asin","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxylabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-28T11:17:25.000Z","updated_at":"2025-04-02T23:14:12.000Z","dependencies_parsed_at":"2025-02-15T10:12:45.690Z","dependency_job_id":"2ab518ca-164c-4d87-b1da-ee30fe24b09c","html_url":"https://github.com/oxylabs/amazon-asin-scraper","commit_stats":null,"previous_names":["oxylabs/amazon-asin-scraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Famazon-asin-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Famazon-asin-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Famazon-asin-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxylabs%2Famazon-asin-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxylabs","download_url":"https://codeload.github.com/oxylabs/amazon-asin-scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248638405,"owners_count":21137660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","amazon-asin","amazon-price-tracker","amazon-product-scraper","amazon-scraper","amazon-scraper-api","asin","scraper-api","scraper-api-github","url-scraper"],"created_at":"2024-11-17T02:08:58.808Z","updated_at":"2025-04-12T22:20:25.372Z","avatar_url":"https://github.com/oxylabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amazon ASIN Scraper\n\n[![Amazon_scraper (1)](https://raw.githubusercontent.com/oxylabs/amazon-scraper/refs/heads/main/Amazon-Scraper-API-1090x275.png)](https://oxylabs.go2cloud.org/aff_c?offer_id=7\u0026aff_id=877\u0026url_id=86) \n\n[![](https://dcbadge.vercel.app/api/server/eWsVUJrnG5)](https://discord.gg/GbxmdGhZjq)\n\n- [Amazon ASIN Scraper](#amazon-asin-scraper)\n    + [Free Amazon ASIN Scraper](#free-amazon-asin-scraper)\n    + [Prerequisites](#prerequisites)\n    + [Installation](#installation)\n    + [Retrieving the URL of an Amazon page to scrape prices from](#retrieving-the-url-of-an-amazon-page-to-scrape-prices-from)\n    + [Scraping Amazon product ASIN codes](#scraping-amazon-product-asin-codes)\n    + [Retrieved data](#retrieved-data)\n    + [Notes](#notes)\n    + [Scraping with Oxylabs API](#scraping-with-oxylabs-api)\n  * [How it works](#how-it-works)\n    + [Output Example](#output-example)\n\nIn this tutorial, we'll demonstrate how to collect Amazon ASIN (Standard Identification Number) data for free. \n\nIf you need this data on a bigger scale, please refer to the 2nd part of the tutorial, where we use Oxylabs API for extracting this data. \n\n### Free Amazon ASIN Scraper\n\nA free tool used to get Amazon ASIN numbers for a provided Amazon department page.\n\n### Prerequisites\n\nTo run this tool, you need to have Python 3.11 installed in your system.\n\n### Installation\n\nOpen up a terminal window, navigate to this repository and run this command:\n\n```make install```\n\n### Retrieving the URL of an Amazon page to scrape prices from\n\nFirst off, open up Amazon and select a department from which you want to scrape prices for products. \n\nFor this example, we'll be using the `Headphones` department.\n\n\u003cimg width=\"1008\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1f20d5c2-59d6-4a97-b9af-2bef40b0fd40\" /\u003e\n\nAfter the page loads, simply copy the URL in the browser and save it. We'll need it for scraping ASIN codes.\n\n### Scraping Amazon product ASIN codes\n\nTo get ASIN codes from products listed on the department page you chose, simply run this command in your terminal:\n\n```make scrape URL=\"\u003camazon_department_page_url\u003e\"```\n\nWith the URL we retrieved earlier, the command would look like this:\n\n```make scrape URL=\"https://www.amazon.com/s?i=specialty-aps\u0026bbn=16225009011\u0026rh=n%3A%2116225009011%2Cn%3A172541\u0026ref=nav_em__nav_desktop_sa_intl_headphones_0_2_6_8\"```\n\nMake sure to surround the URL with quotation marks, otherwise the tool might have trouble parsing it.\n\nAfter running the command, your terminal should look something like this:\n\n\u003cimg width=\"1023\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ba3349e4-861f-4a33-8a1e-f15d5efef663\" /\u003e\n\n### Retrieved data\n\nAfter the tool has finished running, you should see a file named `amazon_asin_data.csv` in your directory.\n\nThe generated CSV file contains data with these columns inside it:\n\n- `title` - The title of the product.\n- `url` - The URL pointing to the product's Amazon page.\n- `asin_code` - The ASIN code of the product.\n\nThe data should look something like this:\n\n\u003cimg width=\"935\" alt=\"image\" src=\"https://github.com/user-attachments/assets/07d6f192-22f7-46ca-af27-366740c1563e\" /\u003e\n\n### Notes\n\nIn case the code doesn't work or your project is of bigger scale, please refer to the second part of the tutorial. There, we showcase how to scrape public data with Oxylabs Scraper API.\n\n### Scraping with Oxylabs API\n\nNow, we'll demonstrate how to collect Amazon ASIN data with [Oxylabs API](https://oxylabs.io/products/scraper-api/web). Keep in mind that you'll need an active subscription for this part, whether that's a paid one or a free trial. \n\nTo get a free, 7-day trial, please go to our self-service [dashboard](https://dashboard.oxylabs.io/en/). \n\n## How it works\n\nYou can retrieve Amazon ASIN numbers by sending a request to our API,\nwhich will return the results in JSON or HTML format.\n\n### **Python code example**\n\nThe below code sample shows how you can get parsed Amazon results with\nproduct ASINs in JSON format:\n\n```python\nimport requests\nfrom pprint import pprint\n\n# Structure payload.\npayload = {\n   'source': 'amazon_search',\n   'query': 'nintendo',\n   'user_agent_type': 'desktop',\n   'parse': True,\n   'domain': 'com',\n   'geo_location': '10020',\n   'locale': 'en-us',\n   'start_page': '1',\n   'pages': '1'\n}\n\n# Get a response.\nresponse = requests.request(\n    'POST',\n    'https://realtime.oxylabs.io/v1/queries',\n    auth=('USERNAME', 'PASSWORD'), #Your credentials go here\n    json=payload,\n)\n\n# Instead of response with job status and results url, this will return the\n# JSON response with results.\npprint(response.json())\n\n```\n\nVisit our\n[\u003cu\u003edocumentation\u003c/u\u003e](https://docs.oxylabs.io/wmw8gbrbnajdf87/scraper-apis/e-commerce-scraper-api/amazon)\nfor more details and code examples on using Oxylabs’ Amazon Scraper API.\n\n### Output Example\n\nHere's a partial output sample that includes paid and organic Amazon search results:\n\n```json\n{\n  \"results\": [\n    {\n      \"content\": {\n        \"url\": \"https://www.amazon.com/s?k=nintendo\u0026page=1\",\n        \"page\": 1,\n        \"pages\": 1,\n        \"query\": \"nintendo\",\n        \"results\": {\n          \"paid\": [\n            {\n              \"pos\": 1,\n              \"url\": \"/sspa/click?ie=UTF8\u0026spc=MTo0OTQyODU2MjAxNjE4NzQwOjE2OTA1MzMwNDM6c3BfYXRmOjIwMDE0MzU3MzAzMTQ5ODo6MDo6\u0026url=/Sonic-Origins-Plus-Nintendo-Switch/dp/B0BZFGSY5W/ref=sr_1_1_sspa?keywords=nintendo\u0026qid=1690533043\u0026sr=8-1-spons\u0026sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY\u0026psc=1\",\n              \"asin\": \"B0BZFGSY5W\",\n              \"price\": 29.99,\n              \"title\": \"Sonic Origins Plus - Nintendo Switch\",\n              \"rating\": 4,\n              \"currency\": \"USD\",\n              \"is_prime\": false,\n              \"url_image\": \"https://m.media-amazon.com/images/I/81NUog-gECL._AC_UY218_.jpg\",\n              \"variations\": [\n                {\n                  \"price\": 29.99,\n                  \"title\": \"Nintendo Switch\",\n                  \"not_available\": false,\n                  \"price_strikethrough\": 39.99\n                }\n              ],\n              \"best_seller\": false,\n              \"price_upper\": 29.99,\n              \"is_sponsored\": true,\n              \"manufacturer\": \"SEGA\",\n              \"sales_volume\": \"2K+ bought in past month\",\n              \"pricing_count\": 1,\n              \"reviews_count\": 0,\n              \"is_amazons_choice\": false,\n              \"price_strikethrough\": 39.99,\n              \"shipping_information\": \"FREE delivery Wed, Aug 2 Or fastest delivery Mon, Jul 31\"\n            }\n          ],\n          \"organic\": [\n            {\n              \"pos\": 4,\n              \"url\": \"/Nintendo-eShop-Gift-Card-Digital/dp/B01LYOCVZF/ref=sr_1_4?keywords=nintendo\u0026qid=1690533043\u0026sr=8-4\",\n              \"asin\": \"B01LYOCVZF\",\n              \"price\": 20,\n              \"title\": \"$20 Nintendo eShop Gift Card [Digital Code]\",\n              \"rating\": 4.7,\n              \"currency\": \"USD\",\n              \"is_prime\": false,\n              \"url_image\": \"https://m.media-amazon.com/images/I/71cj5cNm7ZL._AC_UY218_.jpg\",\n              \"variations\": [\n                {\n                  \"asin\": \"B01LYOCVZF\",\n                  \"price\": 20,\n                  \"title\": \"Nintendo Switch\",\n                  \"not_available\": false\n                }\n              ],\n              \"best_seller\": false,\n              \"price_upper\": 20,\n              \"is_sponsored\": false,\n              \"manufacturer\": \"Nintendo\",\n              \"pricing_count\": 1,\n              \"reviews_count\": 0,\n              \"is_amazons_choice\": false\n            }\n          ],\n          \"suggested\": [],\n          \"amazons_choices\": [...],\n          \"instant_recommendations\": []\n        },\n        \"parse_status_code\": 12000,\n        \"total_results_count\": 60000\n      },\n      \"created_at\": \"2023-07-28 08:30:35\",\n      \"updated_at\": \"2023-07-28 08:30:44\",\n      \"page\": 1,\n      \"url\": \"https://www.amazon.com/s?k=nintendo\u0026page=1\",\n      \"job_id\": \"7090609474792097793\",\n      \"status_code\": 200,\n      \"parser_type\": \"\"\n    }\n  ]\n}\n\n```\n\nIf you have any questions, feel free to contact our 24/7 support team\nvia live chat or [\u003cu\u003eemail\u003c/u\u003e](mailto:support@oxylabs.io).\n\nLooking to scrape more other Amazon data? [Amazon Review Scraper](https://github.com/oxylabs/amazon-review-scraper), [Bypass Amazon CAPTCHA](https://github.com/oxylabs/how-to-bypass-amazon-captcha), [How to Scrape Amazon Prices](https://github.com/oxylabs/how-to-scrape-amazon-prices), [Scraping Amazon Product Data](https://github.com/oxylabs/how-to-scrape-amazon-product-data)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxylabs%2Famazon-asin-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxylabs%2Famazon-asin-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxylabs%2Famazon-asin-scraper/lists"}