# Demographics


Read-only value dictionaries for the `Demographics` dataset on
[Create Audience](/api/v2/audiences#post-apiv2analysesaudiencescreate): genders,
age ranges, marital statuses and income ranges.

The four dictionaries are flat - there is no cascade and they take no parent
parameters. Each returns `{ value, text }` rows where `value` is the literal
string the create body's matching field accepts and `text` is the label to show
a user.

Every read here is authenticated and JSON-only (bearer token + `Accept:
application/json`) and uses the read rate bucket (120 requests/min per caller).

## Get Demographics Genders {#get-apiv2analysesreferencedemographicsgenders}

`GET /api/v2/analyses/reference/demographics/genders`

The gender values a `Demographics` dataset filters on. `value` is what the
create body's `genders` takes. Paginated.

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | No | Page number (standard pagination). |
| `per_page` | integer | No | Items per page, capped at 500. |
| `search` | string | No | Optional free-text filter on the value (case-insensitive contains). |

{{< tabs >}}

  {{< tab name="cURL" >}}
  ```bash
  curl "https://console.intuizi.com/api/v2/analyses/reference/demographics/genders" \
    -H "Authorization: Bearer <YOUR_TOKEN>" \
    -H "Accept: application/json"
  ```
  {{< /tab >}}

  {{< tab name="Python" >}}
  ```python
  import requests

  res = requests.get(
      "https://console.intuizi.com/api/v2/analyses/reference/demographics/genders",
      headers={"Authorization": "Bearer <YOUR_TOKEN>", "Accept": "application/json"},
  )
  genders = res.json()["data"]["items"]
  ```
  {{< /tab >}}

  {{< tab name="JavaScript" >}}
  ```javascript
  const res = await fetch(
    "https://console.intuizi.com/api/v2/analyses/reference/demographics/genders",
    { headers: { Authorization: "Bearer <YOUR_TOKEN>", Accept: "application/json" } }
  );
  const genders = (await res.json()).data.items;
  ```
  {{< /tab >}}

  {{< tab name="PHP" >}}
  ```php
  $res = Http::withToken('<YOUR_TOKEN>')->acceptJson()
      ->get('https://console.intuizi.com/api/v2/analyses/reference/demographics/genders');
  $genders = $res->json('data.items');
  ```
  {{< /tab >}}

{{< /tabs >}}

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resources fetched successfully.",
  "data": {
    "items": [
      { "value": "F", "text": "Female" },
      { "value": "M", "text": "Male" }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 500,
      "total": 2,
      "last_page": 1
    }
  }
}
```

## Get Demographics Ages {#get-apiv2analysesreferencedemographicsages}

`GET /api/v2/analyses/reference/demographics/ages`

The age ranges a `Demographics` dataset filters on. `value` is what the create
body's `ages` takes. Paginated.

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | No | Page number (standard pagination). |
| `per_page` | integer | No | Items per page, capped at 500. |
| `search` | string | No | Optional free-text filter on the range (case-insensitive contains). |

{{< tabs >}}

  {{< tab name="cURL" >}}
  ```bash
  curl "https://console.intuizi.com/api/v2/analyses/reference/demographics/ages" \
    -H "Authorization: Bearer <YOUR_TOKEN>" \
    -H "Accept: application/json"
  ```
  {{< /tab >}}

  {{< tab name="Python" >}}
  ```python
  import requests

  res = requests.get(
      "https://console.intuizi.com/api/v2/analyses/reference/demographics/ages",
      headers={"Authorization": "Bearer <YOUR_TOKEN>", "Accept": "application/json"},
  )
  ages = res.json()["data"]["items"]
  ```
  {{< /tab >}}

  {{< tab name="JavaScript" >}}
  ```javascript
  const res = await fetch(
    "https://console.intuizi.com/api/v2/analyses/reference/demographics/ages",
    { headers: { Authorization: "Bearer <YOUR_TOKEN>", Accept: "application/json" } }
  );
  const ages = (await res.json()).data.items;
  ```
  {{< /tab >}}

  {{< tab name="PHP" >}}
  ```php
  $res = Http::withToken('<YOUR_TOKEN>')->acceptJson()
      ->get('https://console.intuizi.com/api/v2/analyses/reference/demographics/ages');
  $ages = $res->json('data.items');
  ```
  {{< /tab >}}

{{< /tabs >}}

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resources fetched successfully.",
  "data": {
    "items": [
      { "value": "25-34", "text": "25-34" },
      { "value": "35-44", "text": "35-44" }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 500,
      "total": 2,
      "last_page": 1
    }
  }
}
```

