Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Rest API 1.1 search without OAuth

is it possible to search with the new Twitter Rest API without OAuth.

I simply want to search for tweets with a given hashtag.

For example I call: https://api.twitter.com/1.1/search/tweets.json?%23MyTag

where %23 is the encoded "#"

However I allways get

{"errors":[{"message":"Bad Authentication data","code":215}]}

I guess its because im not authenticated...

Is it possible to run a search without OAuth?

like image 378
sockeqwe Avatar asked Mar 05 '13 09:03

sockeqwe


1 Answers

The Twitter API docs specify that user-context authentication is required when making a call to search Tweets (see https://dev.twitter.com/docs/api/1.1/get/search/tweets) so it looks like you will need to get your hands on Twitter OAuth tokens and sign your request.

If you log in to Twitter and go to the developer dashboard at https://dev.twitter.com/apps, you can register a new application: after registering, viewing the application details will give you an "oAuth Tool" tab, where you'll find all the relevant oAuth values for that app: Consumer Key, Consumer Secret, Access Token, and Access Token Secret.

You can then use these credentials, in conjunction with a Twitter wrapper library, to do a Twitter search. There's no need to do the OAuth approval dance on a per-user basis: you should be able to hard-code the values from the Twitter dashboard.

like image 50
mflaming Avatar answered Oct 07 '22 00:10

mflaming