Inventory API Version 2
The TrustedParts.com Inventory API receives search requests via HTTPS POST. It supports both JSON and XML requests and responses. Please indicate with your requests which format you would like to use by including the Content-Type and Accept headers set to either "application/json" or "application/xml".
The url for the API is: https://api.trustedparts.com/v2/search
Technical Documentation
We have detailed technical documentation in Swagger format. That documentation is interactive and supports making sample requests using your API key. To make a sample request from the Swagger documentation, expand the POST endpoint, click Try it out, adjust the request parameters, and click Execute. Please note that you must adjust the request parameters where indicated for the request to succeed.
Request Fields
Here is a summary of the Inventory API's request parameters. For more details, please reference the Swagger documentation.
*Required
| Name | Value | Additional Information |
|---|---|---|
| CompanyId* | Enter the assigned company identifier | The assigned company identifier can be found on the API Credentials page. |
| ApiKey* | Enter the assigned API key | The assigned API key can be found on the API Credentials page. |
| Queries* | Add a separate Queries section for each part number search. Note: If you enter multiple part numbers, an exact match search will be performed for each part number. Partial match results are only available for single part number requests. | |
| • SearchToken* | Enter the search term | The search term must be at least two characters long. |
| • Manufacturers | Enter an array of manufacturer names | Add this parameter to limit the search results to one or more manufacturers. Omit this parameter to search all authorized manufacturers. See our List of Manufacturer Names for supported manufacturers. |
| CountryCode | Enter a two-character ISO code or leave blank for geolocation | Leave this field blank if you would like us to geolocate the SourceIP parameter and use the country that the IP address is from. If you use the TrustedParts.com Inventory API to provide results on a website, this allows you to provide regional results to each user without any effort on your part. |
| CurrencyCode | Enter a three-character ISO code | If left blank, the search results default to USD. |
| Distributors | Enter an array of distributor names | Add this parameter to limit a search to one or more distributors. Omit this parameter to search all authorized distributors. See our List of Distributor Names for supported distributors. |
| InStockOnly* | Set to true or false | Set to true to view in-stock results only. Set to false to view all results. |
| ExactMatch* | Set to true or false | Set to true to view parts that match the SearchToken exactly. Set to false to include partial match results. Note: Partial match results are only available for single part number requests where the IsCrawler parameter is false or omitted. Most punctuation and spacing are ignored when determining what is an exact match. For instance, BAT-54C is an exact match for the SearchToken BAT54C. |
| IsCrawler* | Set to true or false | Set to true if the end user is a crawler or bot (e.g. Google, Bing, Baidu). Set to false if the end user is not a crawler or if undetermined. |
| UseCachedData | Set to true or false | If this parameter is not supplied or set to false, the TrustedParts.com Inventory API will provide results based on real-time stock and pricing services provided by participating distributors. This is the preferred setting since it yields the most accurate results. However, if you need extremely fast responses or need to submit a high volume of requests in a short period of time, you may set this parameter to true. This will direct the TrustedParts.com Inventory API to use an optimized search process that retrieves results from locally cached data instead of real-time data. Note: If the IsCrawler parameter is set to true or the TrustedParts.com Inventory API detects that a request is made on behalf of a crawler, the UseCachedData parameter is ignored since results for crawlers are always retrieved from locally cached data. |
| UserAgent* | Enter user agent | For requests made by a website: Provide the web browser user agent of the end user or crawler who will view the results. Please ensure the accuracy of this value so that TrustedParts.com can verify the identity of users who receive results. For requests made by an internal application instead of a website: Provide the name of the application that is making the request and, if possible, a unique user identifier (preferably an ID number; no personally identifiable information should be supplied). |
| SourceIp | Enter the IP address | For requests made by a website: Provide the IP (Internet Protocol) address of the end user or crawler who will view the results. Please ensure the accuracy of this value so that TrustedParts.com can verify the identity of users who receive results. For requests made by an internal application instead of a website: Omit this property; the public IP address of your system will be used as the request IP address. Note: Please do not provide an internal IP address for this value. Geolocation: When the CountryCode parameter is omitted or left blank, the SourceIP parameter will be used to geolocate the request and provide regional results. |