How can we get App informations via the Twitter Ads API?

api

#1

I would be able to easily reference and create App Cards and App Image Cards. Do you have any way to get this information? After I have created an app, is there a way to get the Name, the Platform, and the App Store or Google Play Store id from a Twitter Ads API endpoint?


#2

We currently support two app card types: image and video.

Some of the information you’re asking about can be found in the card response. For example, using the GET accounts/:account_id/cards/video_app_download/:card_id endpoint, I can see the Google Play application package name ("googleplay_app_id": "com.twitter.android")

$ twurl -H ads-api.twitter.com "/2/accounts/18ce54d4x5t/cards/video_app_download/4hug6" | jq
{
  "request": {
    "params": {
      "card_type": "video_app_download",
      "card_id": "4hug6",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "name": "video app download",
    "googleplay_app_id": "com.twitter.android",
    "video_url": "https://video.twimg.com/amplify_video/vmap/867520357225418752.vmap",
    "video_owner_id": "756201191646691328",
    "video_content_id": "13_867520357225418752",
    "preview_url": "https://cards.twitter.com/cards/18ce54d4x5t/4hug6",
    "id": "4hug6",
    "account_id": "18ce54d4x5t",
    "app_country_code": "US",
    "video_hls_url": "https://video.twimg.com/amplify_video/867520357225418752/pl/TPHeH5ZlHFCa2TeJ.m3u8",
    "created_at": "2017-07-05T23:01:42Z",
    "card_uri": null,
    "updated_at": "2017-07-05T23:01:42Z",
    "video_poster_url": "https://pbs.twimg.com/amplify_video_thumb/867520357225418752/img/E3pnXM0sCKnRsFih.jpg",
    "app_cta": "CONNECT",
    "deleted": false,
    "card_type": "VIDEO_APP_DOWNLOAD"
  }
}

or the App Store app ID ("iphone_app_id": "333903271")

$ twurl -H ads-api.twitter.com "/2/accounts/18ce54d4x5t/cards/video_app_download/4w2yv" | jq
{
  "request": {
    "params": {
      "card_type": "video_app_download",
      "card_id": "4w2yv",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "name": "app store",
    "video_url": "https://video.twimg.com/amplify_video/vmap/909110614026444802.vmap",
    "iphone_app_id": "333903271",
    "video_owner_id": "756201191646691328",
    "video_content_id": "13_909110614026444802",
    "preview_url": "https://cards.twitter.com/cards/18ce54d4x5t/4w2yv",
    "id": "4w2yv",
    "account_id": "18ce54d4x5t",
    "app_country_code": "US",
    "video_hls_url": "https://video.twimg.com/amplify_video/909110614026444802/pl/XDeAA6xsCQLq2j2Y.m3u8",
    "created_at": "2017-10-11T03:41:22Z",
    "card_uri": null,
    "updated_at": "2017-10-11T03:41:22Z",
    "video_poster_url": "https://pbs.twimg.com/amplify_video_thumb/909110614026444802/img/QZUNoaiCia0UFNrw.jpg",
    "app_cta": "INSTALL_OPEN",
    "deleted": false,
    "card_type": "VIDEO_APP_DOWNLOAD"
  }
}

Other than the information in the cards response, we don’t provide any additional app information.

Please let us know if this helps answer your question.

Thanks!


#3

hi,very thanks. We know your idea can get infomation. But if the current account has no card or no ids, it is a empty account,only has an app.
Such as:
twurl -H ads-api.twitter.com ‘/2/accounts/18ce54fkgsi/cards/image_app_download’ | python -m json.tool
{
“data”: [],
“next_cursor”: null,
“request”: {
“params”: {
“account_id”: “18ce54fkgsi”,
“card_type”: “image_app_download”
}
}
}

return data is null


#4

@juanshishido ‘‘Other than the information in the cards response, we don’t provide any additional app information.’’ hi,this mean account has no cards,we cannot get iphone_app_id or googleplay_app_id?


#5

Thanks for the follow up, @wangdao.

We return the app information in the cards response so that users know which app is being promoted with the specific card. In terms of finding the app IDs, if you’re trying to promote the app, you should have that information. We do not provide an endpoint for this purpose.

Please let me know whether I correctly understood your question.

Thanks!


#6

@juanshishido I know,thanks


#7

Just chiming in with one additional trick - if the account is using “mobile app conversion tracking” then it will likely have app_event_tags set up and you can check https://developer.twitter.com/en/docs/ads/measurement/api-reference/app-event-tags for what settings are there, as a reference. It is not guaranteed to be there, so it’s best to additionally track this information as part of your system if your system is managing or tracking mobile app promotion campaigns.


#8

@JBabichJapan yeah,thanks. This is the way, our account is using “mobile app conversion tracking”.