A sample REST API for testing.
Free, public, CORS-enabled. No signup. Point your HTTP client at the URL below and start sending requests.
https://sampleapi.top/api
Base URL — append any path below.
Below: the few examples most people need. In the docs: every endpoint, parameter, header, and error code.
Open docs →
Try a GET request
Append the path to the base URL above. This returns post number 1 as JSON.
https://sampleapi.top/api/posts/1
What you'll get back
{
"id": 1,
"userId": 1,
"title": "...",
"body": "...",
"tags": ["..."],
"createdAt": "2024-01-15T10:00:00Z"
}Try a GET with query parameters
Standard list-style query strings. Pagination, sorting, and search work the way you'd expect.
https://sampleapi.top/api/posts?_limit=5&_sort=id&_order=desc
| Param | Example | Notes |
|---|---|---|
_limit | 5 | Items per page. Max 100. |
_page | 2 | 1-based page number. |
_sort | id | Field to sort on. |
_order | asc / desc | Default asc. |
q | cors | Full-text search. |
Try a POST with a body
Set Content-Type: application/json and send a body. The response echoes your data with a generated id. Writes look real but are not persisted.
Request
| Method | POST |
| URL | https://sampleapi.top/api/posts |
| Header | Content-Type: application/json |
| Body | {"userId": 1, "title": "Hello", "body": "World"} |
Response (HTTP 201)
{
"id": 101,
"userId": 1,
"title": "Hello",
"body": "World",
"createdAt": "2024-01-15T10:00:00Z"
}What else is here
- Resources —
posts,comments,users,todos. All five verbs work. - HTTP echo at
/anything/{path}— mirrors your request back as JSON. - Status codes at
/status/{code}— force any 1xx–5xx response. - Delay at
/delay/{seconds}— up to 5s, for timeout testing. - Bearer auth at
/auth/bearer— demo tokendemo-token.
Didn’t find what you came for?
The full reference covers every endpoint, every query parameter, every response header, and every error code — with example requests.
Need an interactive client or one of the special testing surfaces (echo / forced status / delay / auth)? Use the Advanced menu in the navigation.