Application programming interface
|This article may require copy-editing for grammar, style, cohesion, tone or spelling. You can assist by editing it now. (December 2008)|
Application programming interface (API) is an interface in computer science that defines the ways by which an application program may request services from libraries and/or operating systems. An API determines the vocabulary and calling conventions the programmer should employ to use the services. It may include specifications for routines, data structures, object classes and protocols used to communicate between the requesting software and the library.
An API may be:
- Language-dependent; that is, available only in a given programming language, using the syntax and elements of that language to make the API convenient to use in this context.
- Language-independent; that is, written in a way that means it can be called from several programming languages (typically an assembly or C interface). This is a desired feature for a service-style API that is not bound to a given process or system and is available as a remote procedure call.
An API itself is largely abstract in that it specifies an interface and controls the behavior of the objects specified in that interface. The software that provides the functionality described by an API is said to be an implementation of the API. An API is typically defined in terms of the programming language used to build the application. The related term application binary interface (ABI) is a lower level definition concerning details at the assembly language level. For example, the Linux Standard Base is an ABI, while POSIX is an API.
The API initialism may sometimes be used as a reference, not only to the full interface, but also to one function, or even a set of multiple APIs provided by an organization. Thus, the scope of meaning is usually determined by the person or document that communicates the information.
The POSIX standard defines an API that allows a wide range of common computing functions to be written such that they may operate on many different systems (Mac OS X and various Berkeley Software Distributions (BSDs) implement this interface); however, making use of this requires re-compiling for each platform. A compatible API, on the other hand, allows compiled object code to function without any changes, on any system implementing that API. This is beneficial to both software providers (where they may distribute existing software on new systems without producing/distributing upgrades) and users (where they may install older software on their new systems without purchasing upgrades), although this generally requires various software libraries implementing the necessary APIs too.
Microsoft has shown significant commitment to a backward compatible API, particularly within their Windows API (Win32) library, such that older applications may run on newer versions of Windows. Apple Inc. has shown less propensity to this concern, breaking compatibility or implementing an API in a slower "emulation mode"; this allows greater freedom in development, at the cost of making older software obsolete.
Among Unix-like operating systems, there are many related but incompatible operating systems running on a common hardware platform (particularly Intel 80386-compatible systems). There have been several attempts to standardise the API such that software vendors may distribute one binary application for all these systems; however to date, none of these have met with much success. The Linux Standard Base is attempting to do this for the Linux platform, while many of the BSD Unices (FreeBSD, NetBSD, OpenBSD) implement various levels of API compatibility for both backward compatibility (allowing programs written for older versions to run on newer distributions of the system) and cross-platform compatibility (allowing execution of foreign code without recompiling).
Common API publishing policies include:
- Companies do not release API information to anybody outside of the company.
- Companies protect information on their APIs from the general public. For example, Sony used to make its official PlayStation 2 API available only to licensed PlayStation developers. This enabled Sony to control who wrote PlayStation 2 games. Such control can have quality control benefits and potential license revenue.
- Companies make their APIs freely available. For example, Microsoft makes the Microsoft Windows API public and Apple releases its APIs Carbon and Cocoa so that software can be written for their platform.
- ASPI for SCSI device interfacing
- Carbon and Cocoa for the Macintosh
- Comedi Data Acquisition API
- DirectX for Microsoft Windows
- Drupal API (Drupal)
- Facebook API (Facebook)
- Google Maps API
- iPhone API
- Java APIs
- MediaWiki API
- OpenGL cross-platform graphics API
- OpenAL cross-platform sound API
- OpenCL cross-platform API for general-purpose computing for CPUs & GPUs
- PaymentVision PayAPI for ACH & Credit Card Payment Processing
- PayPal Payment Pro
- PC BIOS call interface
- Mosso_(cloud_computing) API
- Simple DirectMedia Layer (SDL)
- Single UNIX Specification (SUS)
- TweetDeck (uses the Twitter API)
- Windows API
- YouTube API
- AMESim Circuit API
APIs are changing the way in which web-based companies interact on the Internet and have become a complete distribution channel for Web services and a potential source of revenues. However, to exploit the full potential of APIs, companies need to build a management infrastructure. This generally includes the following features:
- Key management and customer sign-up: Automated issue tracking, refresh and control of API access keys.
- Limit management and enforcement.
- Usage plan management: Creation, modification and management of standard usage plans, each with different features sets, limits and/or pricing rules.
- Per customer limit and usage policy adaptation.
- Developer community tools: Growing visibility and API usage through online management of documentation and developer forums/discussions.
- Monitoring and analytics: Tracking information on a per user basis for hit patterns,volume and method usage.
- User messaging, ticket tracking and support tools: Interactive tools to deal with developer support queries.
- Billing and payments.
- Traffic proxies and caching: Traffic filtering and management components to improve service performance.
There are some companies who offer these management tools for those web services providers who don't have enough resources to build them or want to stay focused on their core service
Language bindings and interface generators
APIs that are intended to be used by more than one high-level programming language often provide, or are augmented with, facilities to automatically map the API to features (syntactic or semantic) that are more natural in those languages. This is known as language binding, and is itself an API. The aim is to encapsulate most of the required functionality of the API, leaving a "thin" layer appropriate to each language.
Below are listed some interface generator tools which bind languages to APIs at compile time.
- SWIG generates interfaces from many languages for many languages (Typically Compiled->Scripted)
- F2PY: Fortran to Python interface generator.
- XPCOM (Cross Platform Component Object Model) is a cross platform component model from Mozilla.
- Application Binary Interface (ABI)
- Document Object Model (DOM)
- Mashup (web application hybrid)
- Open Service Interface Definitions (OSID)
- Platform-enabled website
- Software Development Kit (SDK)
- Web service
- List of 3D graphics APIs
- API Writers
- Double-chance function
- ↑ "Application Program Interface". Free On-line Dictionary of Computing. 1995-02-15. http://foldoc.org/Application+Program+Interface. Retrieved 2009-06-28.
- ↑ "Definition of: API". PC Magazine. 1996. http://www.pcmag.com/encyclopedia_term/0,2542,t=application+programming+interface&i=37856,00.asp. Retrieved 2009-06-28.
- ↑ Orenstein, David (2000-01-10). "QuickStudy: Application Programming Interface (API)". Computerworld. http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=43487. Retrieved 2009-06-04.
- ↑ Stoughton, Nick (April 2005). "Update on Standards" (PDF). USENIX. https://db.usenix.org/publications/login/2005-04/openpdfs/standards2004.pdf. Retrieved 2009-06-04.
- ↑ Benslimane, Djamal; Schahram Dustdar, and Amit Sheth (2008). "Services Mashups: The New Generation of Web Applications" (HTML). IEEE Internet Computing, vol. 12, no. 5. Institute of Electrical and Electronics Engineers. pp. 13-15. http://www.computer.org/portal/web/csdl/abs/html/mags/ic/2008/05/mic2008050013.htm.
- ↑ "Mashup Dashboard". ProgrammableWeb.com. 2009. http://www.programmableweb.com/mashups.
- Practical API Design book and collaboration site
- How to design a good API and why it matters-PDF
- The trends and the role of API-driven mashup building tools in the enterprise computing
- Service-Oriented Architecture (SOA): The Road to Enterprise Application Integration (EAI)
- Organized list of API references with fast as-you-type search
- ISO/IEC JTC 1 Directives, 5th Edition Version 3.0, Annex J: Guidelines for API standardization
- API functions tutorial for game making