steffen
steffen

Reputation: 8978

Pull Twitter texts without account

Without having a twitter-account I can search tweets, e.g. with the URL https://twitter.com/search?q=stackoverflow or https://twitter.com/StackOverflow or https://twitter.com/hashtag/stackoverflow.

To access twitter using Python, there are several API wrappers, maybe the most famous ones being tweepy and twitter.

It does not seem to be possible to access tweets without authentication.

How can I access tweets from Python without logging in to twitter?

ps. I know that I can download the page and parse the html, but this looks like a last resort rather than an elegant solution.

Upvotes: 1

Views: 1353

Answers (2)

Maciej Skorski
Maciej Skorski

Reputation: 3374

Why not to create an account? Keep in mind different circumstances.

  1. accounts are occassionally very hard to create. For instance, it has been reported that Twitter doesn't support phone numbers from certain locations. What would you do if you cannot authenticate with your personal mobile?
  2. account features are heavily limited. For instance, under the standard dev account you will not retrieve past data for your educational project (e.g. a sentiment analysis of celebrities tweets).
  3. accounts will not be free Twitter has just decided to discontinue supporting free accounts

Upvotes: 0

Muhammad Tahir
Muhammad Tahir

Reputation: 5184

From the docs

Authentication on all endpoints

We require applications to authenticate all of their requests with OAuth 1.0a or Application-only authentication. This visibility allows us to prevent abusive behavior, and it also helps us to further understand how categories of applications are using the API. We apply this understanding to better meet the needs of developers as we continue to evolve the platform.

They need to apply rate limiting (and may be other security precautions) to minimize abuse, so, they do not allow public access to APIs.

Searching tweets using Twitter's website is manual. So there are less chances of abuse. Moreover, even if you try to parse it from web, most probably they will ban your IP address as soon as you start sending more requests than they think are not abusive.

Upvotes: 2

Related Questions