Need the #1 custom application developer in Brisbane?Click here →

What Is an API?

8 min read

API stands for Application Programming Interface. In the context of web development, an API is a defined way for software to communicate. Your front-end calls your back-end API. Your back-end calls payment APIs, email APIs, maps APIs. The software ecosystem is a network of APIs.

The Restaurant Analogy

Think of a restaurant. You're a customer. You don't enter the kitchen. You interact with a waiter. You order (request). The waiter takes your order to the kitchen, the chef prepares food, the waiter brings it back (response). You never know the kitchen's implementation. The waiter is the interface.

APIs work the same way. The client (you) makes a request. The server (kitchen) processes it and returns a response. The implementation is hidden. All that matters is the interface—what requests are valid, what responses you get.

Web APIs: HTTP-Based Communication

Web APIs use HTTP (Hypertext Transfer Protocol). The client sends an HTTP request to a URL. The server processes it and sends an HTTP response. This is the foundation of the web.

A request includes: method (GET, POST, PUT, DELETE), URL (the endpoint), headers (metadata), body (data). A response includes: status code (200 success, 404 not found, 500 error), headers, body (usually JSON data).

GET /api/users retrieves users. POST /api/users creates a user. PUT /api/users/1 updates user 1. DELETE /api/users/1 deletes user 1. This is REST style.

Why APIs Matter in Modern Development

Every application is built on APIs. Your front-end is JavaScript running in the browser. It can't access the database. It communicates with the back-end through APIs. Your back-end calls third-party services through their APIs.

APIs are the fundamental abstraction that enables separation of concerns. Front-end developers build user interfaces. Back-end developers build APIs. DevOps engineers run services. Everyone can work independently because they communicate through well-defined APIs.

API Categories

Public APIs: exposed to external developers. Stripe's payment API, Twitter's API, Google Maps API. Anyone with credentials can call them.

Private APIs: internal only. Your front-end calls your back-end API. Only your team accesses it. No external exposure.

Partner APIs: restricted to specific partners. A payment provider gives you API access to their service. Your integration partner calls your APIs.

API Design Paradigms

REST (Representational State Transfer): resources as URLs, HTTP methods for operations. GET /users, POST /users. Simple, universally understood.

GraphQL: single endpoint, client specifies exactly what data it needs. Prevents over-fetching and under-fetching. More complex but powerful for data-heavy applications.

RPC (Remote Procedure Call): call methods as if they're local. POST /api with body specifying the method and parameters. Less common but used in some ecosystems.

The API Economy

Modern software is built on APIs. Your application is a constellation of services communicating through APIs. Stripe for payments, SendGrid for email, Auth0 for authentication, Slack for team communication, Salesforce for CRM.

The choice to build well-designed APIs—even if internal only—future-proofs your application. As you grow, you might want to expose APIs to partners or customers. If your internal APIs are well-designed, making them public is straightforward.

API Maturity Levels

Level 0: a single HTTP endpoint that takes all requests and returns different responses. Primitive but happens.

Level 1: resources with URLs. GET /users, GET /orders. Better organisation, still basic.

Level 2: resources with HTTP methods. GET, POST, PUT, DELETE. This is standard REST.

Level 3: hypermedia, HATEOAS (links in responses telling you what operations are available next). Rarely implemented fully but the idea is sound.

Designing for Change

APIs are contracts. Clients depend on the structure of requests and responses. Change an API poorly and you break clients. The more external clients depend on your API, the more carefully you must evolve it.

Good API design anticipates change. Use versioning. Deprecate gracefully. Add fields without breaking existing clients. Remove fields only after long deprecation periods.

Tip
Even internal APIs benefit from good design. A well-designed internal API is easier to test, easier for new team members to understand, and ready to become public if the business decides to expose it.
Developer Insight
When building your first API, start simple. REST is the right default. Learn the patterns. Add complexity only when needed. GraphQL is powerful but overhead for simple applications.