Postman can actually run API requests locally, without needing any external server to be running.
Let’s get Postman installed and then make your very first API call.
Installing Postman
First, grab the latest version of Postman from their official website: https://www.postman.com/downloads/
Download the installer for your operating system (Windows, macOS, or Linux) and run it. The installation process is straightforward, typically just a few clicks.
Once installed, launch Postman. You’ll be greeted with a welcome screen. You can choose to sign up or log in, but for now, you can skip this and click "Skip and go to the app."
Your First API Test: A Simple GET Request
We’re going to make a request to a public API that doesn’t require any authentication or complex setup. A great one for this is https://jsonplaceholder.typicode.com/, a fake online REST API for testing and prototyping.
-
Create a New Request: In the Postman app, click the
+button next to the tabs at the top to open a new request tab. -
Set the HTTP Method: In the dropdown menu to the left of the URL bar, select
GET. This is the most common method for retrieving data. -
Enter the Request URL: In the URL bar, type
https://jsonplaceholder.typicode.com/posts/1. This URL will fetch the first post from the fake API. -
Send the Request: Click the blue
Sendbutton to the right of the URL bar.
Understanding the Response
After clicking Send, Postman will display the API’s response in the lower pane. You should see something like this:
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
Let’s break down what you’re seeing:
- Status Code: Above the response body, you’ll see a status code. For a successful
GETrequest, this is typically200 OK. This means the server understood your request and sent back the data. - Response Body: This is the actual data returned by the API, formatted in JSON (JavaScript Object Notation) here. It contains the details of the post with ID
1. - Response Time: Postman also shows how long the request took to complete, which is useful for performance monitoring.
- Response Size: It indicates the size of the data received.
Exploring Further: Different HTTP Methods
Postman isn’t just for GET requests. Let’s try another common method: POST.
- New Request: Open a new request tab (
+). - Set Method to POST: Change the dropdown to
POST. - Enter URL: Use
https://jsonplaceholder.typicode.com/posts. This endpoint is for creating new posts. - Add Request Body:
- Go to the
Bodytab below the URL bar. - Select the
rawradio button. - In the dropdown to the right of
raw, chooseJSON. - In the text area that appears, enter the data you want to send to create a new post. For example:
{ "title": "My New Post", "body": "This is the content of my post.", "userId": 1 }
- Go to the
- Send: Click
Send.
You should get a response like this, indicating the new post was "created" (on this fake API, it just returns the data you sent with a new id):
{
"title": "My New Post",
"body": "This is the content of my post.",
"userId": 1,
"id": 101
}
The 201 Created status code is typical for successful POST requests that result in resource creation.
Organizing Your Work: Collections
As you test more APIs, you’ll want to organize your requests. Postman uses Collections for this.
- Create a Collection: On the left-hand sidebar, click the
+ Newbutton and selectCollection. - Name It: Give your collection a name, like "My First API Tests".
- Save Your Requests:
- Go back to your
GET /posts/1request tab. - Click the
Savebutton next toSend. - In the modal that pops up, select your "My First API Tests" collection and click
Save. - Do the same for your
POST /postsrequest.
- Go back to your
Now, you can expand your collection in the sidebar to see and re-run your saved requests.
The Power of Variables (A Glimpse)
While not strictly "getting started," it’s worth knowing that Postman allows you to use variables. Instead of hardcoding https://jsonplaceholder.typicode.com, you could define a variable like {{baseUrl}} and set it to that URL. Then, your request URL would simply be {{baseUrl}}/posts/1. This makes it incredibly easy to switch environments (e.g., from development to staging to production) by just changing the variable’s value, rather than editing every single request.
You’ve now installed Postman, made your first API calls using GET and POST, understood the basic response components, and learned how to organize your work with collections. The next step is often to explore more complex API interactions, like handling different response formats or setting up authentication.