Twitter Ads Api

I. Introduction About Twitter API

1. Twitter API have three level access to Ads API.

  • Standard Access : Standard access allows successful ‘Basic’ partners accessing the Twitter Ads API to scale by increasing OAuth tokens and rate limits. Form request access ads standard
  • Basic Access : Basic access level provides increased Twitter Ads API access to ‘Developer’ partners in order to prove the efficacy of their solution. Form request access ads basic
  • Developer Access : Developer allows companies to begin creating a tool without any active advertisers. This level gives developers the ability to build out workflows using the Twitter Ads API before receiving full access. This access level will enable up to 5 oAuth Tokens and will restrict various API functionality and may be subject to additional limitations. Form request access ads developer

2. API v1.1’s Authentication Model.

  • There are two forms of authentication in the new model, both still leveraging OAuth 1.0A.
    • Application +user authentication :
      • This is the most common form of resource authentication in Twitter’s OAuth 1.0A implementation to date.
      • Your signed request both identifies your application’s identity in addition to the identity accompanying granted permissions of the end +user
      • You’re making API calls on behalf of, represented by the user’s access token.
    • Application +only authentication (
      • Not all API methods support application +only authentication.

3. Access Token.

  • Twitter have limit about number access token.
  • Twitter do not currently expire access tokens. Your access token will be invalid if a user explicitly rejects your application from their settings or if a Twitter admin suspends your application.
  • You should plan that a user’s access token may become invalid at any time and you will need to re-authorize for that user in the case that it does.

4. Sandbox Enviroment.

5. Ads Enumerations.

6. Rate Limit of Twitter API.

  • We can check rate-limit on response header each request of Per-endpoint.
  • Example:


II. Information required in Adrepo.

1. Format of report downloaded : JSON

2. Twitter Advertising Structure

  • Advertiser -> Campaign -> Adgroup -> Tweet


3. Information nessecsary to download report.

  • Go to link[app-id]/keys, we can create new key or regenerate new key.

III. Access Advertiser Twitter Ads

1. Create your application.

2. Request access your application become Ads API Application.

  • We have three level access to Twitter Ads API (Part I).

3. Start Advertising

IV. Report

1. Campaign Management

2. Analytics (New Update)

3. Creative.

4. Measurement.

5. Tailored Audiences.

IV. Sample Code

  • Twitter recommend partner using the 3-legged approach but we will using PIN-based authorization (
  • Required your application must be access twitter Ads Api and your customer must be start advertiser.

1. CreateIfNotExistAccessToken

  • Required Library Twiiter4j version 4.0.3 or higher

2. Get Report For Per-Endpoint

  • Required Library signpost-commonshttp4 version or higher


TwitterAPI | Sample Code