(computer science) A language that enables communication between computer programs, in particular between application programs and control programs. Abbreviated API.
Sci-Tech Dictionary:
application program interface |
(computer science) A language that enables communication between computer programs, in particular between application programs and control programs. Abbreviated API.
Related Videos:
Application programming interface |
Computer Desktop Encyclopedia:
programmatic interface |
Wikipedia:
Application programming interface |
| This article may require copy-editing for grammar, style, cohesion, tone or spelling. You can assist by editing it. (December 2008) |
An application programming interface (API) is an interface implemented by a software program to enable interaction with other software, much in the same way that a user interface facilitates interaction between humans and computers. APIs are implemented by applications, libraries and operating systems to determine the vocabulary and calling conventions the programmer should employ to use their services. It may include specifications for routines, data structures, object classes and protocols used to communicate between the consumer and implementer of the API.[1][2][3]
|
Contents
|
An API is an abstraction that defines and describes an interface for the interaction with a set of functions used by components of a software system. The software that provides the functions described by an API is said to be an implementation of the API.
An API can be:
For example, a website that allows users to review local restaurants is able to layer their reviews over maps taken from Google Maps, because Google Maps has an API that allows it. Google Maps' API controls what information a third-party site can grab, and what can be done with it.
"API" may be used to refer to a complete interface, a single 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.
In its simplest form an API can be a list containing the description of a set of functions that is included in a library and that address a specific problem. For example, in Unix systems the math.h include file for the C language contains the definition of the mathematical functions available in the C language library for mathematic processing (usually called libm). The man pages associated to it contain a textual description on how to use these functions and the expected result for the function invocation. For example, on a Unix system the command man 3 sqrt will present the signature of the function sqrt in the form:
SYNOPSIS
#include <math.h>
double sqrt(double X);
float sqrtf(float X);
DESCRIPTION
DESCRIPTION
sqrt computes the positive square root of the argument. ...
RETURNS
On success, the square root is returned. If X is real and positive...
that means that the function requires a positive floating point number (single or double precision) in input and returns a floating point number in output and this is the square root of the number given in input. Hence the API in this case can be interpreted as the collection of the include files used by the C language and its human readable description provided by the man pages.
In object oriented languages an API usually entails a description of a set of class definitions with a set of behaviours associated to the classes. A behaviour is a description of how an object, derived from that class, will behave in a given circumstance. This abstract concept is associated to real functionalities exposed by the classes that are implemented in terms of actual class methods.
The API in this case can be conceived as the sum of all the methods publicly exposed by the classes (usually called the class interface). This means that the API prescribes the methods through which one handles the objects derived from the class definitions.
More generally one can see the API as the collection of all the kind of objects one can derive from the class definitions (for using them in programs), and their associated possible behaviours. The use again is mediated by the public methods, but in this interpretation the methods are seen as a technical detail of how the behaviour is implemented.
For instance: a class representing a Stack can expose publicly two methods push() (to add a new item to the stack), and pop() (to extract the last item, ideally placed on top of the stack).
The API in this case can be interpreted as the two methods pop() and push(), or more generally as the idea that one can use an item of type Stack that implements the behaviour of a stack (a pile exposing its top to add/remove elements).
This concept can be pushed to the limit of having a class interface in an API that has no methods at all, but only behaviours associated to. For instance the Java language API includes the interface Serializable which is an interface that requires the class which implements it should behave in a way as to be serializable. This does not require it to have any public method, but rather requires that the class permits it to have a representation that can be saved at any time (this is typically true for any class containing simple data, and no link to external resources like an (open) connection to a file, a remote system or an external device).
In this sense, in an object oriented languages, the API turns to be a contract on a set of behaviors, possibly mediated by a set of class methods.
In object oriented languages the API is still distributed in form of libraries. Instead the documentation is usually not provided in the form of few simple man pages, but are often presented as a rich and complex set of documents. For example, the Java language libraries include a set of APIs that are provided in the form of the JDK used by the developers to build new Java programs. The JDK includes the documentation of the API in Javadoc notation. The quality of the documentation associated to an API is often a factor determining its success in terms of ease of use.
When used in the context of web development, an API is typically a defined set of Hypertext Transfer Protocol (HTTP) request messages along with a definition of the structure of response messages, usually expressed in an Extensible Markup Language (XML) or JavaScript Object Notation (JSON) format. While "Web API" is virtually a synonym for web service, the recent trend (so-called Web 2.0) has been moving away from Simple Object Access Protocol (SOAP) based services towards more direct Representational State Transfer (REST) style communications[4]. Web APIs allow the combination of multiple services into new applications known as mashups [5].
The practice of publishing APIs has allowed web communities to create an open architecture for sharing of content and data between communities and applications. In this way, content that is created in one place can be dynamically posted and/or updated in multiple locations on the web.
1. Photos can be shared from sites like Flickr and Photobucket to Social Network sites like Facebook and MySpace.
2. Content can be embedded, like embedding a presentation from SlideShare on a Linked-In profile.
3. Content can be dynamically posted. Sharing comments made on Twitter to a Facebook account for example is enabled by Twitter and Facebook's APIs.
4. Video content can be embedded on sites.
5. User information can be shared from web communities to outside applications, delivering new functionality to the web community that shared its user data via an open API. One of the best examples of this is the Facebook Application platform. Another is the Open Social platform[6].
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 commitment to a backward compatible API, particularly within their Windows API (Win32) library, such that older applications may run on newer versions of Windows using an executable-specific setting called "Compatibility Mode"[7]. 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.[citation needed]
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:
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.[8]
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.
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
| BioAPI (intelligence) | |
| API (abbreviation) | |
| function (technology) |
Copyrights:
![]() | Sci-Tech Dictionary. McGraw-Hill Dictionary of Scientific and Technical Terms. Copyright © 2003, 1994, 1989, 1984, 1978, 1976, 1974 by McGraw-Hill Companies, Inc. All rights reserved. Read more | |
![]() | Computer Desktop Encyclopedia. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher. © 1981-2010 The Computer Language Company Inc. All rights reserved. Read more | |
![]() | Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Application programming interface". Read more |