Web APIs: What, Why and How

Building an application with no APIs, says Josh Walker, an analyst at Forrester “is basically like building a house with no doors”. Learn how APIs can help you extend your web site and tap into new audience, grow revenue and increase your brand awareness.

What is a Web API?

API stands for Application Programming Interface and is a set of code and standards for accessing a Web-based application or service. API thus allows a web application to interact with other applications programmatically similar to the way human accesses a web application via GUI within web browsers. By exposing their functions or content via API, web applications allows developers to easily enrich their sites with new features.

The diagram below shows how APIs act as important building blocks for next generation web applications:

What is a mashup?

A mashup is a web application that combines and uses functionality and content from multiple sources to create a new service. APIs are usually used to fetch and aggregate the results to product hybrid web applications. A great example of a mashup is geotwitter.org which uses the GoogleMaps API and Twitter API to provide real-time geographic data about public tweets.

What is a web widget?

A web widget is a piece of browser executable code with some predefined logic and data. While API requires that you write a set of code to programmatically connect to a web application, web widget simplicities this process by bundling certain functions and content in a cut-and-paste ready code. A lot of web applications will usually provide web widgets in conjunction with API. Take Youtube for example – it provides widgets that you can use to easily embed a video on your site, but also offers an API for complex integrations.

Examples of APIs

Here are some examples of successful APIs:

1. The New York Times API

The NYT APIs are a great examples of read-only content based APIs. APIs provided by NYT includes financial information, movie and books reviews. Their application gallery showcases a plethora of apps and mashups that developers built from their API.

2. FlickR API

FlickR API is one of the most popular API providing methods like fetching list of albums or photos, replacing existing photos or aggregating user comments.

3. Amazon Simple Storage Service API

APIs are not limited to just content or transactions. It can be used to interact with another service and Amazon S3 is a great example of this. Their API allows you write, read and delete files from their cloud based hosting facility.

For more examples, check out our list of Top 10 Most Useful APIs for your Web Site & App.

Why offer APIs?

If your web applications offers functionalities or content that you believe will be useful to 3rd parties web site, you should strongly consider offering API to unlock new distribution challenges and expand beyond your website. Here are some potential benefits of providing APIs:

1. Increase brand awareness

Traditional marketing takes a lot of time and effort. Web APIs offers a quick and easy way for you to promote and market your brand. Facebook Open API is a great example – when Facebook launched their API, a lot of website owners implemented their Facebook Like buttons providing free branding and marketing to Facebook.

2. Capture new revenue

An API that is useful has a huge monetization opportunity. There are several ways you can charge developers to use your API – for example charging per each API call or as per the number of bandwidth consumed. Here’s a great case study of how NPR makes money with their API.

3. Extend your product into new channels

API are meant to be “code-agnostic” meaning that it will work with whatever language your API developers happen to code in. By opening up an API, you can thus harness the skills of other developers to built creative and innovative products for you. These can be mobile application, FaceBook applications, widgets, mashups and desktop applications (AIR and Silverlight).

API Resources

Directory of Web APIs and Mashups categorized by industry types.
How to Design a Good API & Why it Matters
Joshua Bloch, Principal Engineer at Google teaches how to design good APIs, with many examples of what good and bad APIs look like.
API Design Guidelines
Great article and discussion on API Design Guidelines. It’s tailored for Java-based API, but is still pretty general and gives very valuable guidelines.
API survey from Mashery.com
Key insights of Mashery’s API Developer Pulse.
3Apigee provides API developers with free API testing, debugging, analytics and protection.
3scale provides plug and play infrastructure solutions for Web APIs to power your business.
10 Common Mistakes Made by API Providers
The list will provide some basic insights into what mistakes should be avoided when developing an API..