Dealer Stats With Daily breakdown 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 both for Partner level and for Dealer 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 |
Required if it is a partner level request. Not required if it is a dealer level request |
| start_date |
The start date |
Date |
The date is inclusive |
| end_date |
The end date |
Date |
The date is inclusive |
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 |
| daily_stats |
The list of DailyStats objects, each containing stats for a specific day. |
Array of DailyStats objects |
| printouts |
The total number of printed dealer maps/address instructions for the date range specified |
Integer |
| 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 |
| chat_leads |
The total number of leads chats for the date range specified |
Integer |
| sms_leads |
The total number of lead sms for the date range specified |
Integer |
| phone_leads |
The total number of leads phone searches for the date range specified |
Integer |
| email_leads |
The total number of leads emails for the date range specified |
Integer |
| twitter_clicks |
The total number of twitter clicks for the date range specified |
Integer |
| facebook_clicks |
The total number of facebook clicks for the date range specified |
Integer |
| website_clicks |
The total number of website clicks for the date range specified |
Integer |
| map_clicks |
The total number of map clicks for the date range specified |
Integer |
DailyStats Fields
| Name |
Description |
Object Type |
| date |
The date for the stats contained within this object |
Date |
| impressions |
The number of matching searches for the day |
integer |
| clicks |
The number of clicks for the day |
integer |
| leads |
The number of leads for the day |
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
- 103 - I/O error
- 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" : "2017-10-14",
"end_date" : "2017-10-16"
}
HTTP Response
{
"phone_leads": 781,
"twitter_clicks": 1035,
"printouts": 789,
"vdps": 12724,
"chat_leads": 800,
"leads_email": 999,
"map_clicks": 333,
"sms_leads": 412,
"facebook_clicks": 133,
"website_clicks": 54,
"srps": 254816,
"daily_stats": [
{
"date": "2017-10-14",
"leads": 0,
"clicks": 431,
"impressions": 7191
},
{
"date": "2017-10-16",
"leads": 0,
"clicks": 454,
"impressions": 7790
},
],
"success": true,
}
Example 2 - (Missing or invalid authToken)
HTTP Response
{
"error": {
"description": "Invalid auth credentials. Details: Invalid auth token",
"error_code": 101
},
"success": false
}