Vanishing entity_ids in /stats/accounts/:account_id endpoint




I’m having problems with obtaining results from /stats/accounts/:account_id endpoint ( )

Even though I’m submitting a list of entity_ids that I want to fetch results for, in the response nothing is returned and… request’s entity_ids argument is set to null.


GET ''

18ce53... - is the account that I have oauth access to.
18ce54... - is the account for which I want to pull stats. 18ce53... has full admin access to analytics of 18ce54...


    "data_type": "stats",
    "time_series_length": 1,
    "data": [{
        "id": "18ce53...",
        "id_data": [{
            "segment": null,
            "metrics": {
                "impressions": null,
                "follows": null,
                "retweets": null,
                "likes": null,
                "engagements": null,
                "replies": null
    "request": {
        "params": {
            "start_time": "2016-08-03T07:00:00Z",
            "segmentation_type": null,
            "entity_ids": null,
            "end_time": "2016-08-08T07:00:00Z",
            "country": null,
            "placement": "ALL_ON_TWITTER",
            "granularity": "TOTAL",
            "entity": "ACCOUNT",
            "platform": null,
            "metric_groups": ["ENGAGEMENT"]

What’s the likely cause for "entity_ids": null, in the response ?
Is there anything wrong I’m doing with calling the endpoint (no errors obtained from Advertiser API) ?


Hi, @grechut. Thanks for the question!

Your request looks good to me; this is the correct way to call the endpoint for entity=ACCOUNT. Entity IDs do not exist at the account level, which is why we return null.


Thanks Juan for the response!

And is the stats endpoint working properly for entity ACCOUNT ?

Unfortunately, all the time still I’m getting only null values in response for stats I’m requesting.

Even in your SDK , I do not see stats method implemented for the account. Other entities (like LineItem) have all_stats method.


@grechut Not all metrics are available on all entity levels. On the account level, only engagement metrics are available. See the top table in our Metrics and Segmentation page for details on exactly which metric groups are available on which level.

The recommended best practice is to fetch stats on the lowest entity level they need, since you are able to get more finely grained and relevant metrics, and you are always able to roll up to higher entity levels if you need higher level data without the need to extra requests.


Thanks for the good tip. Getting stats on lowest entity level works :wink: