Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

package case information #4

Closed
hagayjCybord opened this issue Mar 27, 2023 · 1 comment
Closed

package case information #4

hagayjCybord opened this issue Mar 27, 2023 · 1 comment

Comments

@hagayjCybord
Copy link

I wrote a code of getting data of mpn
`import requests
import json

api_key = ''
search_term = 'SI4450DY-T1-E3'
url = f'https://api.mouser.com/api/v1/search/partnumber?apiKey={api_key}&partnumber={search_term}'

headers = {
'Content-Type': 'application/json',
'x-mouser-api-key': api_key
}

payload = {
'SearchByPartRequest': {
'mouserPartNumber': search_term,
'IncludeExtendedAttributes': 'true'
}
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()

with open("data.json", "w") as outfile:
json.dump(data, outfile, indent=4)

print(data)
`
is it possible to get package case information (like SOIC-8) in this part
i can't find it on the documentation

@eeintech eeintech mentioned this issue Mar 27, 2023
Merged
@eeintech
Copy link
Contributor

eeintech commented Mar 27, 2023

Hello @hagayjCybord

It doesn't seem that you are using the mouser-api (this project) to search Mouser parts using their API, why not?
You would need to ask the Mouser team to get the package case info because I don't think their API currently supports it.

Also, testing with SI4450DY-T1-E3 (which is an obsolete part by the way) I found an issue with the mouser-api library which will be fixed after merging #5.

With the fix, this is what the library/Mouser API returns:

$ python mouser_cli.py search partnumber --number SI4450DY-T1-E3
[LINK]	https://api.mouser.com/api/v1.0/search/partnumber
[BODY]
{
    "SearchByPartRequest": {
        "mouserPartNumber": "SI4450DY-T1-E3",
        "partSearchOptions": "None"
    }
}
[DATA]
{
    "Availability": null,
    "Category": "MOSFET",
    "DataSheetUrl": "https://www.mouser.com/datasheet/2/427/70144-1765501.pdf",
    "Description": "MOSFET 60V 7.5A 2.5W",
    "ImagePath": "https://www.mouser.com/images/mouserelectronics/images/SO_8_t.jpg",
    "Manufacturer": "Vishay / Siliconix",
    "ManufacturerPartNumber": "SI4450DY-T1-E3",
    "MouserPartNumber": "781-SI4450DY-T1-E3",
    "PriceBreaks": [],
    "ProductAttributes": [
        {
            "AttributeName": "Packaging",
            "AttributeValue": "Reel"
        },
        {
            "AttributeName": "Packaging",
            "AttributeValue": "Cut Tape"
        },
        {
            "AttributeName": "Standard Pack Qty",
            "AttributeValue": "2500"
        }
    ],
    "ProductDetailUrl": "https://www.mouser.ca/ProductDetail/Vishay-Siliconix/SI4450DY-T1-E3?qs=GQB1MWV6WHUTDL7zT2As8Q%3D%3D"
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants