Search API and Auth


#1

Hi folks,

Is possible invoke twitter search api (statuses/user_timeline) and make authenticated calls and extend limit to 350 request?

Anyone got some example? Im using PHP (its a script, not web application)

Theres my code:

<?php
           $url = "https://api.twitter.com/1/statuses/user_timeline.json?since_id=".$last_id ."&page=" . $page . "&count=200&screen_name=". $user ;
           $twitter = file_get_contents($uri);
           $fede = json_decode($twitter,true);
           $max = count($fede);
           for ($i=0;$i<$max;$i++)
           {
                   //blabla
           }
?>

Regards,
Federico.


#2

Hi @justfede,

The statuses/user_timeline isn’t a “Search API” but what we refer to as a timeline API.

To use authentication with this API, you’ll need to use a little bit of OAuth. Since you’re just writing a script, you’ll want to use the “easy” method of using your own access token that can be provided on an app you’ve registered at https://dev.twitter.com/apps

See [node:124] for more information, and code samples in PHP that you can easily adapt to your use case.


#3

Thanks you, its very useful!

another question, the limit is associated with my ip address or my application ? (with auth calls)

Thank you.


#4

With your IP address. You have 150 requests per hour for unauthenticated traffic per IP address, and 350 requests per hour per user for authenticated traffic per IP address.