> ## Documentation Index
> Fetch the complete documentation index at: https://api.globalwebindex.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Audiences

Audiences are custom segments of respondents that you can create to focus your analysis on specific groups of people. These segments help you unlock insights that are most relevant to your goals by isolating key behaviors, demographics, or preferences within GWI’s rich data.

With GWI, you can build Audiences that reflect real-world segments of the populace, ensuring that your data-driven decisions are accurate and actionable. Whether you’re targeting Gen Z gamers, frequent social media users, or parents who stream content daily, Audiences allow you to explore behaviors and trends tailored to your exact needs.

By defining an Audience, you can:

1. Focus your insights on the groups that matter most to your business.
2. Compare segments side-by-side to uncover differences and affinities.
3. Create tailored strategies for marketing, product development, and more.

Audiences can be built using a combination of attributes, behaviors and filters, such as location, frequency of use, or demographics. Once created, they can be applied across other tools like Charts, Crosstabs, Dashboards, or API queries to streamline analysis and deliver insights at scale.

Let's create an Audience of people aged between 25-34 who are based in the UK and who use Instagram, Facebook or Twitter at least once a day or like gaming, and have no children.

### Create Audience

* Use AND, OR, NOT in the Audience request:
  * live in UK (`s2_44`)
  * 25-34 years old (`q4_3`)
  * use Instagram/Facebook/Twitter daily (`q42011a_3`/`q42011a_14`/`q42011a_25`) **or** like gaming (`q3181c_23`)
  * do **not** have children living with them (NOT `q22010_2`)

<CodeGroup>
  ```bash Create Audience theme={null}
  curl -X POST "https://api.globalwebindex.com/v2/saved/audiences" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d @req.json
  ```
</CodeGroup>

### Manage Audience by ID

You can simply use a GET request with given `<AUDIENCE_ID>` to retrieve the Audience. To update the Audience, you can use either PATCH or PUT method. Both the request body and the response are equivalent to when you create an Audience. To remove the Audience, you can use DELETE method.

<CodeGroup>
  ```bash Retrieve Audience theme={null}
  curl -X GET "https://api.globalwebindex.com/v2/saved/audiences/<AUDIENCE_ID>" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```bash Update Audience theme={null}
  curl -X PATCH "https://api.globalwebindex.com/v2/saved/audiences/<AUDIENCE_ID>" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY"

  OR

  curl -X PUT "https://api.globalwebindex.com/v2/saved/audiences/<AUDIENCE_ID>" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```bash Delete Audience theme={null}
  curl -X DELETE "https://api.globalwebindex.com/v2/saved/audiences/<AUDIENCE_ID>" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</CodeGroup>

<RequestExample>
  ```json req.json theme={null}
  {
    "name": "test_audience",
    "expression": {
      "and": [
        {
          "question": "s2",
          "datapoints": [
            "s2_44"
          ]
        },
        {
          "question": "q4",
          "datapoints": [
            "q4_3"
          ]
        },
        {
          "or": [
            {
              "question": "q42011a",
              "datapoints": [
                "q42011a_25",
                "q42011a_14",
                "q42011a_3"
              ],
              "suffixes": [
                2
              ]
            },
            {
              "question": "q3181c",
              "datapoints": [
                "q3181c_23"
              ]
            }
          ]
        },
        {
          "question": "q22010",
          "datapoints": [
            "q22010_2"
          ],
          "not": true
        }
      ]
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Create Response theme={null}
  {
    "id": "<AUDIENCE_ID>",
    "v1_id": 123456789,
    "folder_id": null,
    "description": "",
    "name": "test_audience",
    "expression": {
      "and": [
        {
          "datapoints": [
            "s2_44"
          ],
          "question": "s2"
        },
        {
          "datapoints": [
            "q4_3"
          ],
          "question": "q4"
        },
        {
          "or": [
            {
              "datapoints": [
                "q42011a_25",
                "q42011a_14",
                "q42011a_3"
              ],
              "question": "q42011a",
              "suffixes": [
                2
              ]
            },
            {
              "datapoints": [
                "q3181c_23"
              ],
              "question": "q3181c"
            }
          ]
        },
        {
          "datapoints": [
            "q22010_2"
          ],
          "question": "q22010",
          "not": true
        }
      ]
    },
    "datasets": [
      "ds-core"
    ],
    "flags": [
      "authored"
    ],
    "position": 0,
    "shared": false,
    "sharings": {
      "private": {
        "organisation_ids": null,
        "users": null,
        "sharer": {
          "email": "yourname@gwi.com",
          "id": 654321
        }
      }
    },
    "user_id": 654321,
    "permissions": {
      "audience_overall": "accessible"
    },
    "created_at": "2025-01-15T10:07:54.833633391Z",
    "updated_at": "2025-01-15T10:07:54.833633391Z"
  }
  ```

  ```json Retrieve Response highlight={5} theme={null}
  {
    "id": "<TEST_AUDIENCE_ID>",
    "v1_id": 123456789,
    "folder_id": null,
    "description": "This audience consists of individuals who currently reside in the UK, are between 25 and 34 years old, and either visit or use Instagram, Facebook, or other services daily or are interested in gaming, while not having their child(ren) living in their household.",
    "name": "test_audience",
    "expression": {
    },
    "etc.": "..."
  }
  ```
</ResponseExample>

More detail on how audiences work in our platform is available in our [help center](https://help.globalwebindex.com/en/articles/10725807-get-started-with-audiences).
