[Python] Mouser Search API fails to provide complete informations

Discussão em 'Python' iniciado por Stack, Fevereiro 11, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to retrieve product informations using the mouser.com search API.

    For example, I want to get the Product Specifications of this ROHM Semiconductor Product.

    I am using the post request for the 'mouserPartNumber' to get the product specifications, below you can see a simple python request example:

    import requests
    url = "https://api.mouser.com/api/v1/search/partnumber"
    api_key = "32ea4e56-f130-4564-a0ff-5cdf73f184eb"
    payload = {
    "SearchByPartRequest": {
    "mouserPartNumber": "SCS310AMC7G"
    }
    }
    headers = {
    "Content-Type": "application/json"
    }

    response = requests.post(f"{url}?apiKey={api_key}", json=payload, headers=headers)
    print(response.json())


    When you need context for the API you can see Documentation of the API.

    Somehow ProductAttributes contains not all, or zero attributes. Thats the response of the request:


    {'Errors': [], 'SearchResults': {'NumberOfResult': 1, 'Parts': [{'Availability': '733 In Stock', 'DataSheetUrl': '', 'Description': 'SiC Schottky Diodes RECT SBD 650V 10A SIC', 'FactoryStock': '0', 'ImagePath': 'https://www.mouser.com/images/rohmsemiconductor/images/SCS310AM_SPL.jpg', 'Category': 'SiC Schottky Diodes', 'LeadTime': '110 Days', 'LifecycleStatus': 'New Product', 'Manufacturer': 'ROHM Semiconductor', 'ManufacturerPartNumber': 'SCS310AMC7G', 'Min': '1', 'Mult': '1', 'MouserPartNumber': '755-SCS310AMC7G', 'ProductAttributes': [], 'PriceBreaks': [{'Quantity': 1, 'Price': '$4.49', 'Currency': 'USD'}, {'Quantity': 10, 'Price': '$3.77', 'Currency': 'USD'}, {'Quantity': 100, 'Price': '$3.05', 'Currency': 'USD'}, {'Quantity': 250, 'Price': '$2.88', 'Currency': 'USD'}, {'Quantity': 500, 'Price': '$2.71', 'Currency': 'USD'}, {'Quantity': 1000, 'Price': '$2.32', 'Currency': 'USD'}, {'Quantity': 2500, 'Price': '$2.18', 'Currency': 'USD'}, {'Quantity': 5000, 'Price': '$2.10', 'Currency': 'USD'}], 'AlternatePackagings': None, 'ProductDetailUrl': 'https://www.mouser.com/ProductDetail/ROHM-Semiconductor/SCS310AMC7G?qs=iLKYxzqNS75xiccEgNnX2g%3D%3D', 'Reeling': False, 'ROHSStatus': 'RoHS Compliant', 'SuggestedReplacement': '', 'MultiSimBlue': 0, 'AvailabilityInStock': '733', 'AvailabilityOnOrder': [], 'InfoMessages': [], 'SurchargeMessages': [{'code': 'TARIFF_US_301', 'message': 'Tariff will be applied to this part.'}], 'ProductCompliance': [{'ComplianceName': 'USHTS', 'ComplianceValue': '8541100080'}, {'ComplianceName': 'ECCN', 'ComplianceValue': 'EAR99'}]}]}}
    ​

    If you check out the product in the browser, you can see all the product specs.

    The response doesn't contain all Product Specifications that should be listed under 'ProductAttributes'.

    How can I get all the specifications of the product?

    Continue reading...

Compartilhe esta Página