Forms & data
What is an API?
An API, or application programming interface, defines how software can use another software component's capabilities. It specifies available operations and the information those operations accept or return.
By Plainview WebReviewed
The meaning
A user interface gives a person buttons, forms and screens. An API gives code a defined way to work with a feature or service. The two can support the same task: a person might open a dashboard to read a record, while a program requests that record through an API.
A web service often exposes endpoints: addresses for particular requests, such as listing products or creating an inquiry. Its documentation describes the request method, inputs, access requirements and response. JSON is a common data format, but an API does not have to use JSON, and not every API is a remote web service. Browsers also provide APIs for capabilities on the device.
An example
A fictional workshop availability request
Illustrative request
GET https://example.com/api/workshops/demo-1042
Illustrative response body
{
"workshop_id": "demo-1042",
"title": "Introduction to paper craft",
"places_available": 5
}A fictional workshop website uses a documented API to ask its scheduling system for one workshop's details. The response supplies values that the website can display. The endpoint, record and response above are invented to explain the exchange; they are not a live service or a provider's actual format.
Reading five available places does not reserve them. A reservation would need its own supported operation and checks, and availability could change before that operation completes. The integration must distinguish showing information from successfully changing a record.
When it matters
Before planning an integration, check that the provider exposes the operation you need and that the intended account can use it. Confirm permissions, the meaning of each field, request limits and any relevant service costs. Access to a product's dashboard does not by itself establish access to every API operation.
Decide who maintains the connection when credentials expire, requests fail or the provider changes its API. Keep secret credentials out of public page code and shared example files. For data supplied as JSON, Plainview's JSON Formatter & Validator can help inspect the text; valid JSON syntax does not prove that the request meets the API's rules.
A common confusion
An API does not automatically keep two systems in sync
An API makes supported interactions possible; a working integration still has to call it, interpret responses and handle failures. Repeatedly asking an API for changes is called polling. A webhook instead sends a notification when a supported event occurs, so the receiving system does not have to keep asking for that event.
The two can work together: a webhook can announce a change, then the receiver can request more detail through an API. The provider's documentation determines what is available. Neither an API address nor a webhook address alone completes the workflow.