apyhub
Cover illustration for Getting Started with APIs: A Beginner’s Guide 2026
Tutorials

Getting Started with APIs: A Beginner’s Guide 2026

01Introduction

If you're new to software development or curious about how modern applications connect and share data, learning to use APIs (Application Programming Interfaces) is essential. APIs power everything from social media integrations to weather apps, letting different software systems talk to each other.

Many public APIs and free APIs are available to anyone, so you can experiment and build real projects without spending anything.

This guide teaches the concepts, then gives you somewhere to practise each one. Work through it with a terminal open and you'll have made a dozen real API calls by the end.

02What Is an API?

An API acts like a bridge between software applications. When you request information, say today's exchange rate, an API takes your request, fetches the data from a server, and sends it back to your app.

The useful mental model is a restaurant. You don't walk into the kitchen. You tell the waiter what you want, in a format they understand, and food arrives. You never need to know how the kitchen works. The API is the waiter. The documentation is the menu.

Public APIs, sometimes called open APIs, are available openly, often with a free plan. They let you use functionality that would take months to build: converting a document, reading text out of a scanned image, checking whether an email address is real.

Prefer video? freeCodeCamp's APIs for Beginners, taught by Craig Dennis, is three hours and genuinely excellent. It's chaptered, so you can jump around: what an API is at 8:49, how the web works at 18:17, using an API from the command line at 45:01, and curl at 56:20. Watch the first 30 minutes, then come back here.

03What Is a REST API?

Most APIs you'll meet are REST APIs. REST is a style, not a technology, and it has three defining ideas.

Everything is a resource with a URL. A user, an order, a document. Each has an address.

You act on resources with standard HTTP methods:

MethodWhat it doesExample
GETRetrieve dataFetch a user's profile
POSTSend new dataCreate an order
PUTReplace something entirelyUpdate a whole profile
PATCHUpdate part of somethingChange just the email field
DELETERemove somethingDelete an order

Every request stands alone. REST is stateless: each request carries everything the server needs, and the server remembers nothing about you between calls. This is why you send your credentials every single time instead of logging in once.

That last point trips people up, so sit with it. There is no session. Each call is independent. It's also why REST scales so well, since any server can handle any request.

Try it now. Send your first GET request with no signup at all. Paste this in a terminal: curl https://jsonplaceholder.typicode.com/posts/1 You just called an API.

04Endpoints, Requests, and Responses

An endpoint is the URL where the API listens. It usually describes what it does:

https://api.example.com/v1/users/42 https://api.example.com/v1/convert/word-to-pdf

A request has up to four parts:

  • The method (GET, POST, and so on)
  • The URL
  • Headers, carrying metadata like your API key and the content type
  • A body, usually JSON, for POST and PUT requests

A response has three: a status code, headers, and usually a JSON body.

Try it now. Practise a POST, which is the method beginners use least and need most. JSONPlaceholder accepts fake ones: curl -X POST https://jsonplaceholder.typicode.com/posts -H "Content-Type: application/json" -d '{"title":"hello","body":"my first POST","userId":1}' Note the two new things: -X POST sets the method, and -d sends the body. Change the JSON and send it again.

05JSON in Two Minutes

JSON (JavaScript Object Notation) is how APIs almost always exchange data. It's built from two structures.

An object, in curly braces, holds named fields:

json

{ "name": "Ada", "age": 36, "active": true }

An array, in square brackets, holds an ordered list:

json

{ "users": [ { "name": "Ada" }, { "name": "Grace" } ] }

Values can be strings, numbers, booleans, null, arrays, or more objects. Objects nest inside objects, which is where beginners get lost. data.results[0].address.city just means: in data, find results, take the first item, find its address, read the city.

That's the entire format. Ten minutes of practice and you'll never think about it again.

06Status Codes

The number that comes back tells you what happened before you read a single byte of the body.

CodeMeaningWhat to do
200SuccessRead the response
201CreatedYour POST worked
400Bad requestYour JSON or parameters are wrong
401UnauthorizedYour key is missing or invalid
403ForbiddenValid key, but not allowed to do this
404Not foundWrong URL, or the thing doesn't exist
429Too many requestsYou're calling too fast
500Server errorTheir problem, not yours

