Available options for segmentation_type



Is there a list of all available values for segmentation_type parameter?
The documentation for the /stats endpoints implies that the valid values would be listed in the section “Metrics and Segmentation in Analytics”, but they are not actually listed there.



Hey @TaliDolev,

Thanks for bringing this to our attention. Looks like we mistakenly removed a chunk of the content related to segmentation a few weeks ago. We’ve restored that content now, have a look and let us know if you have any questions.



I see it. Thanks @jaakkosf!


@jaakkosf, before the segments were added to the page “Metrics and Segmentation in Analytics”, the list of metrics included metrics from the Organic Metrics Family: organic_tweet_follows, organic_tweet_favorites, etc.
Now these metrics are missing from the list. Is it possible to get these organic metrics from the Twitter Ads API? If so, are they available for all tweets or just promoted tweets?



@TaliDolev The organic metrics were erroneously included on that page, sorry for the confusion. Please see also my response here: Organic Impressions on Tweets

Segmentation by Handle

The UI shows the organic metrics, too bad they are not available through the API.

Regarding the segmentations - can you share an example using the segmentation types which require platform or country as a parameter? I tried a few different combinations, but it seems I’m not passing the extra parameter correctly. I keep on getting this error message back:

“errors”:[{“code”:“MISSING_PARAMETER”,“message”:“The country parameter is required to use REGIONS segmentation”,“parameter”:“country”}]


Hi @TaliDolev,

Here’s an example:


The platform=0 targeting value can be found using GET targeting_criteria/platforms.

Are you able to replicate that on your account?


yes, got it. thanks!


Hi again!
We’re getting the message below when requesting Account-level metrics with segmentation type “KEYWORD”, although it appears as a valid option in the documentaion. Are KEYWORDS not supported as a segmentation type?

“code”:“INVALID_PARAMETER”,“message”:“Expected valid segmentation type POSTAL_CODES, REGIONS, INTERESTS, TAILORED_AUDIENCES, LOCATIONS, CONVERSION_TAGS, PLATFORMS, CITIES, PLATFORM_VERSIONS, GENDER, DEVICES, got “KEYWORDS” for segmentation_type”,“parameter”:“segmentation_type”


@TaliDolev can you please provide the full request and response?


Request & response below.
When I switch “KEYWORDS” for “GENDER”, it works.
Also works when I request campaign-level metrics.

twurl -H ads-api.twitter.com “/0/stats/accounts/9joj52?start_time=2014-11-21T08:00:00Z&end_time=2014-11-26T08:00:00Z&granularity=TOTAL&segmentation_type=KEYWORDS”
{“errors”:[{“code”:“INVALID_PARAMETER”,“message”:“Expected valid segmentation type GENDER, TAILORED_AUDIENCES, CONVERSION_TAGS, LOCATIONS, INTERESTS, REGIONS, PLATFORMS, PLATFORM_VERSIONS, POSTAL_CODES, DEVICES, CITIES, got “KEYWORDS” for segmentation_type”,“parameter”:“segmentation_type”}],“request”:{“params”:{“granularity”:“TOTAL”,“start_time”:“2014-11-21T08:00:00Z”,“end_time”:“2014-11-26T08:00:00Z”,“account_id”:“9joj52”}}}


@TaliDolev - Thanks! Segmentation by KEYWORDS is not available at the account level. Instead, retrieve the data at the line item level with GET stats/accounts/:account_id/line_items/:id

Documentation on segmentation_type availability

Hi @jillblaz, quick question. :smile: I’m requesting GET stats/accounts/:account_id with segmentation_type: INTERESTS and a single metric: promoted_tweet_timeline_impressions, but no data is returned. It is in the list of available segmentations over at Metrics and Segmentation. Seeing your reaction above, am I right to assume this segmentation option isn’t available at account level either? Because, if so the documentation for the accounts endpoint contains an error. There the example for segmentation_type there is INTERESTS… :wink:


Disregard message above. Seems that was a temporary issue. Works again! :slight_smile:


@jillblaz Interest segmentation is (again) not working anymore for the stats/accounts/:account_id endpoint… It works fine for e.g. stats/accounts/:account_id/campaigns, and the other segmentation types work as well. The response contains an empty array. Could you maybe take a look and see if you can reproduce this?


This topic was automatically closed after 2 hours. New replies are no longer allowed.