The general concept of a web API (application programming interface) has two main interpretations. It is used to refer to both a server-side API upon a web server as well as client-side API within a web browser.
A server-side web API is a programmatic interface to a defined request-response message system, typically expressed in JSON or XML, which is exposed via the web—most commonly by means of an HTTP-based web server. Mashups are web applications which combine the use of multiple such web APIs.
While "web API" in this context is sometimes considered a synonym for web service, Web 2.0 web applications have moved away from a service-oriented architecture (SOA) with SOAP-based web services towards more cohesive collections of RESTful web resources. These RESTful web APIs are accessible via standard HTTP methods by a variety of HTTP clients including browsers and mobile devices.
The Mozilla Foundation created their WebAPI specification which is designed to help replace native mobile applications with HTML5 applications.
See also 
Further reading