How to Extract ASIN Using Bright Data’s Amazon Scraper API

tou shi

Why Use Bright Data’s Amazon Scraper API to Extract ASIN?
The key reason to choose this API for ASIN extraction lies in its ability to precisely address critical pain points in Amazon data collection while delivering a superior user experience:

On one hand, it eliminates the need for users to develop complex scraping scripts. By simply configuring specific parameters through the interface, users can easily obtain ASINs of public products across various Amazon domains and URLs. It also outputs structured data directly, significantly reducing the time and effort required for data acquisition and organization. Additionally, it supports on-demand API request setup, adjustable scraping frequency, and integration with custom storage systems, offering outstanding customization and scalability.

On the other hand, to tackle Amazon’s strict anti-scraping measures, the API leverages Bright Data’s mature proxy network—which includes residential, mobile, and datacenter proxy types—effectively evading detection of non-human behavior and considerably reducing the risk of account bans. Moreover, since users are not required to maintain scraping infrastructure, they can focus on practical data applications. This makes the solution highly efficient, secure, and convenient, fully meeting the needs of ASIN extraction.

Below is a detailed step-by-step guide to setting up the Amazon Scraper API:

1.Access the API: Open the Web Scraper API interface, search for “amazon products search” in the list of available APIs, and click “Start setting an API call”.

2.Obtain an API Token: Locate “API Tokens”, click “Get API token”, then select “Add token”. The system will generate a unique, lengthy string—this is your API Token.

3.Configure Data Collection: Under the Data Collection APIs tab, specify keywords, set the domain (country), define the number of pages, and apply optional filters (e.g., category).

Here is an example :

Python Copy
import requests
import json

def get_weather_for_city(latitude, longitude, city_name):
    api_url = "https://api.open-meteo.com/v1/forecast"
    params = {
        "latitude": latitude,
        "longitude": longitude,
        "current_weather": "true"
    }
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
    }

    print(f"?Currently querying the current weather for '{city_name}'...")

    try:
        response = requests.get(api_url, params=params, headers=headers, timeout=10)
        response.raise_for_status()
        data = response.json()
        
        print("✅ API response successful!")
        return data

    except requests.exceptions.HTTPError as http_err:
        print(f"❌ HTTP request failed:{http_err}")
    except requests.exceptions.RequestException as req_err:
        print(f"❌There was an error with the network or request: {req_err}")
    except json.JSONDecodeError:
        print("❌ Failed to parse JSON response.")
        
    return None
if __name__ == "__main__":
    london_latitude = 51.51
    london_longitude = -0.13
    weather_data = get_weather_for_city(london_latitude, london_longitude, "London")
  
    if weather_data and "current_weather" in weather_data:
        current_weather = weather_data["current_weather"]
        temperature = current_weather.get('temperature', 'N/A')
        wind_speed = current_weather.get('windspeed', 'N/A')
        weather_code = current_weather.get('weathercode', -1)
        
        print("\n--- Current weather report in London ---")
        print(f"  ?️ Temperature: {temperature}°C")
        print(f"  ? Wind speed: {wind_speed} km/h")
        print(f"  ?️ Weather code: {weather_code}")
        with open("london_weather.json", "w", encoding="utf-8") as f:
            json.dump(weather_data, f, ensure_ascii=False, indent=2)
        print("\n? The complete API response has been saved to london_weather.json。")
        
    else:
        print("\nUnable to obtain valid weather data.")
Update Time:Feb 04, 2026

Comments

Tips: Support some markdown syntax: **bold**, [bold](xxxxxxxxx), `code`, - list, > reference