What Is an API? An Explanation for Non-Programmers
An API (Application Programming Interface) is a structured way for one piece of software to request a specific service from another. It defines what you can ask for, how to ask, and what format the answer comes back in. Every time you pay via M-Pesa on a website, an API is handling the conversation between that site and Safaricom's systems.
An API (Application Programming Interface) is a structured way for one piece of software to request a specific service from another. It defines what you can ask for, how to ask, and what format the answer comes back in. Every time you pay via M-Pesa on a website, an API is handling the conversation between that site and Safaricom's systems.
The M-Pesa STK push: an API you already use
Forget the overused "waiter in a restaurant" analogy. Let us trace something real.
You are buying airtime on an online platform. You enter your phone number and click "Pay with M-Pesa." Within seconds, a payment prompt appears on your phone asking you to enter your M-Pesa PIN. You confirm, the money is deducted, and the platform shows "Payment Successful."
Here is what happened behind the scenes, step by step.
The online platform sent a request to Safaricom's M-Pesa API (called Daraja). That request said, in a structured format: "Please send an STK push to phone number 0712XXXXXX for this amount, transaction reference AIRTIME-4521." The request included authentication credentials proving the platform is authorized to make this call.
Safaricom's system received that request, validated it, and pushed the payment prompt to your phone. You entered your PIN. Safaricom processed the payment, then sent a response back to the platform's API: "Payment confirmed. Transaction ID: QKL3XXXXX. Amount received."
The platform received that response and updated your screen to show the confirmation.
That entire exchange is an API at work. One system (the platform) asked another system (Safaricom) to perform a service, using a predefined format that both systems agreed on.
What are the key parts of any API?
Every API has the same basic components, regardless of what it does.
The request is what one system sends to another. It includes what action is needed (send a payment prompt, retrieve weather data, post a message) and any details required (phone number, location, message text).
Authentication proves the requester is authorized. Safaricom does not let random systems trigger M-Pesa payments. The platform must include a valid API key and credentials with every request. This is like showing an ID before entering a building.
The endpoint is the specific address the request goes to. Safaricom's STK push endpoint is different from their balance inquiry endpoint or their transaction status endpoint. Each endpoint handles one type of request.
The response is what comes back. It includes the result (success or failure), any relevant data (transaction ID, account balance), and a status code (a number indicating what happened). A "200" status code means success. A "401" means unauthorized. A "500" means something broke on the receiving end.
Documentation is the instruction manual. Every API publishes documentation explaining its endpoints, what data each request requires, what responses look like, and what errors are possible. Safaricom publishes Daraja API documentation that developers reference when building M-Pesa integrations.
Why should non-programmers care about APIs?
Understanding APIs changes how you think about what technology can do.
When you know that M-Pesa has an API, you realize any system can accept M-Pesa payments, not just Safaricom's own app. That is why hundreds of Kenyan websites, apps, and platforms offer M-Pesa as a payment option.
When you know that Google Maps has an API, you understand why delivery apps can show real-time driver locations on a map. They did not build their own mapping system. They plugged into Google's through an API.
When you know that ChatGPT and Claude have APIs, you realize generative AI can be embedded into any product. A Kenyan startup building a customer service tool does not need to create its own AI from scratch. It connects to an existing AI through an API.
This knowledge is practical even if you never write code. When evaluating software for your business, you can ask: "Does this tool have an API?" If yes, it can connect to other systems. If no, it is an island. That single question often determines whether a tool fits into your workflow.
How do APIs connect to no-code tools?
This is where the concept becomes directly useful for non-technical people.
No-code platforms like Zapier, Make, and n8n are essentially visual API connectors. When you create a Zapier workflow that says "when I receive a form submission, add a row to Google Sheets and send a WhatsApp message," Zapier is calling the Google Sheets API and the WhatsApp Business API on your behalf.
You did not write any code. Zapier's interface translated your visual configuration into the correct API requests, handled authentication, and managed the responses. The API is still there, doing the work. The no-code tool is just making it accessible without programming.
Understanding this helps when things break. If your Zapier workflow suddenly stops adding rows to Google Sheets, knowing that an API is involved tells you what to check: Did the authentication expire? Did Google change their API? Is the data format wrong? You may not fix it yourself, but you can diagnose the problem category and communicate clearly with someone who can.
What does this look like in everyday Kenyan tech?
APIs are the connective tissue of the Kenyan tech ecosystem.
M-Pesa Daraja API powers mobile payments on thousands of platforms. Every online store, delivery app, and bill payment service that accepts M-Pesa uses this API.
MPESA Till and Paybill integrations are built on APIs that let businesses receive payments and automatically reconcile them with their accounting systems.
Kenya Revenue Authority (KRA) APIs allow accounting software to submit tax returns directly, saving accountants the manual process of entering data on the iTax portal.
Mobile banking APIs let fintech apps check account balances, initiate transfers, and process loan applications through partner bank systems.
Weather APIs from Kenya Meteorological Department and global providers feed data into agricultural advisory tools that help farmers make planting decisions.
Each of these follows the same pattern: one system requests a service from another through a structured, documented interface.
How does understanding APIs help with AI and automation?
Modern AI tools are delivered as APIs. When a business wants to add AI to its workflow, it typically calls an AI API.
A practical example: a Kenyan customer service team wants to automatically categorize incoming support emails. They build a workflow where incoming emails are sent (via API) to Claude's language model, which categorizes them. The category is then sent (via API) to their helpdesk system, which routes the email to the right team.
The AI part is Claude's categorization. The automation part is the routing. The APIs are the connections that make it all work together.
Our AI and Automation for Beginners course dedicates a full module to APIs, walking through real integrations step by step. The goal is not to turn you into a developer, but to give you enough understanding to design workflows, evaluate tools, and communicate with technical teams.
FAQ
Do I need to know programming to use APIs?
Not necessarily. No-code tools like Zapier and Make handle API calls through visual interfaces, no code required. However, understanding what an API is and how it works (requests, responses, authentication, endpoints) makes you more effective even with no-code tools. If you want to call APIs directly, some basic programming knowledge (typically Python or JavaScript) is needed, but many professionals work with APIs daily through no-code platforms alone.
Are APIs free to use?
It varies. Many APIs offer free tiers with usage limits. Safaricom's Daraja API charges transaction fees on payments processed. Google Maps API gives a monthly free credit and charges beyond that. AI APIs like OpenAI's and Anthropic's charge based on usage volume. Most API providers publish their pricing clearly in their documentation. For small businesses, the free tiers often cover initial needs.
What happens when an API goes down?
When an API is unavailable, any system depending on it stops working for that function. If Safaricom's Daraja API has downtime, M-Pesa payments on third-party platforms fail during that window. Good software design includes error handling: showing the user a clear message, retrying the request after a delay, or offering an alternative payment method. When evaluating tools for your business, ask about their uptime guarantees and how they handle API failures.
What is the difference between an API and a webhook?
An API is typically pull-based: your system sends a request and gets a response. A webhook is push-based: another system sends data to your system when an event occurs. In the M-Pesa example, your platform calls the API to initiate a payment (pull). Safaricom can also send a webhook to your platform when the payment completes (push), so your system gets notified instantly without having to keep checking. Many integrations use both: APIs for sending requests and webhooks for receiving notifications.
Frequently Asked Questions
### Do I need to know programming to use APIs?
Not necessarily. No-code tools like
7-minute Welcome lesson, no purchase required
Bonaventure Ogeto
Founder, Mctaba Labs
Software engineer building products for the African market. Teaching 10,000+ students across multiple platforms. BSc Mathematics & Computer Science from JKUAT.