X Ads

App · 16 actions

Read X advertising accounts, campaigns, ad groups, creatives, audiences and performance metrics.

Actions

ActionWhat it does
Get accountGet account in X Ads.
Get account permissionsGet account permissions in X Ads.
Get analyticsRead synchronous advertising metrics for up to 20 entity IDs and at most seven days.
Get campaignGet campaign in X Ads.
Get custom audienceGet custom audience in X Ads.
Get funding instrumentGet funding instrument in X Ads.
Get line itemGet line item in X Ads.
Get media creativeGet media creative in X Ads.
Get promoted postGet promoted post in X Ads.
List accountsList accounts in X Ads.
List campaignsList campaigns in X Ads.
List custom audiencesList custom audiences in X Ads.
List funding instrumentsList funding instruments in X Ads.
List line itemsList line items in X Ads.
List media creativesList media creatives in X Ads.
List promoted tweetsList promoted tweets in X Ads.

Get account

Get account in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

Get account permissions

Get account permissions in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.

Outputs

Response.

dataobject
Account access response.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": {
      "permissions": [],
      "user_id": "Example"
    }
  },
  "has_more": false,
  "next_cursor": null
}

Get analytics

Read synchronous advertising metrics for up to 20 entity IDs and at most seven days. Longer reports require the asynchronous Ads API.

Inputs

Accountaccount_idtextRequired
Account id.
EntityentitytextRequired
Entity.One of: ACCOUNT, CAMPAIGN, LINE_ITEM, PROMOTED_TWEET, MEDIA_CREATIVE, FUNDING_INSTRUMENT.
Entity IDsentity_idslistRequired
Entity ids.
GranularitygranularitytextRequired
Granularity.One of: HOUR, DAY, TOTAL.
PlacementplacementtextRequired
Placement.One of: ALL_ON_TWITTER, PUBLISHER_NETWORK.
Metric groupsmetric_groupslistRequired
Metric groups.One or more of: ENGAGEMENT, BILLING, VIDEO, WEB_CONVERSION, MOBILE_CONVERSION, LIFE_TIME_VALUE, MEDIA.
Start timestart_timedate and timeRequired
Start time.
End timeend_timedate and timeRequired
End time.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

Get campaign

Get campaign in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Recordrecord_idtextRequired
Record id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

Get custom audience

Get custom audience in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Recordrecord_idtextRequired
Record id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

Get funding instrument

Get funding instrument in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Recordrecord_idtextRequired
Record id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

Get line item

Get line item in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Recordrecord_idtextRequired
Record id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

Get media creative

Get media creative in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Recordrecord_idtextRequired
Record id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

Get promoted post

Get promoted post in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Recordrecord_idtextRequired
Record id.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}

List accounts

List accounts in X Ads.

Inputs

Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

List campaigns

List campaigns in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

List custom audiences

List custom audiences in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

List funding instruments

List funding instruments in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

List line items

List line items in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

List media creatives

List media creatives in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

List promoted tweets

List promoted tweets in X Ads.

Inputs

Accountaccount_idtextRequired
Account id.
Cursorcursortext
Cursor.
Countcountnumber
Count.At least 1.

Outputs

Response.

dataobject
The official API response, including records and response metadata.
has_moretrue/false
Whether another page is available.
next_cursortext
Continuation token or offset to pass to the next request.
Example output
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}

On this page