Search for products and retrieve details and pricing.
This Python package is automatically generated by the Swagger Codegen project:
- API version: Ps2
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen For more information, please visit https://developer.digikey.com/support
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import swagger_client
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import swagger_client
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.PartSearchApi(swagger_client.ApiClient(configuration))
authorization = 'authorization_example' # str | OAuth Bearer Token. Please see<a href= \"https://developer.digikey.com/documentation/oauth\" target= \"_blank\" > OAuth 2.0 Documentation </a > page for more info.
x_digikey_client_id = 'x_digikey_client_id_example' # str | The Client Id for your App.
x_digikey_locale_site = 'x_digikey_locale_site_example' # str | Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. (optional)
x_digikey_locale_language = 'x_digikey_locale_language_example' # str | Two letter code for language to search on. Language must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: br, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, nl, no, pl, pt, ro, sv, th, zhs, zht (optional)
x_digikey_locale_currency = 'x_digikey_locale_currency_example' # str | Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. (optional)
x_digikey_customer_id = 'x_digikey_customer_id_example' # str | Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. (optional)
try:
# Returns all Product Categories. Category Id can be used in KeywordSearchRequest.Filters.TaxonomyIds to restrict a keyword search to a given category
api_response = api_instance.categories(authorization, x_digikey_client_id, x_digikey_locale_site=x_digikey_locale_site, x_digikey_locale_language=x_digikey_locale_language, x_digikey_locale_currency=x_digikey_locale_currency, x_digikey_customer_id=x_digikey_customer_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling PartSearchApi->categories: %s\n" % e)
All URIs are relative to https://api.digikey.com/Search/v3
Class | Method | HTTP request | Description |
---|---|---|---|
PartSearchApi | categories | GET /Categories | Returns all Product Categories. Category Id can be used in KeywordSearchRequest.Filters.TaxonomyIds to restrict a keyword search to a given category |
PartSearchApi | categories_by_id | GET /Categories/{categoryId} | Returns Category for given Id. Category Id can be used in KeywordSearchRequest.Filters.TaxonomyIds to restrict a keyword search to a given category |
PartSearchApi | digi_reel_pricing | GET /Products/{digiKeyPartNumber}/DigiReelPricing | Calculate the DigiReel pricing for the given DigiKeyPartNumber and RequestedQuantity |
PartSearchApi | keyword_search | POST /Products/Keyword | KeywordSearch can search for any product in the Digi-Key catalog. |
PartSearchApi | manufacturer_product_details | POST /Products/ManufacturerProductDetails | Create list of ProductDetails from the matches of the requested manufacturer product name. |
PartSearchApi | manufacturers | GET /Manufacturers | Returns all Product Manufacturers. ManufacturersId can be used in KeywordSearchRequest.Filters.ManufacturerIds to restrict a keyword search to a given Manufacturer |
PartSearchApi | product_details | GET /Products/{digiKeyPartNumber} | Retrieve detailed product information including real time pricing and availability. |
PartSearchApi | suggested_parts | GET /Products/{partNumber}/WithSuggestedProducts | Retrieve detailed product information and two suggested products |
- ApiErrorResponse
- ApiValidationError
- AssociatedProduct
- BasicProduct
- CategoriesResponse
- Category
- DigiReelPricingDto
- Filters
- IsoSearchLocale
- KeywordSearchRequest
- KeywordSearchResponse
- KitPart
- LimitedParameter
- LimitedTaxonomy
- ManufacturerInfo
- ManufacturerProductDetailsRequest
- ManufacturersResponse
- MediaLinks
- ParametricFilter
- PidVid
- PriceBreak
- Product
- ProductDetails
- ProductDetailsResponse
- ProductWithSuggestions
- SearchOption
- SortDirection
- SortOption
- SortParameters
- ValuePair
- Type: API key
- API key parameter name: X-DIGIKEY-Client-Id
- Location: HTTP header
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://api.digikey.com/v1/oauth2/authorize
- Scopes: N/A