Access a Pinned Tweet

user
profile
pin

#1

I know in previous posts Twitter staff have mentioned that the REST API currently does not have a feature to access a pinned tweet. I am wondering if this is still the case.

When perusing through Stack Overflow, I found this question: https://stackoverflow.com/questions/34792142/twitter-api-detecting-pinned-tweets/34796813

It states that there is a “pinned_tweet_ids” in the returned JSON for https://api.twitter.com/1.1/users/show.json?id=2705321. However, when I execute the API call, I don’t have a “pinned_tweet_ids” in the returned JSON (and that user does currently have a pinned tweet).

Is it accurate to say that as of September 18th, 2017, there is no way to accessed pin tweets (meaning the user’s answer wrong? If it has been added as a feature, why am I unable to see pinned tweets in my JSON return?

I am a blogger, and we typically pin a tweet that we would like other bloggers to share to help our blogs grow. I am building a small application that will help me manage my blog’s social media accounts. I would like to be able to specify a user account and have my program automatically retweet the user’s pinned tweet, however, since I am unable to locate the pinned tweet on a user’s profile, I am not sure I will be able to accomplish.

Thank you


#2

My answer on that Stackoverflow thread is still current and correct.


#3

Thank you for your response. I am glad access to pinned tweets has been added as a feature. However, I am not sure why I am not seeing the “pinned_tweet_ids” as you mentioned.

I am using the TwitterAPIExchange library (available on GitHub here: https://github.com/J7mbo/twitter-api-php) and I am using the URL mentioned in your StackOverflow resolution: https://api.twitter.com/1.1/users/show.json?id=2705321

I am using php and using the json_decode() function to turn it into an associative array. I used print_r() to dump the array to the page. You can see the results here: http://kiyokohall.com/Footsteps-of-a-Blogger/twitterAuth.php

I am not seeing “pinned_tweet_ids” even though I know the user has a tweet pinned.


#4

Sorry for not making myself clear.

Access to pinned Tweets is NOT available, and that is exactly what I said on the StackOverflow threads. Someone else stated that it is available, and that is not correct.

You should not see a pinned_tweet_ids value as that is not part of the API (and there are currently no plans to make this available, per the API roadmap).


#5

Thank you for clarifying this point!


#6