O'Reilly logo

Flickr Hacks by Jim Bumgardner, Paul Bausch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #37. Talk to the API with Your Web Browser

Making requests with your web browser is a great way to familiarize yourself with the Flickr API.

Before using a programming language (such as Perl [Hack #38] or PHP [Hack #39] ) to talk to the Flickr API, it's a good idea to test it using your web browser. If you are using a new API method, this is an excellent way to get used to it and to view the XML that is returned by the call. If you are unfamiliar with the mechanics of REST and XML, it is also a good way to explore how these protocols work.

There are two simple ways to talk to the API using your web browser: you can type REST URLs directly into your browser's address bar (the hard way), or you can use Flickr's API Explorer (the easy way).

Using REST URLs

The first method, using your browser's address bar, is mainly of historical interest, because the second method is so much easier. But let's see how it works, for completeness's sake.

You can use any Flickr API method, such as flickr.test.echo, by entering its name and any required parameters into your browser's address bar in the Flickr REST format.

Here's an example. Try pasting this into your web browser's address bar:

http://www.flickr.com/services/rest/?method=flickr.test.echo&api_key=your_api_key&param1=value1&param2=value2

Substitute your own API key for your_api_key, and substitute the name of any Flickr API method for flickr.test.echo. You can also add any parameters that are required by the call, just as the above example ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required