Skip to content

How APIs Work

Task: Follow one request from an app to a database and back

Your appAPIServerDatabase31°C IN DELHI→GET /weather?city=Delhi←200 OK {"city":"Delhi","temp":31}NEEDS THE WEATHER

What you are watching

One API request, followed from a phone to a database and back. The app sends GET /weather?city=Delhi to the API, which passes it to the server; the server queries the database, which returns the value 31; the server wraps that in JSON and the reply travels back through the API to the app as 200 OK. Four stops out and the same four back, with the app never reaching the database itself.