Skip to content

API

API

AApplication
PProgramming
IInterface

Allows other programs or application to use functionality that you expose:

  • Functions
  • Protocols
  • Objects

Weather Data Example

Request:

GET https://www.7timer.info/bin/astro.php
?lon=15.593063
&lat=48.411018
&ac=0
&unit=metric
&output=json

Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
"product": "civil",
"init": "2023070206",
"dataseries": [
{
"cloudcover": 7,
"temp2m": 21,
"rh2m": "63%",
"wind10m": {
"direction": "W",
"speed": 3
},
...
]
}

API Use-Cases

  • Frontend - Backend Communication
  • Component Comunication
    • e.g. One Service calls another service
  • DaaS

Frontend-Backend

API_Frontend_Backend Using APIs, you can link any software parts, potentially using different technologies, as long as they support the same protocol.


Component Communication

API_Component_Communication


Protocols

There are several common protocols used in APIs.

API_Communication_Protocols


Attributes of protocols

Protocols …

  • allow exchange of messages and information between 2 processes.
    • Processes don’t need to be on the same physical machine. Can be distributed and communicate over network.
  • are open to any technology or programming language.
  • have a clear specification.