Back to blog
Test Automation#api-automation#demo#rest#postman
Best Free API Testing Demo Sites
A curated list of the best free API testing demo endpoints for practicing REST API automation with Postman, REST Assured, and more.
December 25, 2022InnovateBits
Learning API testing requires practicing against real endpoints. Here's a curated list of free APIs that are specifically designed for testing purposes.
Why use dedicated test APIs?
- No rate limits that matter — practice as much as you want
- Known data — predictable responses you can assert against
- Safe to experiment — create, update, delete without consequences
- Good documentation — understand what to expect
The essential list
| API | URL | Best for |
|---|---|---|
| Restful Booker | https://restful-booker.herokuapp.com/apidoc/index.html | CRUD operations, auth tokens |
| ReqRes | https://reqres.in/ | User management, pagination |
| httpbin | http://httpbin.org/ | HTTP method testing, headers |
| JSON Placeholder | https://jsonplaceholder.typicode.com/ | Posts, users, todos |
| Swagger Petstore | https://petstore.swagger.io/ | OpenAPI spec-based testing |
| FakeRESTAPI | https://fakerestapi.azurewebsites.net/ | Activities, authors, books |
Deep dive: Restful Booker
This is my go-to for teaching API automation. It covers:
POST /auth → Get authentication token
GET /bookings → List all bookings
POST /booking → Create new booking
GET /booking/{id} → Get specific booking
PUT /booking/{id} → Full update (requires auth)
PATCH /booking/{id} → Partial update (requires auth)
DELETE /booking/{id} → Delete booking (requires auth)
Playwright API test example
import { test, expect, request } from '@playwright/test';
const BASE_URL = 'https://restful-booker.herokuapp.com';
test.describe('Booking API', () => {
let authToken: string;
let bookingId: number;
test.beforeAll(async () => {
const context = await request.newContext();
const response = await context.post(`${BASE_URL}/auth`, {
data: { username: 'admin', password: 'password123' },
});
const body = await response.json();
authToken = body.token;
});
test('create a new booking', async ({ request }) => {
const response = await request.post(`${BASE_URL}/booking`, {
data: {
firstname: 'John',
lastname: 'Doe',
totalprice: 250,
depositpaid: true,
bookingdates: {
checkin: '2025-01-01',
checkout: '2025-01-07',
},
additionalneeds: 'Breakfast',
},
});
expect(response.status()).toBe(200);
const booking = await response.json();
bookingId = booking.bookingid;
expect(booking.booking.firstname).toBe('John');
expect(booking.booking.totalprice).toBe(250);
});
test('update booking requires authentication', async ({ request }) => {
const response = await request.patch(`${BASE_URL}/booking/${bookingId}`, {
headers: { Cookie: `token=${authToken}` },
data: { firstname: 'Jane' },
});
expect(response.status()).toBe(200);
const updated = await response.json();
expect(updated.firstname).toBe('Jane');
});
});JSON Placeholder for quick prototyping
Great for when you just need a quick endpoint:
# Get all posts
GET https://jsonplaceholder.typicode.com/posts
# Get specific post
GET https://jsonplaceholder.typicode.com/posts/1
# Get user's posts
GET https://jsonplaceholder.typicode.com/users/1/posts
# Create a post (fake - doesn't persist)
POST https://jsonplaceholder.typicode.com/posts
Body: { "title": "foo", "body": "bar", "userId": 1 }More API resources
For a broader collection of free public APIs (not just for testing):
- apipheny.io/free-api — comprehensive list
Missing a good API testing resource? Let me know on LinkedIn!