Source: https://dinakar-rewind.docs.pageloop.ai/api-reference/places/getplacesstats

# Check-in stats

GET `https://api.rewind.rest/v1/places/stats`

Returns aggregate check-in statistics: total check-ins, unique venues, this-year count, top categories, top cities, and top venues. Optional date/from/to params scope every aggregation to the range except this\_year, which always counts the current UTC year.

## Authorization

#### Authorization (header, string, required)

API key. Read keys (rw\_live\_...) access GET endpoints. Admin keys (rw\_admin\_...) access all endpoints.

## Query Parameters

#### date (query, string)

Single day (YYYY-MM-DD). Overrides from/to.

#### from (query, string)

Range start, inclusive (ISO 8601)

#### to (query, string)

Range end, inclusive (ISO 8601)

## Response

#### 200

Check-in statistics

#### total (number, required)

#### unique\_venues (number, required)

#### this\_year (number, required)

#### top\_categories (array of object, required)

#### properties

#### category (string, required)

#### count (number, required)

#### icon (string, required)

#### top\_cities (array of object, required)

#### properties

#### city (string, required)

#### count (number, required)

#### top\_venues (array of object, required)

#### properties

#### venue\_name (string, required)

#### count (number, required)

#### icon (string, required)

#### city (string, required)

#### 400

Bad request

#### error (string, required)

#### status (integer, required)

#### 401

Unauthorized

#### error (string, required)

#### status (integer, required)

#### Request

```bash cURL
curl -X GET 'https://api.rewind.rest/v1/places/stats' \
  -H 'Authorization: Bearer <token>'
```

```javascript JavaScript
const res = await fetch('https://api.rewind.rest/v1/places/stats', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <token>',
  },
});
const data = await res.json();
```

```python Python
import requests

res = requests.get(
    'https://api.rewind.rest/v1/places/stats',
    headers={'Authorization': 'Bearer <token>'}
)
data = res.json()
```

#### Response

```json 200
{
  "total": 0,
  "unique_venues": 0,
  "this_year": 0,
  "top_categories": [
    {
      "category": "string",
      "count": 0,
      "icon": "string"
    }
  ],
  "top_cities": [
    {
      "city": "string",
      "count": 0
    }
  ],
  "top_venues": [
    {
      "venue_name": "string",
      "count": 0,
      "icon": "string",
      "city": "string"
    }
  ]
}
```

```json 400
{
  "error": "Not found",
  "status": 404
}
```

```json 401
{
  "error": "Not found",
  "status": 404
}
```
