LogoLogo
OverviewRelease NotesDataPipelineFAQs
Python
Python
  • Make Requests with ScraperAPI in Python
    • Use ScraperAPI Endpoint in Python
    • Use ScraperAPI Proxy Port in Python
    • Use ScraperAPI SDK in Python
    • Make Async Requests with ScraperAPI in Python
      • How to Use ScraperAPI Async Web Scraping in Python
      • Use Async ScraperAPI Callbacks in Python
      • Configure ScraperAPI Parameters in Python
      • Request Async Batch Scraping with ScraperAPI in Python
      • Decode Base64 Async Responses in Python
    • ScraperAPI Structured Data Collection in Python
      • Amazon Product Page API: Structured Data in Python
      • Amazon Search API: Structured Data in Python
      • Amazon Offers API: Structured Data in Python
      • Amazon Reviews API: Structured Data in Python
      • Ebay Product Page API: Structured Data in Python
      • Ebay Search API: Structured Data in Python
      • Google SERP API: Structured Data in Python
      • Google News API: Structured Data in Python
      • Google Jobs API: Structured Data in Python
      • Google Shopping API: Structured Data in Python
      • Google Maps Search API: Structured Data in Python
      • Redfin Agent Details API: Structured Data in Python
      • Redfin 'For Rent' Listings API: Structured Data in Python
      • Redfin 'For Sale' Listings API: Structured Data in Python
      • Redfin Listing Search API: Structured Data in Python
      • Walmart Search API: Structured Data in Python
      • Walmart Category API: Structured Data in Python
      • Walmart Product API: Structured Data in Python
      • Walmart Reviews API: Structured Data in Python
    • ScraperAPI Async Structured Data Collection in Python
      • Amazon Product Page API: Async Structured Data in Python
      • Amazon Search API: Async Structured Data in Python
      • Amazon Offers API: Async Structured Data in Python
      • Amazon Reviews API: Async Structured Data in Python
      • Ebay Product Page API: Async Structured Data in Python
      • Ebay Search API: Async Structured Data in Python
      • Google SERP API: Async Structured Data in Python
      • Google News API: Async Structured Data in Python
      • Google Jobs API: Async Structured Data in Python
      • Google Shopping API: Async Structured Data in Python
      • Google Maps Search API: Async Structured Data in Python
      • Redfin Agent Details API: Async Structured Data in Python
      • Redfin 'For Rent' Listings API: Async Structured Data in Python
      • Redfin 'For Sale' Listings API: Async Structured Data in Python
      • Redfin Listing Search API: Async Structured Data in Python
      • Walmart Search API: Async Structured Data in Python
      • Walmart Category API: Async Structured Data in Python
      • Walmart Product API: Async Structured Data in Python
      • Walmart Reviews API: Async Structured Data in Python
    • Making POST/PUT Requests with ScraperAPI in Python
    • Customizing ScraperAPI Requests in Python
      • Customize Amazon Requests by ZIP Code via ScraperAPI in Python
      • Customize Cached Results via ScraperAPI in Python
      • Customize Control Costs with ScraperAPI Parameter in Python
      • Send Custom Headers with ScraperAPI in Python
      • Customize Device Type with ScraperAPI in Python
      • Customize Geotargeted Content Scrape via ScraperAPI in Python
      • Customize Premium Geotargeted Scrape via ScraperAPI in Python
      • Customize Header Parameter with ScraperAPI in Python
      • Customize Premium Residential/Mobile Proxies in Python
      • Customize JavaScript-Rendered Pages via ScraperAPI in Python
        • Use Render Instruction Set to Scrape Dynamic Pages in Python
        • Customize Taking a Website Screenshots via ScraperAPI in Python
      • Customize Scrape Session-Based Proxies via ScraperAPI in Python
  • Handle and Process Responses via ScraperAPI in Python
    • Use API Status Codes to Retry Failed Requests in Python
    • Customize Output Formats via ScraperAPI Parameters in Python
      • Request JSON Response via Autoparse Parameter in Python
      • Request LLM Output Formats with ScraperAPI in Python
    • Request Response Encoding and Content-Type via ScraperAPI in Python
  • Dashboard & Billing
    • API Key
    • Credit Usage
    • Delete Account
    • Invoice History
    • Billing Email
    • Billing Adress
    • VAT Number
    • Payment Method
    • Cancel Subscription
  • Credits and Requests
  • Monitor Your ScraperAPI Account Information in Python
  • Documentation Overview
Powered by GitBook

Quick links

  • Homepage
  • Dashboard
  • Pricing
  • Contact Sales