## Get Demographics Marital Statuses {#get-apiv2analysesreferencedemographicsmarital-statuses}

`GET /api/v2/analyses/reference/demographics/marital-statuses`

The marital status values a `Demographics` dataset filters on. `value` is what
the create body's `marital_statuses` takes. Paginated.

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | No | Page number (standard pagination). |
| `per_page` | integer | No | Items per page, capped at 500. |
| `search` | string | No | Optional free-text filter on the value (case-insensitive contains). |

{{< tabs >}}

  {{< tab name="cURL" >}}
  ```bash
  curl "https://console.intuizi.com/api/v2/analyses/reference/demographics/marital-statuses" \
    -H "Authorization: Bearer <YOUR_TOKEN>" \
    -H "Accept: application/json"
  ```
  {{< /tab >}}

  {{< tab name="Python" >}}
  ```python
  import requests

  res = requests.get(
      "https://console.intuizi.com/api/v2/analyses/reference/demographics/marital-statuses",
      headers={"Authorization": "Bearer <YOUR_TOKEN>", "Accept": "application/json"},
  )
  marital_statuses = res.json()["data"]["items"]
  ```
  {{< /tab >}}

  {{< tab name="JavaScript" >}}
  ```javascript
  const res = await fetch(
    "https://console.intuizi.com/api/v2/analyses/reference/demographics/marital-statuses",
    { headers: { Authorization: "Bearer <YOUR_TOKEN>", Accept: "application/json" } }
  );
  const maritalStatuses = (await res.json()).data.items;
  ```
  {{< /tab >}}

  {{< tab name="PHP" >}}
  ```php
  $res = Http::withToken('<YOUR_TOKEN>')->acceptJson()
      ->get('https://console.intuizi.com/api/v2/analyses/reference/demographics/marital-statuses');
  $maritalStatuses = $res->json('data.items');
  ```
  {{< /tab >}}

{{< /tabs >}}

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resources fetched successfully.",
  "data": {
    "items": [
      { "value": "M", "text": "Married" },
      { "value": "S", "text": "Single" }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 500,
      "total": 2,
      "last_page": 1
    }
  }
}
```

## Get Demographics Incomes {#get-apiv2analysesreferencedemographicsincomes}

`GET /api/v2/analyses/reference/demographics/incomes`

The income ranges a `Demographics` dataset filters on, returned low to high.
`value` is what the create body's `incomes` takes. Paginated.

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | No | Page number (standard pagination). |
| `per_page` | integer | No | Items per page, capped at 500. |
| `search` | string | No | Optional free-text filter on the range (case-insensitive contains). |

{{< tabs >}}

  {{< tab name="cURL" >}}
  ```bash
  curl "https://console.intuizi.com/api/v2/analyses/reference/demographics/incomes" \
    -H "Authorization: Bearer <YOUR_TOKEN>" \
    -H "Accept: application/json"
  ```
  {{< /tab >}}

  {{< tab name="Python" >}}
  ```python
  import requests

  res = requests.get(
      "https://console.intuizi.com/api/v2/analyses/reference/demographics/incomes",
      headers={"Authorization": "Bearer <YOUR_TOKEN>", "Accept": "application/json"},
  )
  incomes = res.json()["data"]["items"]
  ```
  {{< /tab >}}

  {{< tab name="JavaScript" >}}
  ```javascript
  const res = await fetch(
    "https://console.intuizi.com/api/v2/analyses/reference/demographics/incomes",
    { headers: { Authorization: "Bearer <YOUR_TOKEN>", Accept: "application/json" } }
  );
  const incomes = (await res.json()).data.items;
  ```
  {{< /tab >}}

  {{< tab name="PHP" >}}
  ```php
  $res = Http::withToken('<YOUR_TOKEN>')->acceptJson()
      ->get('https://console.intuizi.com/api/v2/analyses/reference/demographics/incomes');
  $incomes = $res->json('data.items');
  ```
  {{< /tab >}}

{{< /tabs >}}

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resources fetched successfully.",
  "data": {
    "items": [
      { "value": "50k-100k", "text": "$50,000 - $100,000" },
      { "value": "100k-150k", "text": "$100,000 - $150,000" }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 500,
      "total": 2,
      "last_page": 1
    }
  }
}
```
