A waiter between two kitchens
Imagine a restaurant. You (your website) want to order food, but you’re not allowed into the kitchen (a foreign service – weather, maps, AI). That’s what the waiter is for – they take your order, carry it to the kitchen, and bring you back the finished dish.
That waiter is called an API (Application Programming Interface). It’s an agreed-upon way for programs to ask each other for data:
- Your website sends a request (“What will the weather be like tomorrow in Brno?”).
- The API passes it to the service that knows the answer.
- The service returns a response in an agreed-upon format.
Show me: JSON – a shared language
Programs reply to each other in JSON format. It looks almost like a JavaScript object, which you already know from Magician:
{
"mesto": "Brno",
"teplota": 21,
"slunecno": true,
"dny": ["Saturday", "Sunday"]
}
- Text is in quotes, numbers aren’t.
true/falseyou already know from conditions.- Square brackets = a list, curly braces = an object.
Try it right now – open this address in your browser (it’s a real weather API, free, no registration needed):
https://api.open-meteo.com/v1/forecast?latitude=49.19&longitude=16.61¤t_weather=true
You’ll see JSON with the current weather in Brno. No graphics – just pure data. You get to build the graphics around it!
APIs are everywhere. When a mobile app shows you a forecast, a bus schedule, or a map, it almost never has that data itself – it asks through an API. Now you’re learning to do the same thing.
Your turn 💪
- Open the address above in your browser and find the current temperature and wind speed in the response.
- Try changing the
latitudeandlongitudein the address to your own city’s coordinates (find them on a map service – right-click → “What’s here?”). - Write down 2–3 ideas for your project about what outside data would be useful on your website:
🏫 School website – ideas
Weather for a school trip, a map with the school’s location, a lunch menu from the cafeteria’s API (if it has one), holidays and school breaks.
🙋 Personal website – ideas
Weather in your city, a map of places you’ve been, an AI chatbot that answers questions about you for visitors.
🌍 Travel journal – ideas
A map with pins for your trips, weather at your next destination, currency conversion for your travel budget.
⚽ Club website – ideas
Weather for the weekend match, a map of the field for visiting teams, an AI helper explaining the rules of football.
Check: You can explain what an API is (a waiter between programs) and recognize JSON. You’ve seen a real API response in your browser.
What to take away from this lesson
- API = an agreed-upon way for programs to ask each other for data.
- Responses come in JSON – objects and lists just like in JavaScript.
- In the next lesson you’ll pull data from an API straight into your website using
fetch.
© 2026 Ing. Martin Polak / AlgoRhino · Content usage terms