The McMaster-Carr Product Information API provides an external method for programmatically retrieving our
publicly available product information. Using this service, approved customers can import data on our
product offering into their own systems and stay up to date as specifications change. This API uses REST
principles and the authorization scheme, requests, responses, and error codes described below.
You can view sample requests by downloading our
Postman collection JSON and importing it
into Postman. After integrating with our system, you can test responses using the imported collection.
Please reach out to us at eCommerce@mcmaster.com if you have
any questions or would like to begin the integration process.
This table summarizes all of the requests that can be made to the McMaster-Carr Product Information API
Name | Http Method | Uri Stem | Description |
---|---|---|---|
Log in | POST | /v1/login | This request logs in users with valid credentials and certificates to return an authorization token. |
Log out | POST | /v1/logout | Log out the user by expiring the authorization token |
Add product | PUT | /v1/products | Adds a product to the user's list of subscribed products and returns the information for the product |
Remove product | DELETE | /v1/products | Removes a product from a user's list of subscribed products |
Changes | GET | /v1/changes | Retrieves all of the part numbers on a user's subscribed products list that have changed since a given start date. |
Product information | GET | /v1/products/* | Retrieves product information for a given part number |
Price | GET | /v1/products/*/price | Retrieves the current price of a certain product |
Image | GET | /v1/images/* | Retrieves an image from a relative path |
CAD | GET | /v1/cad/* | Retrieves a CAD file from a relative path |
Datasheet | GET | /v1/datasheets/* | Retrieves a datasheet from a relative path |
Request | This request logs in users with valid credentials and certificates to return an authorization token. | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/login | ||
Method | POST | ||
Request Body |
{
|
||
Success Responses | Example |
{
|
|
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Improperly formed request. Please check your POST body for errors. | |
401 | Unauthorized, Login failed. | ||
401 | Unauthorized, Too many failed login attempts. | ||
401 | Unauthorized, Incorrect username or password. | ||
401 | Unauthorized, This account ID is not authorized for the API: {{account ID}} |
Request | Log out the user by expiring the authorization token | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/logout | ||
Method | POST | ||
Request Body | N/A | ||
Success Responses | Example | Empty response body | |
Codes | 204 | No Content | |
Error Responses | Example |
{
|
|
Codes | 403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Request | Adds a product to the user's list of subscribed products and returns the information for the product | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/products | ||
Method | PUT | ||
Request Body |
{"URL":"https://mcmaster.com/{{partNumber}}"} |
||
Success Responses | Example |
{
|
|
Codes | 200 | OK | |
201 | Created | ||
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Invalid part number: {{PARTNUMBER}} | |
403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Request | Removes a product from a user's list of subscribed products | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/products | ||
Method | DELETE | ||
Request Body |
{"URL":"https://mcmaster.com/{{partNumber}}"} |
||
Success Responses | Example | Empty response body | |
Codes | 204 | No Content | |
404 | Not Found, Not subscribed to part number: {{partNumber}}. No subscription to remove | ||
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Improperly formed request. Please check your POST body for errors. | |
400 | Bad Request, Invalid part number: {{PARTNUMBER}} | ||
403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Request | Retrieves all of the part numbers on a user's subscribed products list that have changed
since a given start date.
Start date should be in the format MM/dd/yyyy. You can also include time: MM/dd/yyyy HH:mm. Our systems will record the last set of changes and return only products that have changed since the given start date. Note that changes means changes in the product information returned. Therefore, since the price link (unlike the other kinds of links) is stable, this end point will not reflect changes in price. |
||
---|---|---|---|
Url | https://api.mcmaster.com/v1/changes?start={{startDate}} | ||
Method | GET | ||
Request Body | N/A | ||
Success Responses | Example |
{
|
|
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Improperly formed request. Please check your URL Query String for errors. | |
403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Request | Retrieves product information for a given part number
Discontinued products will be marked inactive and contain a link to a suggested replacement, if there is one. Any differences between the originally requested and suggested replacement parts will be listed as SuggestedProductDifferences. |
||
---|---|---|---|
Url | https://api.mcmaster.com/v1/products/{{partNumber}} | ||
Method | GET | ||
Request Body | N/A | ||
Success Responses | Example |
{
|
|
Codes | 200 | OK | |
Example (Discontinued) |
{
|
||
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. | |
403 | Forbidden, You are not subscribed to this product: {{partNumber}} |
Request | Retrieves the current price of a certain product | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/products/{{partNumber}}/price | ||
Method | GET | ||
Request Body | N/A | ||
Success Responses | Example |
[
|
|
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. | |
403 | Forbidden, You are not subscribed to this product: {{partNumber}} |
Request | Retrieves an image from a relative path | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/images/{{imagePath}} | ||
Method | GET | ||
Request Body | N/A | ||
Success Responses | Example | The requested image file |
|
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Invalid file path requested | |
400 | Bad Request, Invalid file type requested | ||
403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Request | Retrieves a CAD file from a relative path | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/cad/{{cadPath}} | ||
Method | GET | ||
Request Body | N/A | ||
Success Responses | Example | The requested CAD file |
|
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Invalid file path requested | |
400 | Bad Request, Invalid file type requested | ||
403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Request | Retrieves a datasheet from a relative path | ||
---|---|---|---|
Url | https://api.mcmaster.com/v1/datasheets/{{dataSheetPath}} | ||
Method | GET | ||
Request Body | N/A | ||
Success Responses | Example | The requested datasheet |
|
Codes | 200 | OK | |
Error Responses | Example |
{
|
|
Codes | 400 | Bad Request, Invalid file type requested | |
400 | Bad Request, Invalid file path requested | ||
403 | Forbidden, Invalid authorization token: {{authToken}}. Please log in again to create a new one. |
Last updated on 10/29/19