What is a Web API?
According to Wikipedia, an application programming interface (API) is a specification intended to be used as an interface by software components to communicate with each other. A web API, or a Web service, is typically a set of defined HTTP requests and responses.For example, the URL below returns the Whois information for facebook.com in XML format using EnClout Whois API.
/whois/show.xml?auth_token=JPbbCaVFYdnpm2xY9aq1&url=facebook.com
A web API typically consists of the following parts:
- URL, this is the URL to invoke the API
- Authentication, this is how the caller identifies itself to the API.
In many cases, the authentication is done by specifying a token parameter in the URL. - Input(s).
- Output, typically expressed in JSON or XML format.
In many cases, caller can specify the output formats by calling the appropriate URLs.