PHP Code 17 No user matches for specified terms




There seems to be an issue with the users lookup feature and using the profile id to search. It only seems to fail for a limited number of accounts that have larger profile ids.

For example using a clients username works fine

$twitterObj->post(’/users/lookup.json’, array(‘screen_name’ => ‘realtalkbelike’));

This will return the details as expected however if I use the number string to access the profile

$twitterObj->post(’/users/lookup.json’, array(‘user_id’ => 731737580580966400));

It will always return the error code
Caught exception: {“errors”:[{“code”:17,“message”:“No user matches for specified terms.”}]}

Any ideas people ? Or is this a bug within the API itself.

I am using the following library

many thanks


Interesting - are you using the “right” ID, id_str rather than id? I’m wondering if it is a long number issue.


Thanks for the reply sorry a schoolboy error the id string wasn’t wrapped in a “” this fixed the issue. However I do have an issue with some ids not working that are smaller ids examples below

[0] => 4495662432
[1] => 3741406180
[2] => 2485172612
[3] => 3376851112
[4] => 2485932547
[5] => 2476395776
[6] => 2455339666

These throw the same error and I am guessing its because of locked or suspended accounts?



I’ve just tested a couple of those separately via users/show, and yes, they are suspended. I was initially surprised that you were not seeing an account suspended response, but I’ve also not used the lookup vs show endpoint much recently, and in fact this is expected on the lookup path.


ok appreciate you checking for me have a good day !