What Is an API?
APIs are how machines talk to each other. Master this and you can connect anything to anything — the foundation of every automation you will ever build.
The Request / Response Cycle
Every API interaction follows one pattern: your code sends a request, the server processes it, and sends back a response.
What a Real API Request Looks Like
Here is an actual API request to get a list of users. Every part is labeled:
GET https://api.example.com/users?limit=10
Authorization: Bearer sk_live_abc123...
Content-Type: application/json
Accept: application/json
GET — what you want to do (read, create, update, delete)
?limit=10 is a query parameter — filters the results.
Authorization proves who you are. Content-Type says what format you are using.
HTTP Methods
There are four core HTTP methods. Each tells the server what operation to perform:
GET /users returns a list of users. Safe and idempotent.
POST /orders with {"product": "Pro Plan"} creates a new order. Returns 201 Created.
PUT /users/42 with updated fields replaces that user's data. Idempotent — same result if called multiple times.
DELETE /users/42 removes the user with id 42. Usually returns 200 OK or 204 No Content.
Try It: cURL Examples
cURL is the universal command-line tool for making API requests. These are real commands you can run in your terminal:
curl https://jsonplaceholder.typicode.com/users
# POST — Create a new post (with JSON body)
curl -X POST https://jsonplaceholder.typicode.com/posts \
-H "Content-Type: application/json" \
-d '{"title": "My Post", "body": "Hello world"}'
# DELETE — Remove a post
curl -X DELETE https://jsonplaceholder.typicode.com/posts/1
jsonplaceholder.typicode.com is a free fake API for learning. The data is not real, but the requests and responses work exactly like a production API. Try these in your terminal right now.
This lesson is for Pro members
Unlock all 520+ lessons across 52 courses with Academy Pro.
Already a member? Sign in to access your lessons.