Getting Leads,objective using Twitter Ads API



Which metric group returns the twitter leads and objective data. I tried almost all the metric groups for entity campaign. Any suggestion would be appreciated. Thanks


Please check however note that Lead Gen has been deprecated and this should only be needed for historical campaigns: Deprecation Announcement: Lead Generation


Hi JBabichJapan,

Thanks for the reply. The first link gives us the metrics by objective for the campaign but my query is how do we get the campaigns objective using any API endpoint.


@subhashdeshmuk: Note that the objective is set at the line item-level. To retrieve line items for a particular campaign, you can make the following request:

$ twurl -H "/1/accounts/18ce54d4x5t/line_items?campaign_ids=69epk"
  "request": {
    "params": {
      "account_id": "18ce54d4x5t",
      "campaign_ids": [
  "data": [
      "bid_type": "MAX",
      "advertiser_user_id": 756201191646691300,
      "name": "Untitled",
      "placements": [
      "start_time": null,
      "bid_amount_local_micro": 100000,
      "automatically_select_bid": false,
      "advertiser_domain": null,
      "target_cpa_local_micro": null,
      "primary_web_event_tag": null,
      "charge_by": "ENGAGEMENT",
      "product_type": "PROMOTED_TWEETS",
      "end_time": null,
      "bid_unit": "ENGAGEMENT",
      "total_budget_amount_local_micro": null,
      "objective": "TWEET_ENGAGEMENTS",
      "id": "6keuo",
      "entity_status": "PAUSED",
      "paused": true,
      "account_id": "18ce54d4x5t",
      "optimization": "DEFAULT",
      "categories": [],
      "currency": "USD",
      "created_at": "2016-10-24T21:44:57Z",
      "tracking_tags": [],
      "updated_at": "2016-11-11T17:50:19Z",
      "include_sentiment": "POSITIVE_ONLY",
      "campaign_id": "69epk",
      "creative_source": "MANUAL",
      "deleted": false
  "data_type": "line_item",
  "total_count": 1,
  "next_cursor": null

You can find the objective in the objective response attribute, which, in this example, is TWEET_ENGAGEMENTS. Hope this helps.


Hi juanshishido,
Thanks for the reply.It really helps.
I have noticed one more thing that when I export data from Twitter Ads manager the Campaign Id field gives me numeric value and in API response I am getting alphanumeric value. Why I am having this discrepancy?
campaign id in ads manager: 2724301
but in API response campaign id : “69epk”


@subhashdeshmuk: Entity IDs in the API are the base-36 representations of the base-10 values shown on (Source). Hope that helps!


Hi juanshishido,
Thank you.


Hi juanshishido,

I am getting field ''Edit url" in export from Twitter Ads platform. Well, I checked this in metrics menu but I did not found this field. What does “Edit url” signifies? How can I get this through the API?

Attaching the screenshot of the field I am interested in.


@subhashdeshmuk: That’s likely the URL you’d navigate to in order to edit that specific campaign on This isn’t something we provide through the Ads API as it’s unrelated.



Thanks for the update.