Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to crawl twitter tweet information without OAuth authentication?

I'm required to crawl twitter and analyze the tweets for information. I figured the best way would be to use the search API, however it seems that now the api requires the OAuth authentication. Would registering as a developer be the only way? Are there alternatives?

like image 565
goh Avatar asked Dec 22 '10 11:12

goh


People also ask

Can I use Twitter API without authentication?

You can do application-only authentication using your apps consumer API keys, or by using a App only Access Token (Bearer Token). This means that the only requests you can make to a Twitter API must not require an authenticated user.

How do I scrape tweets from Twitter without API?

What is Twint ? Twint is an advanced tool for Twitter scrapping. We can use this tool to scrape any user's tweets without having to use Twitter API. Twitter scraping tool written in Python that allows for scraping Tweets from Twitter profiles .

Does Twitter use OAuth?

Twitter allows you to obtain user access tokens through the 3-legged OAuth flow, which allows your application to obtain an access token and access token secret by redirecting a user to Twitter and having them authorize your application.


3 Answers

The (chosen) answer of Adam Green is not working anymore since Twitter closed their REST API v1.0.

If you call the given example to query for pizza:

http://search.twitter.com/search.json?q=pizza

You get the following error message: (in json, though ;)

{"errors": 
   [{"message": "The Twitter REST API v1 is no longer active. 
      Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview",
     "code": 64}
   ]
}

You can check the API 1.1 search spec here

Another change from 1.0 to 1.1 is that all 1.1 API Calls require an authentication including search.

like image 108
klaas Avatar answered Sep 18 '22 08:09

klaas


Lots of misinformation here. You do not have to screen scrape. You do not have to register an app to do this. There are no API keys in Twitter. You do not have to use any authorization to read data from the search API. The rest of the API requires OAuth, but not search.

To use the search API you can just make a request against the following URL: http://search.twitter.com/search.json?q=[keywords]

For example to search for pizza: http://search.twitter.com/search.json?q=pizza

You get JSON data back that you can read in any program. If you use PHP, you can use cURL to make the request and json_decode() to convert the result into an object you can iterate through in a foreach() loop.

like image 45
Adam Green Avatar answered Sep 22 '22 08:09

Adam Green


If you want to analyse large amounts of tweets, you should be using the Streaming API. You will need to register for access to this.

You could also use the Search API for which you do not need to register. But this is rate limited.

like image 31
vsr Avatar answered Sep 22 '22 08:09

vsr