Want to use twitter API to fetch user profile info


#1

I am developing a form where twitter login button is provided. When the user logged in I want to show basic user information on the screen like user first name,last name, email address etc. To accomplish this I want to use twitter API , but failed to achieve the target. Can you please help me out to complete my task.


#2

I think you’ll need to provide a little more information if you want a reply. I assume it’s a website? Are you using PHP, Python, ASP etc? What have you tried? What does it do? Error messages? Can you post your code?


#3

I am using javascript , I have created twitter APP for the same. and want to fetch basic user profile information in javascript only. I am using below code:

$.ajax({
type: "GET",
url: "http://api.twitter.com/1.1/users/show.json",
datatype: "json"
success: function(response) {
            jsonData = response;
        }
});

Also please let me know if I can use OAuth for the same in javascript.


#4

In order to do that GET call you’d certainly need an OAuth token since the API requires it. Client-side / JS only OAuth is tricky so we’d usually recommend performing that on the server side.