Blog / How the internet works /
APIs explained for website owners
You open a travel site, type your dates, and get live flight prices from forty airlines in two seconds. The site did not call each airline. Its software asked each airline’s system a question, got an answer, and displayed it. The channel for that question is an API.
An API (Application Programming Interface) is a set of rules that lets one piece of software ask another for something and get a predictable answer. Where a protocol is how two machines talk, an API is the menu of what you may ask for.
The analogy: a waiter
You sit in a restaurant. You do not walk into the kitchen. You read the menu (the list of things you may order), tell the waiter what you want, and the waiter brings the result. You do not know how the kitchen works, and you do not need to.
- The menu is the API documentation.
- The waiter is the API itself.
- The kitchen is the system behind it.
- Your order is a request, and the dish is the response.
What an API call looks like
In web terms, an API is usually a web address that returns data instead of a page.
You send a request: “Give me the weather for Lagos.” The server returns something like:
{ "city": "Lagos", "temperature": 31, "conditions": "Partly cloudy" }
That structured format is called JSON. Your software reads it and does something: shows a widget, sends an alert, stores a number. Most web APIs follow a style called REST, which uses normal web requests (GET to read, POST to create, and so on), while newer ones such as GraphQL let the caller ask for exactly the fields they want.
APIs you already depend on
If you run a website, you use APIs even if you never wrote code.
- Payments. Stripe, PayPal and Paystack let your shop charge cards without handling card data yourself.
- Maps. Google Maps on your contact page.
- Email. Mailchimp, SendGrid or your SMTP provider sending order confirmations.
- Analytics and search. Google Analytics, Search Console data in Looker Studio.
- Shipping. Live delivery rates and tracking numbers.
- Social logins and embeds. “Sign in with Google” or an embedded video.
- Your own CMS. WordPress has a REST API, and Shopify has its Admin and Storefront APIs. Apps and plugins work through them.
- AI. Sending text to a model and receiving a response.
When a plugin or app “connects” to another service, it almost always uses an API under the surface.
The words you will see
- API key: a long secret string that identifies your site to the service. Like a membership card.
- Endpoint: a particular address for a particular thing, for example
/ordersor/products. - Rate limit: a cap on how many requests you may send per minute or day.
- Authentication: how you prove who you are, with a key, a token, or OAuth, the “Allow this app to access your account” screen.
- Webhook: the reverse direction. Instead of you asking repeatedly “any new orders?”, the service tells you the moment something happens.
- Sandbox/test mode: a safe version for practice, with pretend data.
Why it matters to a site owner
It lets you connect tools instead of copying data by hand
Orders flow into accounting, subscribers into your newsletter, stock levels into marketplaces. Without APIs, someone would be copy-pasting spreadsheets. Tools like Zapier and Make are essentially friendly wrappers around many APIs.
It is a place where sites break
An API is a dependency. When it changes or fails, your site feels it.
- The service goes down, and your checkout or map stops working.
- A provider retires an old version, and the plugin using it breaks until updated.
- You hit a rate limit during a busy sale, and requests start failing.
- A key expires, is revoked or is wrongly copied, and everything connected stops.
When something “suddenly stopped working” and nothing on your site changed, an API on the other end is a prime suspect. I covered how I approach such hunts in plugin conflicts on WordPress: how I find the culprit.
It affects speed
Every call to an outside API adds waiting time. If a page fetches data from three slow services before showing anything, visitors wait. Fetch such data in the background or cache the result where you can. The same logic applies to third-party scripts.
It affects security
Keys are secrets. A key pasted into public code, or into a page’s source, can be copied and used by anyone, sometimes running up charges on your account.
Good habits
- Keep keys private. Don’t put secret keys in front-end code or public repositories. Store them in server settings or a secrets manager.
- Use the least access needed. Many services let you limit a key to read-only or to specific actions.
- Keep a list of integrations: what connects to what, who owns the account, and when keys expire. It fits neatly into a site register, like the one in why I keep a site register for every client.
- Use test mode first for anything that moves money.
- Watch usage and billing. Some APIs are free up to a limit and costly beyond it.
- Read the provider’s status page and change notices. They are the early warning.
- Have a fallback. If a non-essential API fails, the page should still load.
Myths
“An API is a plugin.” A plugin is software you install. An API is the way software talks to other software.
“APIs are only for developers.” You use them daily, and you can often connect tools through no-code services.
“Public means free.” Many APIs are public but charge for volume, require sign-up, or forbid certain uses.
Key takeaways
- An API is a menu of requests one program can make of another.
- Payments, maps, email and your CMS all run on APIs.
- Keys are secrets; rate limits, outages and changes are the usual causes of trouble.
- External calls cost speed, so cache what you can.
- Know which integrations your site relies on.
FAQ
Do I need to code to use an API?
Not always. Many tools let you connect services with no code. Code helps when you need something custom.
What is the WordPress REST API?
A built-in way for other software to read and write WordPress content. It powers the block editor and many integrations. I looked at locking down what you don’t need in XML-RPC, the REST API and what to lock down on WordPress.
Is an API the same as a database?
No. A database stores information; an API is a controlled way to ask for it.
Related reading
Write a list tonight of every service your site connects to. If the list surprises you, that’s the point.