The Inventory API provides access to the vehicle inventories (or cars for sale) available at dealerships with a relationship with Edmunds.com. Due to the nature of this data, it’s only available to API Partners and Edmunds Developers. If you’re interested in becoming an API Partner, please email us.
If you haven’t yet, this might be a good time to read the API Overview page to familiarize yourself with some of the core concepts required to using the API.
The Inventory API requires OAuth 2.0 for both authentication and authorization. Here is how you would get an OAuth access token:
curl -i -H 'Content-Type: application/x-www-form-urlencoded' 'https://api.edmunds.com/inventory/token' -X POST -d 'client_id=<api key>' -d 'client_secret=<shared secret>' -d 'grant_type=client_credentials'
You will find both your api key and shared secret in your dashboard.
If you’ve been given access by the Edmunds API Team, you should receive an access_token back. The access_token is valid for one hour after which you’ll need to get a new one.
Now that you have your access_token for the hour, you can start making calls to the Inventory API resources this way:
curl -i -H 'Authorization: Bearer <access_token>' 'http://api.edmunds.com/{endpoint}'
Alternative, you can add the the access_token to the query string:
curl -i 'http://api.edmunds.com/{endpoint}?access_token=<access_token>'
We do not recommend the second approach since it’s not secure.
Let’s get right to it, shall we? Here’s a few REST calls that should get you started using the API with ease. Better yet, you could use our API Console to make live API calls of your own.
https://api.edmunds.com/api/inventory/v1/vin?vin={VIN}&fmt=json
https://api.edmunds.com/api/inventory/v1/getall?types=NEW&dealerId=26711
The inventory detail page on Edmunds.com has the following URL structure:
http://www.edmunds.com/inventory/vin.html?make={vehicle make}&inventoryId={vehicle inventory ID}&zip={vehicle zip code}&radius={the radius to search}
The information you need to compile this URL is available in the API response of all endpoints in this resource. This piece of information is important when you want to send traffic back to Edmunds.com so your users can transact on that inventory.
Due to the nature of the inventory data, not all of it is available to the public, or even to strategic partners. Every endpoint has a section called Response Format in which each datapoint returned is described and its visibility called out. Our visibility tiers are as follows:
The Inventory API has two resources:
Resource Name | Description |
---|---|
Inventory by VIN | If the VIN you supply matches a vehicle that’s for sale at one of the dealerships Edmunds.com, Inc. works with, you will get a response back. Otherwise, you will get an error. |
Inventory by Dealer ID or ZIP Code | Get a list of inventories. |