Amazon Search API
This API can be used for scraping any search result from Amazon. You just need to pass the search query.
You have to send a GET request to https://api.ecommerceapi.io/amazon/search
with the below given parameters.
api_key
required
Your personal API key. Available on your dashboard Type: String
domain
required
This is the TLD extension of the Amazon page.
Example - in, com, tr, etc
Type: String
query
required
This is the search query string.
Type: String
page
required
This is the page number.
Type: String
country
required
Each successful request with this parameter will cost 5 credits, except for the USA, which costs 1 credit per request.
The default value is "us".
Type: String
postal_code
To get data from a particular postal code.
5 credits will be charged for each successful request with this parameter.
Type: String
API Example
curl "https://api.ecommerceapi.io/amazon/search?api_key=APIKEY&domain=com&query=clothes"
const axios = require('axios');
// API URL and key
const apiURL = 'https://api.ecommerceapi.io/amazon/search';
const apiKey = 'APIKEY';
// Query parameters
const domain = 'com';
const query = 'clothes';
// Create an object with the query parameters
const params = {
api_key: apiKey,
domain: domain,
query: query,
};
// Send a GET request with the specified parameters
axios
.get(apiURL, { params: params })
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error('HTTP Request Error:', error);
});
import requests
# API URL and key
api_url = "https://api.ecommerceapi.io/amazon/search"
api_key = "APIKEY"
# Query parameters
domain = "com"
query = "clothes"
# Create a dictionary with the query parameters
params = {
"api_key": api_key,
"domain": domain,
"query": query
}
# Send the GET request with the specified parameters
response = requests.get(api_url, params=params)
# Check if the request was successful (status code 200)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"HTTP Request Error: {response.status_code}")
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
String apiURL = "https://api.ecommerceapi.io/amazon/search";
String apiKey = "APIKEY";
String domain = "com";
String query = "clothes";
try {
// Create the URL with query parameters
URL url = new URL(apiURL + "?api_key=" + apiKey + "&domain=" + domain + "&query=" + query);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// Set the request method to GET
connection.setRequestMethod("GET");
// Get the response code
int responseCode = connection.getResponseCode();
if (responseCode == 200) {
// Read the response data
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
StringBuilder response = new StringBuilder();
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
// Print the response data
System.out.println(response.toString());
} else {
System.out.println("Request failed with response code: " + responseCode);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
api_url = 'https://api.ecommerceapi.io/amazon/search'
api_key = 'APIKEY'
domain = 'com'
query = 'clothes'
params = {
'api_key' => api_key,
'domain' => domain,
'query' => query
}
uri = URI(api_url)
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get_response(uri)
if response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)
puts data
else
puts "Request failed with status code #{response.code}"
end
<?php
// API URL and key
$apiURL = 'https://api.ecommerceapi.io/amazon/search';
$apiKey = '5eaa61a6e562fc52fe763tr516e4653';
// Query parameters
$domain = 'com';
$query = 'clothes';
// Create an array with the query parameters
$params = [
'api_key' => $apiKey,
'domain' => $domain,
'query' => $query,
];
// Initialize cURL session
$ch = curl_init();
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $apiURL . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL session and get the response
$response = curl_exec($ch);
// Check for cURL errors
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
}
// Close cURL session
curl_close($ch);
// Parse and use the response data
if ($response) {
$jsonData = json_decode($response, true);
print_r($jsonData);
} else {
echo 'No response received.';
}
API Response
{
"search_message": "",
"location": "Delivering to New York 10118",
"results": [
{
"type": "search_product",
"title": "Amazon Essentials Men's Slim-Fit Long-Sleeve Henley Shirt",
"image": "https://m.media-amazon.com/images/I/916e0XF8LFL._AC_UL320_.jpg",
"has_prime": false,
"is_best_seller": false,
"is_amazon_choice": false,
"limited_time_deal": false,
"deal_of_the_day": false,
"stars": "4.3",
"total_reviews": "11,611",
"url": "https://www.amazon.com/sspa/click?ie=UTF8&spc=MTo1NzcwOTA5MTUxOTE3MDQ5OjE3MzQ4MDM2NDg6c3BfYXRmOjIwMDAxMTczMDE2OTczMTo6MDo6&url=%2FAmazon-Essentials-Slim-Fit-Long-Sleeve-Heather%2Fdp%2FB07BJKYP7D%2Fref%3Dsr_1_1_ffob_sspa%3Fdib%3DeyJ2IjoiMSJ9.3EGMwlXeHYpmglAkT3LGF2WiwCrmC5XKy_KtuIZ3dpADu7-3HYa82VRtT2lJ6br9u_yJToHYdGD8DucM9OZVYTetJMppJIPFbI_Hw5N-TnzrhuXqWJcjs22BvjMXYlDER4DHnwSrig5w02n7FQer5XNt9U73BSjK_KyALTwT6aCxXMuOosIltCRK62F9cxEEZ7PcAd_zxR1yl24748FvVeB6d3eUwNYWjLO1wv4IQsmWkNC7iVZG7Mp7vjGXSm8Pn0cJXaTqTwSOVesGGdUrO7RLZsugsjBuO_dgVYIG11E.hBodGupcb_dgzlmI68IUG5dNuupc6JPJUiDX04T-FeM%26dib_tag%3Dse%26keywords%3Dclothes%26qid%3D1734803648%26sr%3D8-1-spons%26sp_csd%3Dd2lkZ2V0TmFtZT1zcF9hdGY%26psc%3D1",
"optimized_url": "https://www.amazon.com/sspa/click?ie=UTF8&spc=MTo1NzcwOTA5MTUxOTE3MDQ5OjE3MzQ4MDM2NDg6c3BfYXRmOjIwMDAxMTczMDE2OTczMTo6MDo6&url=/Amazon-Essentials-Slim-Fit-Long-Sleeve-Heather/dp/B07BJKYP7D",
"sponsored": true,
"certification": "1 sustainability feature",
"number_of_people_bought": "100+ bought in past month",
"asin": "B07BJKYP7D",
"availability_quantity": null,
"price_string": "$16.10",
"price_symobol": "$",
"price": "$16.10",
"absolute_position": 1
},
{
"type": "search_product",
"title": "Saloogoe Summer Tank Tops for Women Loose Fit Pleated Tunics Scoop Neck Sleeveless Lace Tops Curved Hem Flowy",
"image": "https://m.media-amazon.com/images/I/71bbVJnXkmL._AC_UL320_.jpg",
"has_prime": false,
"is_best_seller": false,
"is_amazon_choice": false,
"limited_time_deal": false,
"deal_of_the_day": false,
"stars": "4.5",
"total_reviews": "1,604",
"url": "https://www.amazon.com#",
"optimized_url": "https://www.amazon.com#",
"sponsored": false,
"number_of_people_bought": "200+ bought in past month",
"availability_quantity": null,
"price_string": "$19.99",
"price_symobol": "$",
"price": "$19.99",
"absolute_position": 2,
"organic_position": 1
},
{
"type": "search_product",
"title": "4 Pack Leggings for Women Butt Lift High Waisted Tummy Control No See-Through Yoga Pants Workout Running Leggings",
"image": "https://m.media-amazon.com/images/I/61noZNB2OoL._AC_UL320_.jpg",
"has_prime": false,
"is_best_seller": false,
"is_amazon_choice": false,
"limited_time_deal": false,
"deal_of_the_day": false,
"stars": "4.3",
"total_reviews": "6,056",
"url": "https://www.amazon.com/Leggings-Waisted-Control-See-Through-Workout/dp/B09NJHVJ6W/ref=sr_1_4?dib=eyJ2IjoiMSJ9.3EGMwlXeHYpmglAkT3LGF2WiwCrmC5XKy_KtuIZ3dpADu7-3HYa82VRtT2lJ6br9u_yJToHYdGD8DucM9OZVYTetJMppJIPFbI_Hw5N-TnzrhuXqWJcjs22BvjMXYlDER4DHnwSrig5w02n7FQer5XNt9U73BSjK_KyALTwT6aCxXMuOosIltCRK62F9cxEEZ7PcAd_zxR1yl24748FvVeB6d3eUwNYWjLO1wv4IQsmWkNC7iVZG7Mp7vjGXSm8Pn0cJXaTqTwSOVesGGdUrO7RLZsugsjBuO_dgVYIG11E.hBodGupcb_dgzlmI68IUG5dNuupc6JPJUiDX04T-FeM&dib_tag=se&keywords=clothes&qid=1734803648&sr=8-4",
"optimized_url": "https://www.amazon.com/Leggings-Waisted-Control-See-Through-Workout/dp/B09NJHVJ6W",
"sponsored": false,
"number_of_people_bought": "10K+ bought in past month",
"asin": "B09NJHVJ6W",
"availability_quantity": null,
"price_string": "$25.99",
"price_symobol": "$",
"price": "$25.99",
"absolute_position": 3,
"organic_position": 2
},
.....
]
}
Last updated