The grouping beats memorising: 2xx worked, 4xx you erred, 5xx they erred.

Try it now. Trigger a 404 deliberately, so you recognise it later: curl -i https://jsonplaceholder.typicode.com/posts/99999 The -i flag shows response headers, including the status line. Getting comfortable causing errors on purpose is one of the fastest ways to learn.

07Rate Limits

Almost every API limits how fast you can call it. Cross the line and you get a 429.

The wrong reaction is to retry immediately in a loop, which makes it worse and can get you blocked. The right one is exponential backoff: wait one second, retry, then two, then four, then eight. Every serious API client does this, and writing it once teaches you more about production code than most tutorials.

08Authentication

APIs need to know who's calling. Three common patterns:

API key. A long string sent with each request, usually in a header. Simplest and most common.

Bearer token. Similar, sent as Authorization: Bearer <token>. Often short-lived.

OAuth. Used when an API acts on behalf of a user, like posting to their social account. More involved, and not where you should start.

Three rules, whichever you use:

  1. Never commit a key to a repository. Public or private. Use environment variables.
  2. Never put a key in frontend code. Anyone can read it in the browser.
  3. If a key leaks, revoke it immediately and issue a new one.

Try it now. You can't practise authentication on a no-key API, so you need one that issues keys. ApyHub's free plan takes no credit card and gives you one token that works across its whole catalog, so you can practise on several different endpoints without repeating the signup. Start with Domain Availability: send a domain, get back whether it's free. Simple enough that if it fails, the problem is your header, which is exactly what you're practising.

09Synchronous and Asynchronous APIs

Here's something most beginner guides skip entirely, and then you meet it in the wild and get confused.

A synchronous API answers inside the request. You send, you wait a moment, you get your answer. Most APIs work this way.

Broken Link Checker is synchronous. Send a URL, get back the dead links.

An asynchronous API, often called a job API, can't answer that fast. Converting a 400MB video takes minutes, and no sensible API holds a connection open that long. So it splits into two steps:

  1. You submit the work. The API immediately returns a job ID.
  2. You poll a status endpoint with that ID until the status says finished, then collect the result.

Convert Video Formats works this way. The submit call returns a job_id, and you check a status endpoint until it reports successful and hands you a URL for the converted file. The docs tell you to poll at most once a second, since polling faster burns your rate limit without finishing the job any sooner.

Notice that each individual call is still stateless. The submit carries its own input. Each poll carries its own job ID. The state lives in a job you can address, not in a connection you have to hold open.

You'll meet this pattern everywhere: video processing, large exports, AI batch work, site crawls. Backlink analysis and website audits are job-based too. ApyHub labels every service sync or job on its listing, which is worth checking before you integrate anything, because the two require completely different code.

10How to Read API Documentation

Reading docs is the skill nobody teaches. When you open a new API's documentation, look for four things in this order:

  1. Authentication. How do I identify myself? Nothing works until this does.
  2. The endpoint you need, its exact URL and method.
  3. Required parameters. What must I send, in what format, and what's optional?
  4. A response example. What comes back, so you know what to parse.

Everything else is detail you can return to. If the docs include a working curl example, paste it into a terminal before writing any code. Seeing a real response first saves hours.

11Where to Practise

You learn this by making real calls. Different APIs teach different things.

Start with no signup at all. JSONPlaceholder serves fake posts, users, and comments, and accepts POST, PUT, and DELETE. It's the best possible first API because nothing can go wrong.

Then real data, still no key. Open-Meteo for weather forecasts, REST Countries for country data, PokéAPI if you want something fun, and Open Library for books. All free, all no-auth, all with real messy data.

Then authentication. For this you need an API that issues keys. ApyHub works well for practice: no credit card, and one key across the whole catalog, so you can try a file conversion, an email validator, and an OCR endpoint without three separate signups. Each service page has a playground where you send a real request from the browser first.

