{
  "question": "q42011a",
  "datapoints": [
    "q42011a_3"
  ],
  "suffixes": [
    1,
    2
  ],
  "locations": [
    "s2_1",
    "s2_49"
  ],
  "waves": [
    "q4_2022"
  ],
  "splitter": "s2",
  "segments": [
    "s2_1",
    "s2_49"
  ]
}
{
  "meta": {
    "type": "DATAPOINTS-SEGMENTS",
    "question": "q42011a",
    "splitter": "s2"
  },
  "data": [
    {
      "datapoint": "q42011a_3",
      "waves": [
        "q4_2022"
      ],
      "metrics": {
        "positive_sample": 15205,
        "positive_size": 117655215,
        "audience_sample": 25739,
        "audience_size": 205843910,
        "audience_percentage": 57.2,
        "audience_index": 104.7,
        "datapoint_sample": 20012,
        "datapoint_size": 140532912,
        "datapoint_percentage": 83.7
      },
      "suffixes": [
        1,
        2
      ],
      "segment": "s2_1"
    },
    {
      "datapoint": "q42011a_3",
      "waves": [
        "q4_2022"
      ],
      "metrics": {
        "positive_sample": 4807,
        "positive_size": 22877696,
        "audience_sample": 10828,
        "audience_size": 51688228,
        "audience_percentage": 44.3,
        "audience_index": 81.1,
        "datapoint_sample": 20012,
        "datapoint_size": 140532912,
        "datapoint_percentage": 16.3
      },
      "suffixes": [
        1,
        2
      ],
      "segment": "s2_49"
    }
  ]
}

Understanding how audience behaviour varies by location is essential for data-driven decision-making. The /v2/query/stats endpoint enables users to compare survey responses across different regions by applying a splitter for location-based questions. This allows for side-by-side analysis of key metrics, such as audience percentage, across multiple countries or markets.

The sidebar examples compare Facebook usage between USA (s2_1) and Germany (s2_49). To achieve that, you can set a “splitter” to the locations question s2 and “segments” to the two locations. You can also use locations filter to specify these two locations to get more specific datapoint metrics in the result, see Example A.

The most relevant metric seems to be the audience_percantage. Let’s say you would like to compare this percentage of respondents who use Facebook at least once a day between locations. If you save the Request A JSON body above as req.json, you can run the provided Python script example.

You can freely adjust the req.json to examine a different question asked in different waves, and in the script provide a list of all locations you’d like to include in your comparison.

Furthermore, you could narrow down the result with an Audience, too. Say you have an Audience of people who like gaming (q3181c_23), aged 25-34 (q4_3), and you’d like to compare the numbers of daily Facebook users within this Audience between the USA and Germany. (The Audience expression will be shorter than what was in the previous section.)

{
  "question": "q42011a",
  "datapoints": [
    "q42011a_3"
  ],
  "suffixes": [
    1,
    2
  ],
  "locations": [
    "s2_1",
    "s2_49"
  ],
  "waves": [
    "q4_2022"
  ],
  "splitter": "s2",
  "segments": [
    "s2_1",
    "s2_49"
  ]
}
{
  "meta": {
    "type": "DATAPOINTS-SEGMENTS",
    "question": "q42011a",
    "splitter": "s2"
  },
  "data": [
    {
      "datapoint": "q42011a_3",
      "waves": [
        "q4_2022"
      ],
      "metrics": {
        "positive_sample": 15205,
        "positive_size": 117655215,
        "audience_sample": 25739,
        "audience_size": 205843910,
        "audience_percentage": 57.2,
        "audience_index": 104.7,
        "datapoint_sample": 20012,
        "datapoint_size": 140532912,
        "datapoint_percentage": 83.7
      },
      "suffixes": [
        1,
        2
      ],
      "segment": "s2_1"
    },
    {
      "datapoint": "q42011a_3",
      "waves": [
        "q4_2022"
      ],
      "metrics": {
        "positive_sample": 4807,
        "positive_size": 22877696,
        "audience_sample": 10828,
        "audience_size": 51688228,
        "audience_percentage": 44.3,
        "audience_index": 81.1,
        "datapoint_sample": 20012,
        "datapoint_size": 140532912,
        "datapoint_percentage": 16.3
      },
      "suffixes": [
        1,
        2
      ],
      "segment": "s2_49"
    }
  ]
}