# Troubleshooting Notes

1. If no query parameters are included, the endpoint returns the _lifetime_ of data for the Id.

2. If `days` and `start`/ `end` are both present in a request (not recommended) `start`/ `end` will take precedence.

## Parameters

### AdID
- **Type:** int32  
- **Required:** Yes  
- **Description:** The ID of the AD

### days
- **Type:** int32  
- **Description:** Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.

### start
- **Type:** string  
- **Description:** In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.

### end
- **Type:** string  
- **Description:** In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.

# Response Example

### 200
```json
{
  "ads": {
    "123": {
      "impressions": 123,
      "conversions": 0,
      "revenue": 0.117,
      "clicks": 0
    }
  }
}
```

# Example cURL Commands

## Basic Request
```bash
curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/ad/123'
```

## Using Days
```bash
curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/ad/123?days=42'
```

## Using Start/End
```bash
curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/ad/123?start=2017-04-18&end=2017-04-20'
```
