Dealer Stats With Vins (Basic) API Documentation Version 2.0
Introduction
The Dealer Stats API enables your application to retrieve the statistics related to your inventory.
This API is available for Partner level.
Here are the basic steps for using the API:
- Make a POST to the https://www.cargurus.com/Cars/api/2.0/dealerStatsRequest.action URL specifying the parameters described below
- Retrieve and process the response which will be a JSON string representing the DealerStatsResponse object also described below.
HTTP Request
| URL |
https://www.cargurus.com/Cars/api/2.0/dealerStatsRequest.action |
| Method |
POST |
| Parameters |
| Name |
Description |
Object Type |
| appId |
The application id - provided by CarGurus |
string |
| authToken |
The authentication token - provided by CarGurus |
string |
| body |
JSON representation of the DealerStatsRequest object described below |
DealerStatsRequest object |
|
DealerStatsRequest Fields
| Name |
Description |
Object Type |
Notes |
| external_dealer_id |
The dealer's external id |
String |
|
| start_date |
The start date |
Date |
The date is inclusive |
| end_date |
The end date |
Date |
The date is inclusive.The end date can not be more than 6 months from the start date |
HTTP Response
The API returns a JSON formatted string representing an DealerStatsResponse object described below.
DealerStatsResponse Fields
| Name |
Description |
Object Type |
| success |
Whether the request was processed successfully. This flag describes the overall status of the request. If success is false, then the error object described
below will contain the appropriate error code and description. |
boolean (true/false) |
| error |
An ApiError object containing a specific error code and description |
ApiError object |
| vin_stats |
The list of VinStatsBasic objects, each containing stats for a specific vin. |
Array of VinStatsBasic objects |
VinStats Basic Fields
| Name |
Description |
Object Type |
| vin |
car vin number |
string |
| vdps |
The total number of vehicle detail page views for the date range specified |
Integer |
| srps |
The total number of search result page views for the date range specified |
Integer |
ApiError Fields
| Name |
Description |
Object Type |
| error_code |
The error code |
integer |
| description |
The error's description |
string |
Error Codes
Error codes can be generated at 2 levels:
1. Top level response level. These codes represent problems with the overall processing of the request (10X)
2. Individual listing level - represent issues with computing the instant market value for an individual listings (20X)
Top Level Response Error Codes
- 100 - bad or malformed request
- 101 - missing or invalid authentication credentials
- 102 - invalid application id
- 104 - the rate of requests is too high
- 105 - unexpected error
Individual Listing Error Codes
- 200 - couldn't match the requested listing to a specific model in the CarGurus ontology
- 201 - couldn't match the requested listing to a specific model/year in the CarGurus ontology
- 202 - the system doesn't have enough data to compute the CarGurus Instant Market Value for the specified car
Examples
Example 1 - (Valid Request)
HTTP Request's 'body' parameter:
{
"external_dealer_id" : "myusedcarcenter",
"start_date" : "2013-10-14",
"end_date" : "2013-10-16"
}
HTTP Response
{
"vin_stats": [
{
"srps": 200,
"vdps": 213,
"vin": "1FMCU0GX3EUC76848",
},
{
"srps": 99,
"vdps": 76,
"vin": "1J4FY19S4WP704453",
}
],
"success": true
}
Example 2 - (Missing or invalid authToken)
HTTP Response
{
"error": {
"description": "Invalid auth credentials. Details: Invalid auth token",
"error_code": 101
},
"success": false
}