APIs & JSON: How Apps Talk
Not everything that consumes your app is a browser. APIs let programs talk to programs โ and building good APIs is one of the most valuable, in-demand skills a developer can have.
So far a browser has been on the other end. But often it's another program - a mobile app, another website, a script. They talk through an API (application programming interface): endpoints that return data (usually JSON) instead of web pages. APIs are how modern software connects, and building good ones is among the most valuable, in-demand skills a developer can have. This session demystifies them.
An API returns data, not pages
An API is like a website for programs: same HTTP requests, but the response is structured data (JSON) instead of HTML meant for human eyes.
GET /api/users/42 -> {
"id": 42,
"name": "Ada",
"books": ["Dune", "Project Hail Mary"]
}REST and good API design
Most web APIs follow a style called REST - a sensible convention for organising endpoints around resources and HTTP methods.
| Request | Means |
|---|---|
| GET /api/books | List all books |
| GET /api/books/7 | Get book #7 |
| POST /api/books | Create a new book |
| DELETE /api/books/7 | Delete book #7 |
Notice the pattern: URLs name resources (books), and the HTTP method says what to do with them. This predictable style - plus returning JSON and sensible status codes - is what makes an API easy for others to use. It's the same routing you learned (larzrouter), just returning data instead of HTML. Good API design is a genuinely valuable, sought-after skill.
How modern software connects
- An API returns data (JSON) for programs, where a website returns pages (HTML) for people.
- JSON is the universal data format APIs speak (you know it from larzjson).
- REST organises endpoints around resources + HTTP methods (GET list, POST create...).
- Building good APIs is one of the most valuable, in-demand developer skills.
๐งฉ Do it with LarzOS
Turn this lesson into action with the exact free tools and AI workflows for the job:
๐ฏ Key takeaways
- APIs let programs talk to programs: same HTTP requests, but responses are data (JSON), not web pages.
- JSON is the universal format APIs speak - simple objects and lists as text (you know it from larzjson).
- REST organises endpoints around resources and HTTP methods (GET to read, POST to create, DELETE to remove).
- Separating data (API) from display lets many clients use one backend - and API design is a highly valuable skill.
Frequently asked
What exactly is an API, and how is it different from a website?
An API (Application Programming Interface) is a way for programs to talk to each other, and in the web context it's essentially a website designed for software instead of for humans. Both a website and a web API work over the same HTTP request-response mechanism - a client sends a request to a URL, the server responds - so the plumbing is identical. The difference is what comes back and who it's for. A website returns HTML: a page structured for a human to look at in a browser, with headings, styling, images, meant for eyes. An API returns data, almost always JSON: structured information (objects and lists) meant for a program to read and use, with no styling or presentation - just the raw facts. For example, a weather website returns a nicely formatted page a person reads, while a weather API returns something like {"temp": 18, "condition": "cloudy"} that a program can pull the numbers out of and do whatever it wants with - display them in a mobile app, put them in a spreadsheet, trigger an alert. This distinction is powerful because separating the data from its presentation means one API can serve many different clients: the same user-data API might feed a website, a mobile app, a smartwatch, and third-party integrations, each displaying the data in its own way. It's why modern software is so interconnected - apps expose APIs so other programs (including other companies' software) can build on their data and functionality. As a developer, you'll both consume APIs (call other services' APIs to get data or functionality - maps, payments, weather, sending email) and build APIs (expose your own app's data and capabilities for other programs, including your own front-end, to use). Think of a website as a restaurant's dining room (a finished experience presented to a human) and an API as its kitchen's takeout window that hands over the raw ingredients or dishes for others to use as they wish. Same underlying kitchen (server and data), different output for a different consumer. Understanding APIs opens up both using the vast ecosystem of existing services and building software that others can connect to - which is central to creating valuable, modern applications.
Why is building APIs considered such a valuable, in-demand skill?
Building good APIs is highly valued because APIs are the connective tissue of modern software, so the ability to design and build them well multiplies what you and others can create - and relatively few people do it excellently. Consider how modern software actually works: almost nothing is an isolated island. Mobile apps talk to servers through APIs; websites increasingly get their data from APIs; companies expose APIs so partners and third-party developers can build on their platforms; services like payments, maps, messaging, and AI are consumed by other apps through APIs; and within a single company, different systems communicate via internal APIs. An API is the interface through which a piece of software's data and capabilities become usable by other software, which means a well-built API turns your work into a building block others can build on - amplifying its value enormously. This is why API skills are in such demand: businesses need developers who can expose their data and functionality cleanly and reliably so their mobile apps work, their partners can integrate, and their systems interconnect. Good API design is also genuinely skilled work - it requires thinking clearly about how to organise resources and endpoints, handling input safely and validating it, returning sensible data and status codes, versioning and evolving the API without breaking the programs that depend on it, handling authentication and rate limits, and documenting it so others can actually use it. Doing all that well is harder than it looks and very valuable, because an API that many programs depend on must be reliable, clear, and stable. There's also leverage: a single well-designed API can power countless clients and integrations, so the impact of building it well is large. For you as a developer aiming to build valuable software, API skills are a high-return investment - they let you build backends that serve web and mobile and third parties alike, integrate the rich ecosystem of existing services into your own products, and create platforms others build on. It's a skill that sits right at the center of how valuable modern software is constructed and connected, which is exactly why it's so sought after. The Larz LARZ-301 course is built to take you into building real APIs, and it's a natural next step toward the most valuable kind of web development.
Related lessons
Handling User Input (Safely)
The moment your app accepts input โ a form, a search box, an API call โ you're taking dataโฆ
Web Development BasicsBuild a Web App: Putting It Together
You now have every piece โ requests, HTML, routing, templates, input, APIs. This is how thโฆ