Resources

  • Developer Guides
  • Blog
  • Learning Hub
  • Contact Support
On this page

Was this helpful?

  1. Make Requests with ScraperAPI in Python
  2. ScraperAPI Structured Data Collection in Python

Amazon Search API: Structured Data in Python

Scrape Amazon search results into structured data JSON/CSV with ScraperAPI in Python. Extract product listings, prices, rankings & Prime status by keyword.

This endpoint will retrieve products for a specified search term from Amazon search page and transform it into usable JSON.

import requests
payload = {'api_key': 'APIKEY', 'query': 'QUERY', 'country': 'COUNTRY', 'tld': 'TLD'}
r = requests.get('https://api.scraperapi.com/structured/amazon/search', params=payload)
print(r.text)

As you can see in the code abode, you can use several parameters with this method as well:

Parameter
Details

API_KEY (required)

User's normal API Key

QUERY (required)

Add a query you want to search e.g. green shoes

TLD

Amazon market to be scraped.

Valid values include:

com (amazon.com)

co.uk (amazon.co.uk)

ca (amazon.ca)

de (amazon.de)

es (amazon.es)

fr (amazon.fr)

it (amazon.it)

co.jp (amazon.co.jp)

in (amazon.in)

cn (amazon.cn)

com.sg (amazon.com.sg)

com.mx (amazon.com.mx)

ae (amazon.ae)

com.br (amazon.com.br)

nl (amazon.nl)

com.au (amazon.com.au)

com.tr (amazon.com.tr)

sa (amazon.sa)

se (amazon.se)

pl (amazon.pl)

COUNTRY

Valid values are two letter country codes for which we offer Geo Targeting (e.g. “au”, “es”, “it”, etc.).

Where an amazon domain needs to be scraped from another country (e.g. scraping amazon.com from Canada to get Canadian shipping information), both TLD and COUNTRY parameters must be specified.

OUTPUT_FORMAT

For structured data methods we offer CSV and JSON output. JSON is default if parameter is not added. Options:

  • csv

  • json

page=N

Paginating the result. For example: 1

ZIP Code Targeting

Sample Response

