APIs are a foreign concept to the average web user, yet every web page that a web user touches enforces the API concept. The web browser provides an application-programming interface (API) to change the layout and presentation. The host provides an application-programming interface to retrieve and create data.
For the developer of a web page, each activity on the developer’s page is a contract between his application and the API provider (original developer). There are some lessons to be learned from this contract.
1 – The web page developer should only use explicitly documented APIs to ensure the contract is maintained.
2 – The original developer should be aware that the web page developer is going to find the contract to match the use-case. The web page developer observes the Firebug traffic, analyzes the database contents and determines the “unofficial” application-programming interface that fulfills the contract the developer needs.
3 – Once a user uses the web page (or application), the contract should be treated as sacred, and not to be broken. If the contract breaks, the original developer should version the API.