Worth being straight about the limit: the free plan is 1,000 atoms a month, and most endpoints cost 1 atom per call, so that's roughly 1,000 calls. Heavier endpoints cost more. It's a learning budget, not a production one.

For sending requests without writing code, use Postman, Insomnia, Bruno, or Voiden. And curl is already on your machine.

12Build Five Things

Reading about APIs teaches almost nothing. Each of these takes an evening and teaches something the others don't.

1. A weather dashboard. Fetch a forecast and display it. Teaches GET requests, query parameters, and parsing nested JSON. Use Open-Meteo, no key.

2. A country quiz. Pull country data, build a guessing game. Teaches arrays, filtering, and picking fields out of large responses. Use REST Countries, no key.

3. A signup form that actually validates. Check an email is real and not disposable before saving it. Teaches authentication, POST bodies, and using a response to branch your logic. Try Advanced Email Verification.

4. A document converter. Upload a Word file, get a PDF back. Teaches file uploads and handling binary responses instead of JSON. Try the file conversion APIs.

5. A receipt scanner. Photograph a receipt, get back merchant, date, and total as structured data. Teaches AI endpoints and dealing with results that aren't always right. Try the AI catalog.

The first two need no account. The last three need a key, which is the point: authentication is a skill and you only learn it by doing it.

13When Things Break

They will. Check four things, in order:

  1. Read the status code first. It tells you which of the next three to look at.
  2. Print the entire response body. APIs almost always explain what went wrong. Beginners print the status, miss the message, and stay stuck for an hour.
  3. Check your headers. A missing Content-Type: application/json on a POST is the most common silent failure in existence.
  4. Reproduce it in curl. If curl works and your code doesn't, the bug is yours.

14How AI Agents Use APIs

This section didn't exist when we first published this guide. It's part of the basics now.

An AI agent is a program that uses a language model to decide what to do, then does it by calling tools. Those tools are usually APIs. When an agent converts a file or looks something up, it's making the same kind of call you've been practising.

The difference is timing. You choose which API to call while writing code. An agent chooses at runtime, every time. The standard that makes this work is MCP (Model Context Protocol), which lets an agent connect to a set of tools and understand what each does without anyone hand-writing a wrapper.

This has a practical consequence for you. The thing calling your API may be software rather than a person, and software can't ask a colleague what a cryptic 400 means. Clear error messages and accurate descriptions matter more than they used to.

Going deeper: How AI Agents Use APIs: A Beginner's Guide.

15Where to Get Help and Keep Learning

Reddit is where most beginner API questions actually get answered these days:

For staying current, daily.dev aggregates developer news into a feed you can actually keep up with, and it's the easiest way to see what's changing without doomscrolling. DEV Community and Hashnode publish a steady stream of practical write-ups, often by people one step ahead of you, which is frequently more useful than expert content. Lobsters and Hacker News skew more advanced but the comment threads teach a lot.

For structured learning, the freeCodeCamp YouTube channel and freeCodeCamp News publish full courses for free, and MDN's HTTP documentation is the reference to keep open in a tab.

Stack Overflow still holds an enormous archive worth searching, though it's a harder place to ask a beginner question than it used to be. Search it. Ask elsewhere.

When you do ask for help anywhere, include the request you sent, the response you got, and what you expected. Questions with those three things get answered fast. Questions without them usually don't get answered at all.

16Final Thoughts

APIs are the building blocks of modern applications, and free tiers mean anyone can start without a budget.

The loop never changes: read the docs, send a real request, look at what comes back, fix what's wrong, build something small. Do that five times and APIs stop being a topic you're studying and become a tool you reach for.

You can start in the next sixty seconds, with no account, by pasting that first curl command into a terminal.

17FAQ: Getting Started with APIs

1. What is an API? An API (Application Programming Interface) lets different software systems communicate. It acts as a messenger: when your app needs data, the API retrieves it from a server and sends it back.

2. What are public or free APIs? Public or open APIs are available to anyone, often at no cost. They come with documentation and free usage limits, which makes them good for learning, testing, and small projects.

