For some time i have been trying to connect with Mouser API. I have already tried to use requests library as well as urllib. For the request without parameter such as getting the manufacturer list it is all working well. Problems starts when I tried to get information that requires providing some parameters.
Ask that is working:
string_req = f"{self.__api_host}/api/v{self.__version}/search/manufacturerlist?apiKey={self.__api_key}"
ans = urllib.request.urlopen(string_req)
where:
self.__api_host='https://api.mouser.com'
self.__version=1.0
self.__api_key= <key generated in Mouser webpage>
And here we get to the question. How can I pass my params which are for exaple:
parameters = {
"SearchByKeywordRequest": {
"keyword": "resistor",
"records": 50,
"startingRecord": 0,
"searchOptions": 4,
"searchWithYourSignUpLanguage": "Polish"
}
}
to download the results in the same way that it is possible with the first ask about the manufacturers.
It is my first ask here in Stack, so if I have left to little information, please let me know i will provide them as soon as possible.