Quickstart
E-Commerce
- Amazon APIs
- Walmart APIs
Real Estate
- Zillow APIs
- Idealista APIs
SERP
- Google API
- FAQ
Using the Amazon Discovery API
# pip install requests
import requests
import urllib.parse
query = "laptop stand"
encoded_query = urllib.parse.quote(query)
api_endpoint = f"https://ecommerce.api.zenrows.com/v1/targets/amazon/discovery/{encoded_query}"
params = {
"apikey": "YOUR_ZENROWS_API_KEY",
"country": "us" # Optional: Target specific country
}
response = requests.get(api_endpoint, params=params)
print(response.text)
{
"search_query": "laptop stand",
"pagination": {
"current_page": 1,
"total_pages": 20,
"next_page_url": "https://www.amazon.com/s?k=laptop+stand&page=2&xpid=9u8lcOrIDaHFG&qid=1739387945&ref=sr_pg_1"
},
"products": [
{
"title": "Adjustable Laptop Stand for Desk",
"asin": "B08XYZ1234",
"price": 16.99,
"original_price": 19.99,
"discounted": true,
"rating": 4.5,
"reviews_count": 1250,
"availability": "In Stock",
"seller": "Amazon",
"fulfilled_by_amazon": true,
"url": "https://www.amazon.com/dp/B08XYZ1234",
"image_url": "https://m.media-amazon.com/images/I/71d5FyZOpXL._AC_SL1500_.jpg"
},
{
"title": "Laptop Stand, Ergonomic Aluminum Riser",
"asin": "B09ABC5678",
"price": 29.99,
"original_price": null,
"discounted": false,
"rating": 4.8,
"reviews_count": 3400,
"availability": "In Stock",
"seller": "Best Deals Inc.",
"fulfilled_by_amazon": false,
"url": "https://www.amazon.com/dp/B09ABC5678",
"image_url": "https://m.media-amazon.com/images/I/81QpJ5BXLbL._AC_SL1500_.jpg"
}
],
"sponsored_products": [
{
"title": "Portable Laptop Stand, Foldable & Lightweight",
"asin": "B07LMN4567",
"price": 22.49,
"original_price": 24.99,
"discounted": true,
"rating": 4.6,
"reviews_count": 980,
"availability": "In Stock",
"seller": "Gadgets Hub",
"fulfilled_by_amazon": true,
"url": "https://www.amazon.com/dp/B07LMN4567",
"image_url": "https://m.media-amazon.com/images/I/61zKpLgJtJL._AC_SL1500_.jpg"
}
],
"related_searches": [
"adjustable laptop stand",
"foldable laptop stand",
"laptop stand for desk",
"portable laptop riser"
]
}
The Amazon Discovery API enables you to extract search results from Amazon based on specific queries. It provides a structured list of products and their details, empowering you to analyze trends and monitor market activity effectively.
- Product Name, Price, and Discount Details
- Ratings and Review Counts
- Product URLs and Images
- Related Searches and Sponsored Products
Example Use Cases:
- Market Research: Identify trending products and evaluate their popularity.
- Demand Analysis: Understand product search trends in specific regions or categories.
Supported Query Parameters
PARAMETER | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
query required | string | The search term you want to query on Amazon. Must be URL-encoded. Example: Echo+Dot . | |
url | string <uri> | The URL of the search results page to retrieve. Example: https://www.amazon.com/s?k=Echo+Dot . | |
tld | string | .com | The top-level domain of the Amazon website. Supported values: .com , .it , .de , etc. |
country | string | us | The originating country for the product retrieval. Example: country=es . |
How to Setup
Request the search endpoint with the desired query:
https://ecommerce.api.zenrows.com/v1/targets/amazon/discovery/{query}?apikey=YOUR_ZENROWS_API_KEY
Example
curl "https://ecommerce.api.zenrows.com/v1/targets/amazon/discovery/{query}?apikey=YOUR_ZENROWS_API_KEY&country=gb" #Optional: Target specific country
{query}
must be encoded.# pip install requests
import requests
import urllib.parse
query = "laptop stand"
encoded_query = urllib.parse.quote(query)
api_endpoint = f"https://ecommerce.api.zenrows.com/v1/targets/amazon/discovery/{encoded_query}"
params = {
"apikey": "YOUR_ZENROWS_API_KEY",
"country": "us" # Optional: Target specific country
}
response = requests.get(api_endpoint, params=params)
print(response.text)
{
"search_query": "laptop stand",
"pagination": {
"current_page": 1,
"total_pages": 20,
"next_page_url": "https://www.amazon.com/s?k=laptop+stand&page=2&xpid=9u8lcOrIDaHFG&qid=1739387945&ref=sr_pg_1"
},
"products": [
{
"title": "Adjustable Laptop Stand for Desk",
"asin": "B08XYZ1234",
"price": 16.99,
"original_price": 19.99,
"discounted": true,
"rating": 4.5,
"reviews_count": 1250,
"availability": "In Stock",
"seller": "Amazon",
"fulfilled_by_amazon": true,
"url": "https://www.amazon.com/dp/B08XYZ1234",
"image_url": "https://m.media-amazon.com/images/I/71d5FyZOpXL._AC_SL1500_.jpg"
},
{
"title": "Laptop Stand, Ergonomic Aluminum Riser",
"asin": "B09ABC5678",
"price": 29.99,
"original_price": null,
"discounted": false,
"rating": 4.8,
"reviews_count": 3400,
"availability": "In Stock",
"seller": "Best Deals Inc.",
"fulfilled_by_amazon": false,
"url": "https://www.amazon.com/dp/B09ABC5678",
"image_url": "https://m.media-amazon.com/images/I/81QpJ5BXLbL._AC_SL1500_.jpg"
}
],
"sponsored_products": [
{
"title": "Portable Laptop Stand, Foldable & Lightweight",
"asin": "B07LMN4567",
"price": 22.49,
"original_price": 24.99,
"discounted": true,
"rating": 4.6,
"reviews_count": 980,
"availability": "In Stock",
"seller": "Gadgets Hub",
"fulfilled_by_amazon": true,
"url": "https://www.amazon.com/dp/B07LMN4567",
"image_url": "https://m.media-amazon.com/images/I/61zKpLgJtJL._AC_SL1500_.jpg"
}
],
"related_searches": [
"adjustable laptop stand",
"foldable laptop stand",
"laptop stand for desk",
"portable laptop riser"
]
}
Troubleshooting and FAQs
The pagination.current_page
field in the response helps you track pages. Use the url
parameter with the next page link provided by Amazon to scrape additional pages.
The country
parameter determines the currency used in pricing. For example, country=de
will return prices in Euros (EUR), while country=us
will return prices in USD.
Sponsored products are included in the sponsored_product_list
field of the response. Use this field to analyze ad placements.
Was this page helpful?
# pip install requests
import requests
import urllib.parse
query = "laptop stand"
encoded_query = urllib.parse.quote(query)
api_endpoint = f"https://ecommerce.api.zenrows.com/v1/targets/amazon/discovery/{encoded_query}"
params = {
"apikey": "YOUR_ZENROWS_API_KEY",
"country": "us" # Optional: Target specific country
}
response = requests.get(api_endpoint, params=params)
print(response.text)
{
"search_query": "laptop stand",
"pagination": {
"current_page": 1,
"total_pages": 20,
"next_page_url": "https://www.amazon.com/s?k=laptop+stand&page=2&xpid=9u8lcOrIDaHFG&qid=1739387945&ref=sr_pg_1"
},
"products": [
{
"title": "Adjustable Laptop Stand for Desk",
"asin": "B08XYZ1234",
"price": 16.99,
"original_price": 19.99,
"discounted": true,
"rating": 4.5,
"reviews_count": 1250,
"availability": "In Stock",
"seller": "Amazon",
"fulfilled_by_amazon": true,
"url": "https://www.amazon.com/dp/B08XYZ1234",
"image_url": "https://m.media-amazon.com/images/I/71d5FyZOpXL._AC_SL1500_.jpg"
},
{
"title": "Laptop Stand, Ergonomic Aluminum Riser",
"asin": "B09ABC5678",
"price": 29.99,
"original_price": null,
"discounted": false,
"rating": 4.8,
"reviews_count": 3400,
"availability": "In Stock",
"seller": "Best Deals Inc.",
"fulfilled_by_amazon": false,
"url": "https://www.amazon.com/dp/B09ABC5678",
"image_url": "https://m.media-amazon.com/images/I/81QpJ5BXLbL._AC_SL1500_.jpg"
}
],
"sponsored_products": [
{
"title": "Portable Laptop Stand, Foldable & Lightweight",
"asin": "B07LMN4567",
"price": 22.49,
"original_price": 24.99,
"discounted": true,
"rating": 4.6,
"reviews_count": 980,
"availability": "In Stock",
"seller": "Gadgets Hub",
"fulfilled_by_amazon": true,
"url": "https://www.amazon.com/dp/B07LMN4567",
"image_url": "https://m.media-amazon.com/images/I/61zKpLgJtJL._AC_SL1500_.jpg"
}
],
"related_searches": [
"adjustable laptop stand",
"foldable laptop stand",
"laptop stand for desk",
"portable laptop riser"
]
}