Articles

What Is an API? The Contracts That Connect Software

An API is a defined contract that lets one piece of software talk to another. Learn what APIs are, how they work, and why modern software runs on them.

The Lycoris Team The Lycoris Team · · 3 min read
Code braces linking API endpoints

An API — Application Programming Interface — is a defined contract that lets one piece of software talk to another. You can’t see most APIs, but they’re behind almost everything your phone and browser do. Every time an app shows you the current weather, processes a payment, or lets you log in with Google, it’s using an API.

The restaurant analogy

The classic analogy holds up well. Imagine you’re at a restaurant. You don’t walk into the kitchen and cook your food — you interact with a menu and a waiter. The menu lists what’s available. The waiter carries your order to the kitchen and brings back the result. You don’t need to know how the kitchen works; you just need to know how to order.

An API works the same way. Your software (the customer) makes a request using a defined format (the menu). The API (the waiter) takes that request to the service (the kitchen) and returns the result. The internals of the service — its database structure, its programming language, its infrastructure — stay hidden. All that’s exposed is the contract.

The main kinds of APIs

Not all APIs are the same kind of thing:

Web / HTTP APIs are the most visible type. They run over the internet and let different applications — often on different servers — communicate. When you tweet or check a stock price in a third-party app, it’s going through an HTTP API.

Library / SDK APIs are the interfaces exposed by code you import into your project. When you call os.path.join() in Python or Array.prototype.map() in JavaScript, you’re using a library API. The implementation is hidden; you just call the function.

Operating system APIs let applications request services from the OS — opening files, allocating memory, drawing windows, sending network packets. Every programming language runtime uses these under the hood.

This article focuses mostly on web APIs, which are what people usually mean when they say “API” in a startup context.

How a web API call works

A web API call has a few standard parts:

  • Endpoint — the URL that identifies the resource or action you want. For example: https://api.example.com/users/42.
  • Method — what you want to do (fetch data, create something, update it, delete it). REST APIs use HTTP methods like GET, POST, and DELETE.
  • Request — the data you send along, if any. Creating a new user, for instance, requires sending the user’s details.
  • Response — what comes back: a status code indicating success or failure, and usually a JSON body with the actual data.
  • Authentication — most APIs require you to prove who you are. The most common method is an API key: a secret string you include in the request header, like Authorization: Bearer sk-abc123....

A simple request to fetch a user might look like this:

GET /users/42 HTTP/1.1
Host: api.example.com
Authorization: Bearer sk-abc123...

And the response:

{
  "id": 42,
  "name": "Jordan Lee",
  "email": "jordan@example.com"
}

Why APIs power modern software

A few things made APIs the backbone of modern software:

Integration. Without APIs, every app would have to rebuild every capability from scratch. With APIs, you add Stripe for payments, Twilio for SMS, SendGrid for email — each one a specialist service with a well-documented interface.

Platforms and ecosystems. When companies open their APIs publicly, third parties can build on top of them. The App Store, Shopify’s plugin ecosystem, and every browser extension all depend on published APIs.

Separation of concerns. A front-end web app and a mobile app can both call the same back-end API. The UI and the data layer evolve independently.

The web’s two dominant API styles are REST — resource-oriented and built on HTTP conventions — and GraphQL, which lets clients request exactly the data they need in a single query. Newer patterns like the Model Context Protocol extend the idea further, letting AI models call tools and services through a standardized interface.

Takeaway

An API is a contract: a defined way for software to ask another piece of software to do something. Web APIs run over HTTP, accept requests at specific endpoints, require authentication, and return structured data — usually JSON. They’re how modern applications stay small and focused while still doing an enormous amount.

Takina Takina · · 4 min read

What Is a Webhook? Event-Driven HTTP, Explained

A webhook is an HTTP callback that notifies your server the moment something happens — no polling. How webhooks work and how to use them safely.

#API #Web Development #Developer Tools
Takina Takina · · 4 min read

What Is a Lockfile? Reproducible Dependency Installs

A lockfile records the exact dependency versions your package manager resolved, so every install — from your laptop to CI — reproduces the same tree.

#JavaScript #Web Development #Developer Tools
Takina Takina · · 4 min read

JavaScript Intl API: Formatting Dates and Numbers

The Intl API formats dates, numbers, and currency using a user's locale without a library. How Intl.DateTimeFormat and Intl.NumberFormat work.

#JavaScript #Web Development #Developer Tools