An API is a set of functions that an application exposes to other applications.
A protocol describes the mechanism by which those applications communicate.
An API will often specify the protocol(s) required to interact with the system. For example a website might say, this is our API, you can call this getWeather method to request the current weather for the city provided. But the documentation will also say, this is a REST API, you must use the Hyper Text Transfer Protocol to send requests. And if you don’t know what that is, you need to refer to the HTTP specification to know how to structure your requests, and what responses to expect.
Latest Answers