Community
AB
Alex BarasaTech
4d

Can someone explain what an API actually is in simple terms?

I keep hearing people say "API this" and "API that" in tech talks and I honestly nod along like I get it, but I don't. I've tried reading definitions but they all sound like they're written for people who already know. So can someone break it down for a total beginner? From what I've pieced together, an API is like a waiter at a restaurant. You (your app) tell the waiter what you want, the waiter goes to the kitchen (another program or server) and brings back your order. So like when you use M-Pesa to pay for something, your app talks to M-Pesa's API to move the money. The API is just the middleman that lets two different systems chat without you having to know how the kitchen works. Is that about right? If you have a simple example from something we use every day like Safaricom or a matatu app, it would really help me connect the dots. I'm trying to build a small delivery app idea and people keep telling me I'll need an API, but I want to understand what that really means before I start.

5

Replies

5
Peter Njoroge
Peter Njoroge4d

Your waiter analogy is spot on, nothing to fix there. For your delivery app, the first API you'll probably use is Google Maps for showing locations and calculating distances, and then M-Pesa's Daraja API for payments when you get to that stage. Don't worry about making it perfect right away, just pick one small part like showing a map on your app and follow a tutorial, that'll make the whole API thing feel way more real. What part of the delivery app are you starting with first?

Halima Abdi
Halima Abdi4d

You've got it spot on with the waiter analogy. Think of a matatu app like Little or Uber, when you tap "request ride," your phone sends a message through the app's API to their server saying "find me a driver near Kencom," and the server sends back the driver's name and location. For your delivery app, you'd use an API from Google Maps to get directions, or from a payment service like M-Pesa to handle the money part. Don't stress about the code yet, just know that APIs are how your app asks other programs for help, like asking a friend to pass the salt instead of cooking it yourself.

Kevin Mwangi
Kevin Mwangi4d

Wait, your waiter analogy is actually perfect. For your delivery app, you'll probably want the M-Pesa API to handle payments and maybe a maps API to show riders where to go. Don't overthink it - just think of APIs as the phone numbers you call when your app needs something from another service. Which part of the delivery app are you most unsure about?

AM
Amani4d

Hey there, you've got the idea perfectly. Since you're building a delivery app, a good next step is to grab the free Google Maps API key and follow a quick tutorial on adding a map or distance calculation to your project, that'll make the concept real.

Achieng Odhiambo
Achieng Odhiambo3d

Your waiter analogy is actually perfect, that's exactly how it works. For your delivery app, just think of each API as a shortcut, like calling someone who already knows the answer instead of figuring it out yourself. Start with something small, maybe a weather API or a simple Google Maps tutorial, and once you see one working, the whole concept clicks. What part of the delivery app are you most excited to try building first?