You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

开发Twitter推文调度应用:如何获取所需account_id?

Hey there! Let me break down what the account_id is and how you can get it for your scheduled tweets app.

What is account_id in the Twitter Ads API?

The account_id is a unique numerical identifier tied to your Twitter Ads account (not your regular personal Twitter user account). Even if you're only scheduling organic (non-ad) tweets, this endpoint lives under the Ads API ecosystem, so you need to link your request to a valid Ads account ID.

How to retrieve your account_id

You have two reliable methods to get this ID:

1. Through the Twitter Ads Dashboard (UI)

  • Log into your Twitter Ads dashboard
  • Check the browser's address bar once you're logged in. It will look similar to this: https://ads.twitter.com/accounts/123456789/campaigns
  • The numerical string right after /accounts/ is your account_id (in this example, it's 123456789)

2. Programmatically via the Ads API

If you want to fetch it through code, make a GET request to the Accounts endpoint:

GET https://ads-api.twitter.com/2/accounts

You'll need to authenticate using valid OAuth credentials or a bearer token that's associated with your Twitter Ads account. The response will return a list of accounts linked to your authenticated user, and each entry will include an id field—that's your target account_id.

Quick note: If you don't have a Twitter Ads account yet, you can create one for free (even if you don't intend to run paid ads) to access this endpoint.

内容的提问来源于stack exchange,提问作者Aditya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:10:15