API Playground

Runs in your browser — use it from Playwright with page.evaluate or by driving this UI; external clients like Postman cannot reach it.

Example: await page.evaluate(() => window.qaMockApi.handle({ method: 'GET', path: '/api/users' }))

1. Endpoints

MethodPathAuthDescription
POSTPublicLog in with {"username":"qa","password":"qa123"} to get a token
GETPublicList users with pagination
GETPublicGet one user (404 if missing)
POSTBearer tokenCreate a user (422 on invalid input)
PUTBearer tokenReplace a user
PATCHBearer tokenUpdate some fields of a user
DELETEBearer tokenDelete a user (204)
GETPublicRespond with any status code 100-599
GETPublicRespond after a delay (max 10000 ms)
GETPublic5 calls per 10 seconds, then 429 with Retry-After

2. Request

3. Response

Send a request to see the response.

About this API Playground page

A mock REST API for testing is a fake web service that returns predictable responses, so you can practice API tests without a real backend. This playground offers endpoints with token auth, selectable status codes, artificial delays and rate limits. Send requests from the browser, Postman, REST Assured, Python requests or Playwright, and assert on status, headers and JSON bodies.

Frequently asked questions

What is a good free API to practice API testing?

Pick one that exposes failure cases, not just happy paths. JSONPlaceholder suits first requests, while this playground adds auth, forced status codes, delays and rate limits, so you can write positive and negative tests. It needs no signup or API key.

How do I test a 429 Too Many Requests response?

Send requests in a loop until the API returns 429, then assert the status and check for a Retry-After header. A good test also waits for the window to reset and confirms the next call succeeds. This playground has a rate-limited endpoint for it.

How do I test a bearer token API?

Request a token, send it in the Authorization header as Bearer <token>, and assert a 200. Then send no token and an invalid one, and assert 401. Test a valid token without permission too, which should return 403.

How do I test slow API responses?

Call an endpoint with an artificial delay and assert the response arrives within your timeout, or that the client times out and shows an error. In Playwright, set the request timeout. In Python requests, pass the timeout argument and expect a Timeout exception.

Which tools can I use against this API?

Any HTTP client works: Postman, curl, REST Assured, Python requests, Playwright's request fixture or Cypress cy.request. The tasks include a pass/fail result box and reference solutions in Playwright, Selenium Java, Selenium Python and Cypress.

Free developer tools on Randomly.online

QA Playground is part of Randomly.online. These tools help while you write and debug tests: