O'Reilly NetworkO'Reilly.com
BooksAll ArticlesSafari BookshelfO'Reilly GearFree NewslettersSearch
RSS DevCenter Tech Jobs | Forum

O'Reilly Network RSS DevCenter


Web Design and Development
Getting Started

Go to Meerkat

Meerkat: An Open Service API

by Rael Dornfest

Editor's note: Meerkat predated the popularity of syndication, feed services, and feed readers. Now that other groups are providing this service, we have removed Meerkat in favor of their better solutions. We maintain these articles for the sense of historical interest.

You want to know where the future is? No, not plastics. The future, my friends, is Web APIs.

I'm not talking here about Web applications (or "Weblications") themselves, but their public interfaces, those parts of themselves they choose to share.

An API (application program interface) is the public interface provided by an application for communication with external applications and programmers. This interface can be as simple as a set of supported parameters/arguments or as advanced as specific services (also known as methods or functions) that may be called remotely.

Meerkat: An Open Service API

• Introduction to Open Services

• The Meerkat API

• Meerkat Flavours

• Recipes: Passing Parameters to Meerkat

• Examples and Resources


Let's bring this definition home a little -- those of you who get the drift can skip on down to Open Service. Think of yourself as an application -- some of you might find this harder than others :) Your inner workings are hidden from the outside world; everything that goes on in your brain is private, known only to you. You do, however, provide interfaces to the outside world: your five (or six) senses. So what, then, would be your API? Perhaps you're a short-order chef. The cafe's menu provides a list of the dishes you can prepare -- your available "functions" or "methods." This menu serves as your basic API. Diners (external applications, if you will) request that you run certain methods to produce their breakfast. In addition, they may request that you hold the cheese or scramble those eggs -- these parameters or arguments provide further detail to the methods called.

The APIs du jour are focused on the following three acronyms: XML, HTTP, and RPC. The exchanged data is marked up in XML ("eXtensible Markup Language"). The mechanism used to transfer this data over the Internet is HTTP ("HyperText Transfer Protocol") -- yes, the same protocol used to transfer Web documents from servers to your Web browser. RPCs ("Remote Procedure Calls") are full-blown methods or functions that may be remotely requested of an application.

XML-RPC is a class of RPC utilizing XML to communicate between servers and applications. A new XML-RPC protocol you might have heard mentioned quite a bit in the technology news recently is SOAP, a joint proposal by Developmentor, Microsoft, and Userland.

Open Service

There's been considerable attention of late given to the wonders and power of Open Source. Not much is said, however, about the array of Open Services out there that are every bit as valuable as source code. Brian Behlendorf, President of the Apache Software Foundation and Founder and CTO of Collab.Net, a company that provides tools and services for Open Source development, writes: "I think it's fine to have a world where open and closed source software speak - by far the most important thing is that the protocols and APIs be stable and open and free from encumberance, that the software source code is open is secondary." (Editor's note: Collab.Net is affiliated with O'Reilly & Associates.) Open APIs are the lifeblood of the Web developer. Whether such interfaces are simply a side effect of the way in which the application is written or intentionally left open for public use, you'd be amazed at how they're used.

Open services are the building blocks behind home-brewed scripts, modules, and full-blown Weblications. Here are a few examples:

  • DeepLeap is an online assistant which, among its many talents, provides a quick search through Google and local movie information via Yahoo! Movies.
  • The Finance-QuoteHist Perl module fetches historical quotes from such sources as The Motley Fool and FinancialWeb.
  • YahooChart grabs stock charts from Yahoo! Finance.
  • The DMOZ Open Directory Project (ODP) is a comprehensive searchable Web directory staffed entirely by a distributed group of volunteers. DMOZ's uniqueness and power is that it's open on both ends, providing an Open Service and the ability to loop back and contribute to the very service you're using. Netscape, Google, and AltaVista are a few of the more the 100 sites using ODP data. In addition to the RDF (Resource Description Framework) dump of DMOZ's database available for download, interfaces such as the phpODP PHP module are making the process even easier.

Fling open the gates!

"OK, I'm inspired! How do I open my Weblication up?" Glad you asked.

  1. Create a straightforward interface to your service.
  2. Document! This is the step most folks, for one reason or another, forget to do. Don't rely upon discovery; make it obvious.
  3. Accept and incorporate constructive criticism. Your audience is there to help you -- listen to and learn from them.

Don't be embarassed if your code's a little messy -- nobody's going to see it. If you think your application isn't of any particular use, think again! If you found it necessary to create it, chances are somebody else will find it invaluable. No API is too simple or too small; even a door slightly ajar is better than one triple-bolted with a "Beware of Pointy-Toothed Rabbit!" sign emblazoned across it.

Pages: 1, 2, 3, 4, 5

Next Pagearrow

Sponsored by:

Get Red Hat training and certification.

Contact UsMedia KitPrivacy PolicyPress NewsJobs @ O'Reilly
Copyright © 2000-2006 O’Reilly Media, Inc. All Rights Reserved.
All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.
For problems or assistance with this site, email