You can use their API Explorer to find out what is available from an API perspective. This is pretty neat and serves as good documentation, just look at the REST-style URLs .
Here is the basic code to get the last 5 checks. You will need an API key.
$username = 'sco';
$api_key = 'f6cd524ac9c4413abfb41d7123757d9';
$checkin_num = 5;
$url = "http://api.gowalla.com/users/{$username}/stamps?limit={$checkin_num}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array (
"Accept: application/json",
"X-Gowalla-API-Key: {$api_key}",
));
$body = curl_exec($ch);
curl_close($ch);
$json = json_decode($body, true);
foreach($json['stamps'] as $stamp) {
print $stamp['spot']['name'] . '<br/>';
print "<pre>";
print_r($stamp);
print "</pre>";
}
Here is what the check object looks like 'stamp':
Array
(
[spot] => Array
(
[image_url] => http:
[url] => /spots/19890
[lat] => 38.9989524833
[address] => Array
(
[locality] => Kansas City
[region] => MO
)
[lng] => -94.5939345333
[name] => The GAF Pub & Grille
)
[first_checkin_at] => 2010-06-12T19:16:57+00:00
[checkins_count] => 1
[last_checkin_at] => 2010-06-12T19:16:57+00:00
)