How an API Works and Why They Are So Cool

A simple explanation on how APIs are used

Jesse Nerio
Javarevisited
Published in
4 min readOct 16, 2023

--

Photo by Daniel Schwen on WikiMedia

APIs (Application Programming Interfaces) are often thought only to be web-based. The typical association is with Rest APIs, which essentially use web protocols or TCP/UDP custom protocols.

However, APIs are better thought of as an interface between two applications or code sources which are executing at the same time. A fantastic example of this is graphics APIs.

How can I, the developer, interact with the GPU and make it show 3D models, animations and process a game frame? This interaction is the very definition of an interface.

Through an interface we have an intermediary layer between the graphics card and the developer. Popular interfaces between the developer and graphics card are OpenGL, WebGL, Vulkan, DirectX, SDL and many more.

Of course, there is a driver and firmware associated with the graphics card. It is those two we manipulate with the graphics interface or graphics API. Further, many libraries in Python and well, every language library, can be thought of as an interface.

In reality, interfaces are used constantly to manipulate foreign forces using code. Whether or not we expressly call it an interface is a whole other thing.

--

--

Jesse Nerio
Javarevisited

Hello, I am a self-taught programmer with a college background. My content is written with the purpose of making you into a better programmer. Share & follow :D