Programmable interface to services at remote site.
(i.e. Can be called by programs with no human user.)
Called "Web services"
or the use of
Your app posts updates to Twitter
without leaving the app.
Needs read-write access over network.
Through API interface - calling methods on remote site.
Manufacturer automatically queries distributors for stock levels and other shared information.
Done over network,
but general public has no access to this information.
The name "Web" implies uses HTTP.
But some services in fact do not.
- APIs in general
- Service-oriented architecture (SOA)
is the general design principle.
- The service may be:
- Public, free.
- Public, pay, authenticate.
- Between company and partner company only.
e.g. Stock tracking service to/from supplier and customer.
- Between two divisions inside a company.
A big feature of SOA thinking is to make one department's work usable by another department.
2010 survey of web APIs.
2011 graph showing number of different web APIs.
REST v SOAP
- Allows any data format.
It often uses JSON
for fast parsing on client side.
But this is not required.
Other formats can be used.
Simple to code and deploy.
Easy for large numbers of developers to use.
- Widely used for "open APIs" with large number of developers.
Apart from being restricted to one format,
XML often involves more overhead -
more bytes of data, more parsing time.
- Higher learning curve for developers.
SOAP has more advanced
for mission-critical security.
Widely used in business.
Note some APIs are business-to-business (or department-to-department within one company)
and not known to public.
2012 survey shows SOAP has bigger market share in finance
than in some other categories.
Future of APIs