Search code examples
twittertweets

Twitter request to get the latest tweets for a hashtag using Twitter API V1.1 using OAuth settings


Can any one explain how to send a Twitter request to get the latest tweets for a hashtag using Twitter API V1.1 using OAuth settings ? I have searched for documentation in Twitter site, but I am incomplete.

Can any one give the sample request & response through RestClient or Advanced Rest Client ?

Thanks in advance.


Solution

  • You have multiple questions here, so I'll answer them one by one.

    The search/tweets method

    You can search tweets using this method in the 1.1 API. According to those docs, you can pass a q parameter which is "a UTF-8 encoded query of 1000 characters maximum".

    The query for your specific requirements

    Scroll down on this page and you'll see that you can search for a specific hashtag using #hashtag. Yes, that's it.

    How can I make V1.1 requests using OAuth?

    Follow the detailed step-by-step post here, using this library to make authenticated requests.