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.)