Getting In-Stream Videos from Ads API



I’m trying to get In-Stream Video impressions from ads API, the In-Stream video ads is in Promoted Tweets endpoint?

I try to get this information usign:

Is the right way to get In-Stream Video ads information?


Hi @NestorSigiSilva,

The impression data can be pulled the same way it would be for a promoted tweet. Through the synchronous or asynchronous analytics endpoints where “metric_groups=ENGAGEMENT”.


Hi @goforbrent, Thanks for help me,

I’m trying to get it using promoted tweets endpoint, and using metric_groups = [BILLING, VIDEO, MOBILE_CONVERSION, ENGAGEMENT, MEDIA, WEB_CONVERSION] , but we only pull Tweets data instead Tweets and In-Stream Videos data.


Hi @NestorSigiSilva,

I just reviewed the account 18ce54ff541 (pulled from the endpoint URL above) and in the past 12 months I don’t see any in-stream video ad views objective campaigns. Therefore it makes sense that no metrics are returned. Thanks!


Hi @goforbrent,

The account that contains the In-Stream videos is 19bgp7, and the campaign is 16263023, I’m trying to get items between 10/25/2017 and 10/27/2017.
Can you helpme to try with this parameters?
In UI I can see 4 items.
UI Link

Note: the account 18ce54ff541 was an example.


Hi @NestorSigiSilva,

Thank you for the clarification. You are correct that the 4 items (media creatives) below line item are not currently available via the API. We have already logged this feature request as part of an ongoing project. For now you will only be able to pull at the line item level with those 4 media creatives aggregated. We will be sure to make an announcement when it becomes available. Thank you.


Hi @goforbrent , thankyou a lot for your help!


Hi @goforbrent,
I’m trying to get the promoted tweet impressions for account Id 19bgp7 and campaign i16008185, but I cant get complete info via API, in UI I can see 13,353 impressions, but via API I only can see 4,699 impressions, this is for November 8th 2017 , can you help me to know if this issue is the same issue reported?

Thank you for your help!


@NestorSigiSilva -

Can you please copy/paste the twurl request/response so I can see how you’re requesting the data?

Example ->
Note you will have to also request placement PUBLISHER_NETWORK in order to get all impressions.

twurl -H "/2/stats/accounts/19bgp7?entity=CAMPAIGN&entity_ids=9j3zt&start_time=2017-11-08&end_time=2017-11-09&granularity=TOTAL&placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT" | jq


Hi @goforbrent,
To request the data we use a java library called Twitter4J-Ads and the URL to get the promoted tweets is and send as parameter with_deleted = true .

I make a request to URL : and I get the response below:



Hi @NestorSigiSilva,

Both endpoints exist in Twitter4J-Ads java library. The endpoint GET promoted_tweets exists to retrieve references to Tweets associated with line items under the current account. But it sounds like you are trying to grab tweet impressions which would fall under our analytics endpoints. These analytics examples are also shown in the Twitter4J-Ads java library. Thanks!


Hi @goforbrent thank you for your help, I have another two questions to you.

How can we know when we needs to get the data from analytics endpoints, and how can we see the line item info in UI, where the line item is shown in UI?.

Thank you a lot for your help!


You should be pulling all analytical metrics surrounding promoted tweets through the analytics endpoints. The other endpoints (such as Get promoted_tweets) should be used to pull the promoted tweet IDs and associated line_item IDs in which you would use to plug into ‘entity_ids’ in our Analytics endpoints.

Ex. Retrieve all Promoted tweet IDs + line item IDs - note only copy/pasted portion of response

$ twurl -H "/2/accounts/19bgp7/promoted_tweets" | jq
  "request": {
    "params": {
      "account_id": "19bgp7"
  "next_cursor": "8xzkrdqm8",
  "data": [
      "line_item_id": "1h5r",
      "id": "70we",
      "entity_status": "ACTIVE",
      "created_at": "2012-06-19T22:10:49Z",
      "updated_at": "2016-12-06T11:16:53Z",
      "approval_status": "ACCEPTED",
      "tweet_id": "214767939847585793",
      "deleted": false
      "line_item_id": "1h5b",
      "id": "70ws",
      "entity_status": "ACTIVE",
      "created_at": "2012-06-19T22:13:13Z",
      "updated_at": "2016-12-06T11:16:53Z",
      "approval_status": "ACCEPTED",
      "tweet_id": "214767939847585793",
      "deleted": false

You will be able to retrieve the same engagement metrics at a more granular level by setting ‘entity=LINE_ITEM’ and inputting the correct ‘entity_ids’.Please review our metrics and segmentation related to the analytics endpoints for all data available.


@goforbrent Ok,

In order to get the promoted tweets info:
1.- Get Promoted Tweets IDs from GET promoted_tweets
2.- Get Line Itemss IDs from GET line_items
3.- Use Analytics endpoint sending the getted ids in the first two steps?

You say the analytics endpoints should be used to complement the promoted tweets getted info?
Actually we only do the first two steps. What is you recomendation in steps to complement our reports?

Extra, can you help me to find the Line Item associated info to Promoted Tweet in UI?