Abhishek Singh
Abhishek Singh

Reputation: 131

How to fetch the latest post through twitter api

I want to fetch only the post and display it as my requirement? How to do it using twitter api.? Any help is accepted.Please provide code the documentation is not upto mark.

Upvotes: 0

Views: 748

Answers (1)

Terence Eden
Terence Eden

Reputation: 14314

As per the documentation:

To retrieve a user's posts, you need to make a call to

https://api.twitter.com/1.1/statuses/user_timeline.json

If you only want the latest post, you need to add count=1

So, to get the latest post from my account, use

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=edent&count=1

You will need to sign the request with OAuth.

Upvotes: 1

Related Questions