Trying to get follower count through /users/lookup when a user searches

api

#1

Hi I am trying to get the follower count of a twitter account when a user searches for them. I think im missing something in the syntax but not sure. Im using node.js twitter package. This is what I have:

var params = {screen_name: ‘twitter’};
client.get(‘users/lookup’, function(error, tweets, response){
if(error){
console.log(error);
}else{
console.log(“hello”);
console.log(tweets[0][‘followers)count’]);
console.log(response); // Raw response object.
}

The error i get is that no user matches specifies terms
I think im along the right lines but any help would be super thanks.


#2

Incase anyone else has this issue, it should be client.get(‘users/lookup’, params, function(error, tweets, response)

I was missing params.