Reputation: 71
I want to use twitter api without authentication. Is it possible? For example, I am going to get the user profile for certain user. Can I get his user profile without authentication?
Upvotes: 1
Views: 1163
Reputation: 81
I just worked it out recently, hopefully this would be helpful for you.
First of all, it's impossible to "use twitter api without authentication" which makes sense in any aspects.
Secondly we need to know with what language you want to program with twitter API. Since you didn't mention anywhere in your question, I'd like to provide the solution with Java.
Below are the steps you need to follow to start using twitter APIs:
twittered
(https://github.com/xdevplatform/twitter-api-java-sdk) into your java appfindUserById
API(https://github.com/xdevplatform/twitter-api-java-sdk/blob/main/docs/UsersApi.md#finduserbyid) from the instance to get the information of the user you want to knowTo be fair, the authentication of Twitter is a headache to handle as there are different permission for different APIs and plus there are OAuth 1.0 and 2.0 put in place at the same time...
However, if we take a step back and reuse the "wheels" built by others, we can actually easily start our own implementation right away!
Upvotes: 0
Reputation:
All Twitter API calls require the use of OAuth and a registered application with consumer key and token. They also require HTTPS.
A small number of API endpoints can be called without the use of a user context ("application-only" authentication). You can call the users/show.json endpoint with application-only authentication using a bearer token and no user context, but that will only work for public Twitter profiles, not protected ones.
Upvotes: 1
Reputation: 349
User authentication is mandatory. You also need to create a customer account and use the authentication for that.
You will also need to deal with api rate limiting by adding a small sleep time of around 60 seconds.
You can use this link to see some working code.
Upvotes: 2