API is short for Application Programming Interface. An API allows one program to make use of the functionality of — or data available to — another program.
In most cases when talking about an API in the context of front-end development, what we mean is sending data to or receiving data from a back-end system. APIs are ubiquitous: almost all large online services, such as Twitter, Facebook, Dropbox, Slack have APIs. Most smaller services do, too and it is fairly common for front-end projects to be set up as having a separate front-end that communicates with databases and other systems via an API.
The data format that APIs communicate with is mostly JSON, but XML is common too and mostly particular to certain types of software or programming languages, especially when they have been around for longer.
To communicate with such an API, an ‘endpoint’ is needed. The implementation of the API exists of calling the endpoint with certain parameters and retrieving data. An endpoint may look like this:
Typically, an endpoint like this would return the information of a user with user id
However, APIs aren’t necessarily ‘online’ or part of the web: any piece of software that can be accessed by other software has some sort of API. Even HTML can be described as having an API:
<a href="https://howfrontendworks.com">How Front-end Works</a>
href attribute of the
<a> element (a hyperlink) is part of the element’s API.
In a sentence:
I’m having trouble figuring out the Twitter Search API