Api documentation

Api documentation

Inventory API

Inventory API
 
 

Page Content


Overview

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.

Back to top

OAuth 2.0

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.

Back to top

Quick Start

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.

Example 1: Get a listed call for sale by its VIN

https://api.edmunds.com/api/inventory/v1/vin?vin={VIN}&fmt=json

Example 2: Get available NEW cars for sale at a specific dealership

https://api.edmunds.com/api/inventory/v1/getall?types=NEW&dealerId=26711

Back to top

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.

Back to top

Visibility Tiers

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:

  1. Edmunds: This datapoint is visible to Edmunds developers
  2. Partners: This datapoint is visible to strategic partners. Your API Key has to be assigned as such.
  3. Public: This datapoint is visible to public partners (those who have their rate limit raised and apps verified for compliance with our TOS.) Your API Key has to be assigned as such.

Back to top

API Uses

  • Get all dealerships within a certain zip code and radius
  • Get all dealerships by the kinds of cars they sell
  • Get consumer ratings and reviews of a dealership by its Edmunds ID
  • Get consumer ratings and reviews of dealerships by their car makes and the zip code they’re in

Back to top

Available Resources

The Inventory API has two resources:

Resource NameDescription
Inventory by VINIf 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 CodeGet a list of inventories for sale at a dealership by Dealer ID or by ZIP Code.

Back to top