> For the complete documentation index, see [llms.txt](https://everyday-digital.gitbook.io/falkor-dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://everyday-digital.gitbook.io/falkor-dev-docs/analytics/audience/demographics.md).

# Demographics

The Demographics endpoint allows viewing analytics on age groups. This end point allows demographic analytics to be viewed for Apps, Stories, Pathways OR Streams. &#x20;

## Available Demographic Endpoints

`v1/analytics/demographics/apps`\
Get demographics for an app or a list of apps.

`v1/analytics/demographics/pathways`\
Get demographics for a pathways or a list of pathways.

`v1/analytics/demographics/streams`\
Get demographics for a stream or a list of streams.

`v1/analytics/demographics/stories`\
Get demographics for a story or a list of stories.

## Parameters <a href="#parameters" id="parameters"></a>

The items parameter allows you to filter items based on the name or ID of the item. If the item parameter is not provided the endpoint will return the latest 10 items.

<table><thead><tr><th width="194"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td><strong>items</strong></td><td><strong>Array of Strings</strong> <br>Item name or ID</td></tr></tbody></table>

## Examples

### Get Demographics For Apps

The example below retrieves demographics for a list of apps.

```
curl -X POST \
  v1/analytics/demographics/apps \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'\
```

### Get Demographics For A Specific Stream

The example below retrieves demographics for a single stream.

```
curl -X POST \
  v1/analytics/locations/streams \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'\
  -d '{
    "items" : ["My Stream"]
  }'
```

## Success Response

Whichever `demographics` endpoint you are using a successful response will return an array of items with each item containing a context item (app, pathway, stream or story) and corresponding `demographics` data. The example below shows a successful response when using the `demographics/apps` endpoint.

```
{
    "status": "success",
    "data": [
        {
            "app": {
                "name": "Falkor",
                "version": "2.5.0",
                "type": "app",
                "ID": "com.codohydra.falkor"
            },
            "demographics": [
                {
                    "group": "Unknown",
                    "users": 0
                },
                {
                    "group": "13 - 17",
                    "users": 2
                },
                {
                    "group": "18 - 29",
                    "users": 6
                },
                {
                    "group": "30 - 39",
                    "users": 10
                },
                {
                    "group": "40 - 49",
                    "users": 15
                },
                {
                    "group": "50 - 59",
                    "users": 0
                },
                {
                    "group": "60 - 69",
                    "users": 0
                },
                {
                    "group": "70+",
                    "users": 0
                }
            ]
        },
        ...etc
    ],
    "hash": "f3da4f2cd460aac776716df8ebf684c2",
    "response_time": 0.180128812789917
}
```