{
	"ads": [
		{
			"type": "editorial_recommendation",
			"position": 24,
			"name": "OtterBox COMMUTER SERIES Case for iPhone SE (3rd and 2nd gen) and iPhone 8/7 - Frustration Free Packaging - BLACK  Shamo's Crystal Clear Shock Absorption TPU Rubber Gel Case (Clear) Compatible with iPhone SE 2022 (3rd Generation), iPhone SE 2020 (2nd Generation) iPhone 8 and iPhone 7 (Clear)  Caseology Skyfall for iPhone SE Case 2022 for iPhone SE Case (2020) for iPhone 8 Case (2017) for iPhone 7 Case (2016) - Red  OtterBox DEFENDER SERIES Case for iPhone SE (3rd and 2nd gen) and iPhone 8/7 - Frustration Free Packaging - BLACK",
			"image": "https://m.media-amazon.com/images/I/41UhTjBRSXL.jpg",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": true,
			"stars": 4.6,
			"total_reviews": 30455,
			"url": "https://www.amazon.com/OTTERBOX-COMMUTER-Case-iPhone-2nd/dp/B01K6PAZ1M/ref=sxin_25?asc_contentid=amzn1.osa.072eaf6a-2b65-4c5d-8fc8-e2c1fd79d775.ATVPDKIKX0DER.en_US&asc_contenttype=article&ascsubtag=amzn1.osa.072eaf6a-2b65-4c5d-8fc8-e2c1fd79d775.ATVPDKIKX0DER.en_US&content-id=amzn1.sym.2501e731-e00e-46aa-97f8-28a8de3ef511%3Aamzn1.sym.2501e731-e00e-46aa-97f8-28a8de3ef511&creativeASIN=B01K6PAZ1M&cv_ct_cx=iphone+8+case&cv_ct_id=amzn1.osa.072eaf6a-2b65-4c5d-8fc8-e2c1fd79d775.ATVPDKIKX0DER.en_US&cv_ct_pg=search&cv_ct_we=asin&cv_ct_wn=osp-single-source-pecos-desktop&keywords=iphone+8+case&linkCode=oas&pd_rd_i=B01K6PAZ1M&pd_rd_r=bae9220f-d157-437f-b19d-7a5fd9383519&pd_rd_w=I3qNE&pd_rd_wg=5mkHn&pf_rd_p=2501e731-e00e-46aa-97f8-28a8de3ef511&pf_rd_r=CMC486Z1AX373WD7YH90&qid=1675411169&sr=1-1-c26ac7f6-b43f-4741-a772-17cad7536576&tag=bestcont06-20",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$13.00$10.99$15.99$28.43",
			"price_symbol": "$",
			"price": 13
		}
	],
	"amazons_choice": [],
	"results": [
		{
			"type": "search_product",
			"position": 1,
			"name": "JETech Silicone Case for iPhone SE 3/2 (2022/2020 Edition), iPhone 8 and iPhone 7, 4.7-Inch, Silky-Soft Touch Full-Body Protective Case, Shockproof Cover with Microfiber Lining (Black)",
			"image": "https://m.media-amazon.com/images/I/61gnLelc9NL.jpg",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": true,
			"is_limited_deal": false,
			"stars": 4.4,
			"total_reviews": 27251,
			"url": "https://www.amazon.com/JETech-Silky-Soft-Protective-Shockproof-Microfiber/dp/B07QNR8LGW/ref=sr_1_1?keywords=iphone+8+case&qid=1675411169&sr=8-1",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$9.99",
			"price_symbol": "$",
			"price": 9.99
		},
		{
			"type": "search_product",
			"position": 7,
			"name": "Speck Products CandyShell Grip iPhone SE (2022) Case| iPhone SE (2020)| iPhone 8| iPhone 7 - Charcoal Grey/Dark Poppy Red",
			"image": "https://m.media-amazon.com/images/I/71ihPDYKoXL.jpg",
			"section_name": null,
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.7,
			"total_reviews": 13375,
			"url": "https://www.amazon.com/Speck-Products-CandyShell-Phone-iPhone/dp/B0756XVXK1/ref=sxin_15_ac_d_mf_brs?ac_md=7-3-U3BlY2s%3D-ac_d_mf_brs_brs&content-id=amzn1.sym.1ad31f34-ba12-4dca-be4b-f62f7f5bb10d%3Aamzn1.sym.1ad31f34-ba12-4dca-be4b-f62f7f5bb10d&cv_ct_cx=iphone+8+case&keywords=iphone+8+case&pd_rd_i=B0756XVXK1&pd_rd_r=bae9220f-d157-437f-b19d-7a5fd9383519&pd_rd_w=hCD41&pd_rd_wg=5mkHn&pf_rd_p=1ad31f34-ba12-4dca-be4b-f62f7f5bb10d&pf_rd_r=CMC486Z1AX373WD7YH90&qid=1675411169&sr=1-4-8b2f235a-dddf-4202-bbb9-592393927392",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$16.88",
			"price_symbol": "$",
			"price": 16.88
		},
		{
			"type": "search_product",
			"position": 8,
			"name": "xiwxi iPhone SE Case 2022/3rd/2020,iPhone 8/7 Case,with [2xTempered Glass Screen Protector] [360 Full Body Shockproof] [Heavy Dropproof],Hard PC+Soft Silicone TPU+Glass Screen Phone Case-Black",
			"image": "https://m.media-amazon.com/images/I/81VS1nNTEGL.jpg",
			"section_name": null,
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.6,
			"total_reviews": 1759,
			"url": "https://www.amazon.com/xiwxi-2xTempered-Protector-Shockproof-Case-Black/dp/B09VBHHZ78/ref=sxin_15_ac_d_mf_brs?ac_md=4-4-eGl3eGk%3D-ac_d_mf_brs_brs&content-id=amzn1.sym.1ad31f34-ba12-4dca-be4b-f62f7f5bb10d%3Aamzn1.sym.1ad31f34-ba12-4dca-be4b-f62f7f5bb10d&cv_ct_cx=iphone+8+case&keywords=iphone+8+case&pd_rd_i=B09VBHHZ78&pd_rd_r=bae9220f-d157-437f-b19d-7a5fd9383519&pd_rd_w=hCD41&pd_rd_wg=5mkHn&pf_rd_p=1ad31f34-ba12-4dca-be4b-f62f7f5bb10d&pf_rd_r=CMC486Z1AX373WD7YH90&qid=1675411169&sr=1-5-8b2f235a-dddf-4202-bbb9-592393927392",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$14.99",
			"price_symbol": "$",
			"price": 14.99
		},
		{
			"type": "search_product",
			"position": 9,
			"name": "LeYi for iPhone 8 Case, iPhone 6s Case, iPhone 7 Case, iPhone 6 Case with 2 PCS Glass Screen Protector for Women Girls Boys, Liquid Silicone Shockproof Phone Case Cover with Stand for iPhone 8, Green",
			"image": "https://m.media-amazon.com/images/I/61N3UK4wR1L.jpg",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.4,
			"total_reviews": 1104,
			"url": "https://www.amazon.com/LeYi-iPhone-Protector-Silicone-Shockproof/dp/B09TR8DT8L/ref=sr_1_4?keywords=iphone+8+case&qid=1675411169&sr=8-4",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$6.99",
			"price_symbol": "$",
			"price": 6.99
		},
		{
			"type": "search_product",
			"position": 15,
			"name": "JETech Case for iPhone SE 3/2 (2022/2020 Edition), iPhone 8 and iPhone 7, 4.7-Inch, Non-Yellowing Shockproof Phone Bumper Cover, Anti-Scratch Clear Back (Clear)",
			"image": "https://m.media-amazon.com/images/I/617WNit9-8L.jpg",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.6,
			"total_reviews": 121111,
			"url": "https://www.amazon.com/JETech-iPhone-4-7-Inch-Shock-Absorption-Anti-Scratch/dp/B01KF0FJX2/ref=sr_1_10?keywords=iphone+8+case&qid=1675411169&sr=8-10",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$9.99",
			"price_symbol": "$",
			"price": 9.99
		},
		{
			"type": "search_product",
			"position": 16,
			"name": "Spigen Ultra Hybrid (Anti-Yellowing PC Back) Designed for iPhone SE 2022 Case/iPhone SE 3 Case 2022 / iPhone SE 2020 Case/iPhone 8 Case/iPhone 7 Case - Black",
			"image": "https://m.media-amazon.com/images/I/51HnUHLG7eL.jpg",
			"section_name": "Climate Pledge Friendly",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.6,
			"total_reviews": 72783,
			"url": "https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_search_thematic_aps_sr_pg1_1?ie=UTF8&bwType=search&bwAsin=B01M1SCIOV&qualifier=1675411169&id=3243969273986750&widgetName=sp_search_thematic&url=%2FSpigen-Hybrid-Generation-Cushion-Technology%2Fdp%2FB01M1SCIOV%2Fref%3Dsxin_24_pa_sp_search_thematic-asin_sspa%3Fcontent-id%3Damzn1.sym.139755fc-e653-4f77-9e36-97d145a75e7c%253Aamzn1.sym.139755fc-e653-4f77-9e36-97d145a75e7c%26cv_ct_cx%3Diphone%2B8%2Bcase%26keywords%3Diphone%2B8%2Bcase%26pd_rd_i%3DB01M1SCIOV%26pd_rd_r%3Dbae9220f-d157-437f-b19d-7a5fd9383519%26pd_rd_w%3DNz97e%26pd_rd_wg%3D5mkHn%26pf_rd_p%3D139755fc-e653-4f77-9e36-97d145a75e7c%26pf_rd_r%3DCMC486Z1AX373WD7YH90%26qid%3D1675411169%26sr%3D1-1-4a643ae4-6005-4b15-bc31-2c5125e2b25b-spons%26psc%3D1",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$13.99",
			"price_symbol": "$",
			"price": 13.99
		},
		{
			"type": "search_product",
			"position": 17,
			"name": "Spigen Tough Armor [2nd Generation] Designed for iPhone 8 Case (2017) / Designed for iPhone 7 Case (2016) - Black",
			"image": "https://m.media-amazon.com/images/I/61B0XM+bXQL.jpg",
			"section_name": "Climate Pledge Friendly",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.6,
			"total_reviews": 37074,
			"url": "https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_search_thematic_aps_sr_pg1_2?ie=UTF8&bwType=search&bwAsin=B07481XLQN&qualifier=1675411169&id=3243969273986750&widgetName=sp_search_thematic&url=%2FSpigen-Generation-Kickstand-Protection-Technology%2Fdp%2FB07481XLQN%2Fref%3Dsxin_24_pa_sp_search_thematic-asin_sspa%3Fcontent-id%3Damzn1.sym.139755fc-e653-4f77-9e36-97d145a75e7c%253Aamzn1.sym.139755fc-e653-4f77-9e36-97d145a75e7c%26cv_ct_cx%3Diphone%2B8%2Bcase%26keywords%3Diphone%2B8%2Bcase%26pd_rd_i%3DB07481XLQN%26pd_rd_r%3Dbae9220f-d157-437f-b19d-7a5fd9383519%26pd_rd_w%3DNz97e%26pd_rd_wg%3D5mkHn%26pf_rd_p%3D139755fc-e653-4f77-9e36-97d145a75e7c%26pf_rd_r%3DCMC486Z1AX373WD7YH90%26qid%3D1675411169%26sr%3D1-2-4a643ae4-6005-4b15-bc31-2c5125e2b25b-spons%26psc%3D1",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$15.99",
			"price_symbol": "$",
			"price": 15.99
		},
		{
			"type": "search_product",
			"position": 18,
			"name": "Spigen Ultra Hybrid [2nd Generation] Designed for iPhone 8 Plus Case (2017) / Designed for iPhone 7 Plus Case (2016) - Black",
			"image": "https://m.media-amazon.com/images/I/61rPT5Jsh8L.jpg",
			"section_name": "Climate Pledge Friendly",
			"has_prime": true,
			"is_best_seller": false,
			"is_amazon_choice": false,
			"is_limited_deal": false,
			"stars": 4.6,
			"total_reviews": 30062,
			"url": "https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_search_thematic_aps_sr_pg1_3?ie=UTF8&bwType=search&bwAsin=B01N9D7DP2&qualifier=1675411169&id=3243969273986750&widgetName=sp_search_thematic&url=%2FSpigen-Generation-Backing-Cushion-Technology%2Fdp%2FB01N9D7DP2%2Fref%3Dsxin_24_pa_sp_search_thematic-asin_sspa%3Fcontent-id%3Damzn1.sym.139755fc-e653-4f77-9e36-97d145a75e7c%253Aamzn1.sym.139755fc-e653-4f77-9e36-97d145a75e7c%26cv_ct_cx%3Diphone%2B8%2Bcase%26keywords%3Diphone%2B8%2Bcase%26pd_rd_i%3DB01N9D7DP2%26pd_rd_r%3Dbae9220f-d157-437f-b19d-7a5fd9383519%26pd_rd_w%3DNz97e%26pd_rd_wg%3D5mkHn%26pf_rd_p%3D139755fc-e653-4f77-9e36-97d145a75e7c%26pf_rd_r%3DCMC486Z1AX373WD7YH90%26qid%3D1675411169%26sr%3D1-3-4a643ae4-6005-4b15-bc31-2c5125e2b25b-spons%26psc%3D1",
			"availability_quantity": null,
			"spec": {},
			"price_string": "$11.99",
			"price_symbol": "$",
			"price": 11.99
		}
	],
	"explore_more_items": [],
	"pagination": [
		"https://www.amazon.com/s?k=iphone+8+case&page=2&qid=1675411169&ref=sr_pg_2",
		"https://www.amazon.com/s?k=iphone+8+case&page=3&qid=1675411169&ref=sr_pg_3",
		"https://www.amazon.com/s?k=iphone+8+case&page=4&qid=1675411169&ref=sr_pg_4",
		"https://www.amazon.com/s?k=iphone+8+case&page=5&qid=1675411169&ref=sr_pg_5",
		"https://www.amazon.com/s?k=iphone+8+case&page=6&qid=1675411169&ref=sr_pg_6",
		"https://www.amazon.com/s?k=iphone+8+case&page=7&qid=1675411169&ref=sr_pg_7",
		"https://www.amazon.com/s?k=iphone+8+case&page=8&qid=1675411169&ref=sr_pg_8",
		"https://www.amazon.com/s?k=iphone+8+case&page=9&qid=1675411169&ref=sr_pg_9",
		"https://www.amazon.com/s?k=iphone+8+case&page=10&qid=1675411169&ref=sr_pg_10",
		"https://www.amazon.com/s?k=iphone+8+case&page=11&qid=1675411169&ref=sr_pg_11",
		"https://www.amazon.com/s?k=iphone+8+case&page=12&qid=1675411169&ref=sr_pg_12",
		"https://www.amazon.com/s?k=iphone+8+case&page=13&qid=1675411169&ref=sr_pg_13",
		"https://www.amazon.com/s?k=iphone+8+case&page=14&qid=1675411169&ref=sr_pg_14",
		"https://www.amazon.com/s?k=iphone+8+case&page=15&qid=1675411169&ref=sr_pg_15",
		"https://www.amazon.com/s?k=iphone+8+case&page=16&qid=1675411169&ref=sr_pg_16",
		"https://www.amazon.com/s?k=iphone+8+case&page=17&qid=1675411169&ref=sr_pg_17",
		"https://www.amazon.com/s?k=iphone+8+case&page=18&qid=1675411169&ref=sr_pg_18",
		"https://www.amazon.com/s?k=iphone+8+case&page=19&qid=1675411169&ref=sr_pg_19",
		"https://www.amazon.com/s?k=iphone+8+case&page=20&qid=1675411169&ref=sr_pg_20"
	]
}

Last updated 9 months ago

Was this helpful?

To find out mote about ZIP Code targeting, please follow link

this