3. What is a REST API? A REST API uses standard HTTP methods like GET, POST, PUT, and DELETE to work with resources identified by URLs. REST is popular because it's simple, flexible, and supported everywhere.

4. What does it mean that REST is stateless? Each request contains everything the server needs, and the server keeps nothing about you between calls. That's why you send credentials with every request rather than logging in once, and it's why REST scales well: any server can handle any request.

5. What's the difference between GET and POST? GET retrieves data and puts its parameters in the URL. POST sends data in a request body and typically creates something. GET requests can be cached and bookmarked; POST requests shouldn't be blindly repeated.

6. What is the difference between a synchronous and an asynchronous API? A synchronous API answers inside the request, usually in under a second. An asynchronous or job API handles work that takes longer: you submit, receive a job ID, then poll a status endpoint until it finishes. Video conversion, large exports, and site crawls are typically job-based.

7. Which free APIs need no API key at all? JSONPlaceholder for fake practice data, Open-Meteo for weather, REST Countries for country data, Open Library for books, and PokéAPI. All work with a plain GET and no signup.

8. Where can I practise authentication? You need an API that issues keys. ApyHub's free plan requires no credit card and gives one key covering its whole catalog, so you can practise across several kinds of endpoint without signing up repeatedly. The allowance is 1,000 atoms a month, which is a learning budget rather than a production one.

9. How do I test an API without writing code? Use Postman, Insomnia, Bruno, or Voiden to compose requests and inspect responses. curl works from any terminal, and many API docs include a ready-made curl command you can paste.

10. What is an API key and how do I keep it safe? An API key identifies you to the service. Never commit one to a repository, never put one in frontend code, and use environment variables. If a key leaks, revoke it and issue a new one.

11. Why did my API call return 401 or 429? 401 means your key is missing, wrong, or not authorised for that endpoint. 429 means you're calling faster than allowed. Fix 429 with exponential backoff: wait, retry, and double the wait each time rather than retrying immediately.

12. What should I do when an API call fails? Read the status code, then print the full response body, since APIs usually explain the problem there. Check your headers, especially Content-Type on POST requests. Then reproduce the call in curl to work out whether the bug is in your code or the API.

13. What's the best YouTube video for learning APIs? freeCodeCamp's "APIs for Beginners" by Craig Dennis is a three-hour free course covering what APIs are, how the web works, using APIs from the command line, curl, and building a project. It's chaptered, so you can watch the first half hour and come back later.

14. Where should I ask beginner API questions? Reddit's r/learnprogramming and r/webdev are the most responsive places for beginners, alongside language-specific subreddits like r/learnpython and r/node. daily.dev and DEV Community are good for staying current. Stack Overflow's archive is worth searching even if asking there is harder than it was.

15. What is MCP and do beginners need to know about it? MCP (Model Context Protocol) is a standard that lets AI agents discover and call APIs in a machine-readable way. You don't need it to learn API basics, but it's worth knowing that agents are now a common consumer of APIs alongside human developers.

16. Do I need programming experience to start using APIs? No. Understanding how to send a request and read a response is enough, especially if you start in a testing tool or with curl rather than in code.

17. What's the best way to get comfortable with APIs? Practice. Read documentation, send real calls, look at the responses, deliberately cause errors so you recognise them, and build small projects. The more you experiment, the faster it becomes obvious how APIs fit together.

18About ApyHub

ApyHub is a curated API catalog for developers, teams, and AI agents, covering file conversion, data validation, AI, extraction, geolocation, SEO, and more. One subscription covers the whole catalog, billed in atoms, with headroom pooled across every API rather than locked to individual services.

Every service carries machine-readable certification covering data handling, retention, and standards alignment including GDPR, SOC 2, and ISO 27001. Every endpoint is MCP-ready by default.

ApyHub is headquartered in Amsterdam, with offices in the Netherlands, Greece, and India. The catalog holds 450+ services and 1,500+ endpoints, with new APIs and providers onboarded continuously. The free tier requires no credit card.