toolrota

What is an API? What it does, how it works and everyday examples

Where does a weather app get its data and how does "Sign in with Google" work? The answer is an API. Explained without technical jargon.

Serkan Akyürek·Updated ·5 min read
What is an API? What it does, how it works and everyday examples – SaaS & Cloud

An API (Application Programming Interface) is an interface that lets one piece of software talk to another within set rules.

The restaurant analogy

In a restaurant you sit at a table (you = the app), and the kitchen is the system doing the work and holding the data. The waiter (the API) takes your order to the kitchen and brings the food back. You don't have to enter the kitchen; you only ask for options on the menu.

Everyday examples

  • A weather app: gets its data from a weather service's API.
  • "Sign in with Google": the site verifies your identity through Google's API.
  • Embedded maps: the map on a website is shown through a map service's API.
  • Online payment: the shop asks the payment provider's API for a card transaction.
  • Parcel tracking: an e-commerce site pulls status from the carrier's API.
  • Automation tools: tools like Zapier and Make connect apps through APIs (see our automation guide).
  • AI applications: many apps call an AI model's API.

How does it work?

  1. The app sends a request: "Give me today's weather".
  2. The API receives it, checks authorisation and does the job.
  3. The API returns a response, usually in JSON.

A common type is the REST API, which works with requests to web addresses (URLs). The basic request types:

MethodMeaning
GETRead data
POSTCreate new data
PUT/PATCHUpdate data
DELETEDelete data

What is an API key?

Most APIs ask for an API key (a long secret code) to know who is using it and to limit usage. A key is like a password.

Security

  • Don't put API keys in public places: not in the website code visible in the browser, nor in public repositories.
  • Rotate the key immediately if you lose or leak it.
  • Give a key only the permissions it needs.
  • Monitor usage and spend; leaked keys inflate bills (see our cloud cost guide).
  • When sending personal data to third-party APIs, read the privacy terms (GDPR).

Why you should know about APIs

Even if you're not technical, APIs let many SaaS tools you use connect to one another. A tool offering "integrations" or "API access" means you can connect it to automation and other tools (see our SaaS guide).

No-code use

Using an API directly can require code, but no-code tools let you make API calls through a visual interface (see our no-code tools guide). AI assistants can also help write simple API call examples; take care to understand the code before running it.

Step-by-step example: a first request to a weather API (conceptual, for non-coders)

  1. Find the API documentation: the service's "API documentation" page tells which endpoints (addresses), which parameters (city, unit) and which authentication (API key) there are.
  2. Get a key: open an account with the service and create an API key; store the key like a password.
  3. A request example: most APIs are called by adding parameters to a web address. Example structure: https://api.example.com/weather?city=London&key=XXXX.
  4. Read the response: the response is usually in JSON format: {"city":"London","temperature":18}.
  5. Look at error codes: 200 success, 400 bad request, 401 unauthorised, 404 not found, 429 too many requests, 500 server error.
  6. Use it: pass the response to a table, an app or an automation.

These requests can also be made by no-code tools (the "HTTP request" step of automation tools) (see our automation tools and no-code guides).

API types and common formats

ConceptMeaning
REST APIA common type that works with web addresses and standard methods (GET, POST, PUT, DELETE)
JSONThe format in which data is written as name–value pairs
WebhookThe service itself sending a notification to your address when an event occurs
API keyA secret code identifying your application
Rate limitThe number of requests allowed in a given time
OAuthThe standard for granting authority without sharing a password

Security rules

  • Don't put the API key in code, screenshots or public repositories; keep it in secret fields.
  • Grant only the permissions needed (least privilege).
  • Revoke and renew a leaked key at once.
  • Use HTTPS and validate incoming data (see our SSL and HTTPS guide).
  • Watch rate limits and cost; set a budget alert against surprise bills (see our serverless and cloud cost guides).

Frequently asked questions

What is the difference between an API and a website? A website is an interface designed for people, an API for software.

Are APIs paid? Most offer a free usage allowance and charge beyond it; scope and prices change, look at current pages.

How do I offer my own API? Endpoints are defined with a server application or serverless functions (see our serverless guide); authentication and limits are a must.

Do we use AI services through an API? Yes; many applications connect to AI models through an API; mind data privacy (see our AI and privacy guide).

What happens if the API changes? Providers use version numbers; old versions are supported for a while; follow announcements.

Summary

An API is the bridge between applications. Keep the waiter analogy in mind: you state the request, the API checks permission, passes the job to the kitchen and brings back the result.

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.