Authenticate API Calls for trends/place


My main question that I posted is on Stackoverflow, but I haven’t gotten any answers!

I am working on a website that allows the user to search for the top ten twitter trends in a city or country. At first I was only relying on Twitter’s Rest API, but I was having a lot of rate limit issues (at school my rate limit disappears faster than I have a chance to use it). I know that authenticating my API calls will help me to better deal with this issue (Authenticated API calls are charged to the authenticating user’s limit while unauthenticated API calls are deducted from the calling IP address’ allotment).

I implemented @abraham’s PHP library (, unfortunately my API calls aren’t being authenticated. I know I have implemented @abraham’s PHP library, because it prints out my user information at the end like it should. I have my twitter trend search underneath it isn’t being authenticated.

In Abraham’s php example there are the following calls:

/* Some example calls */
//$connection->post(‘statuses/update’, array(‘status’ => date(DATE_RFC822)));
//$connection->post(‘statuses/destroy’, array(‘id’ => 5437877770));
//$connection->post(‘friendships/create’, array(‘id’ => 9436992));
//$connection->post(‘friendships/destroy’, array(‘id’ => 9436992));

I recently added this one (below) to my code, but it still isn’t working:

$connection->get(‘trends/place’, array(‘id’ => $woeid));

I am not sure how to fix this, and any help would really be appreciated!


If you’re using API v1, keep in mind that many methods that support but do not require authentication will give you a “free pass” when bad authentication data is presented and will serve you a response regardless. API v1.1 is less forgiving.

I wouldn’t necessarily think just because you have data returning in the app in some contexts that your OAuth is correctly functioning. Be sure and verify your timestamp is correct and that you’re using the library correctly – it’s unclear which version of the API you’re using from these small code examples.


We’re experiencing the same thing. We’re using @abraham’s PHP libraries. We’ve switched all our calls to the 1.1 API and authentication via this library is working there (statuses/home_timeline, statuses/user_timeline, statuses/show, favorites/list, search/tweets). The library is attempting a GET on this URL:

I tried using the OAuth Tool on the site and (quickly) plugging the values it returns into the above URL, but that failed too.


You’re not presenting an oauth_token in that request belonging to a user account – at this time, you’ll need to provide a user context for a request like that to work.

I was able to request this method without issue when using all the aspects of OAuth necessary to perform the request:


Signature base string:

Auth header:
OAuth oauth_nonce=“l7OtaK83Rlv4tQML84ZFydVO2fM3yTCcuBrq6Xh0UAY”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1351010709”, oauth_consumer_key=“5aA6oofBOFAwN4tfmEYWjg”, oauth_token=“119476949-oYGCs2M5duG5QalbOAK2YUZh8zG3ur7DPYo5qIFN”, oauth_signature=“v55eC9NJoASgRraUFp2kQZfF2A4%3D”, oauth_version=“1.0”


Right you are @episod. Thank you much, my wiring was not complete. Now that I’ve got the oauth_token included this is working for me.


Thank you for this information! I think this is one of the issues that I need to fix.