Which api will give me Twitter handle name of corresponding account?



Is there any api which will give me Twitter handle name using account_id?


This is basically the “full promotable user” (but there may be other promotable users listed too), this roughly corresponds to a dialog you will see in the Ads UI of which Twitter account to use for promotion.

Here is the FAQ for promotable users:


@JBabichJapan thanks but didn’t solve my problem

Actually I want tweet url of particular tweet

I can get all the tweet of particular account using below api

I know I can get all this tweet urls using api https://api.twitter.com/1.1/statuses/show.json?id
but my concern is this is having less rate limit values as compared to account level api

I there any account level api(for more rate limit) which will give me tweet url like below
where is tweet id is: 829327792995233792 handler is:TheNextWeb



@idreaminfinite: We don’t have any endpoints—nor do we currently have plans to make any available—for converting account IDs to handles. If you’re retrieving the Promoted Tweets for a particular ads account that you have access to, you should know that account’s handle.

In case it helps, here is additional information on how to create the URL. Of course, you’ll need to know the screen name or handle.


thanks @juanshishido I have checked link you have given

this api gives me tweet_id and screen_id
and tweet urls formed with approach are correct and I can see those tweet on that particular handler

strange thing I am observing here is tweet ids returned from https://ads-api.twitter.com/1/accounts/<account_id>/promoted_tweets are not matching with tweet ids returned from https://ads-api.twitter.com/1/accounts/<account_id>/scoped_timeline

but If try to form tweet_url from promoted tweets I can see those tweets but on handler screen I cant see those tweets…why is it so?


@idreaminfinite: That’s great that you have what you need!

That’s right. Didn’t realize that that screen_name was under the user object. Good find.

Could you provide an example here? This is most likely due to the following difference between id and id_str attributes:

When consuming the API using JSON, it is important to always use the field id_str instead of id. This is due to the way Javascript and other languages that consume JSON evaluate large integers. If you come across a scenario where it doesn’t appear that id and id_str match, it’s due to your environment having already parsed the id integer, munging the number in the process. Read below for more information on how Twitter generates its ids.



@juanshishido thanks for quick reply
I don’t have example with me right now but could you please check that tweet ids returned from
api [GET accounts/:account_id/scoped_timeline] are matching with [GET accounts/:account_id/promoted_tweets] with other test account if you have any?


@idreaminfinite: The tweet_id attribute from GET accounts/:account_id/promoted_tweets will always match the id_str attribute from GET accounts/:account_id/scoped_timeline.