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
ParamExampleNotes
_limit5Items per page. Max 100.
_page21-based page number.
_sortidField to sort on.
_orderasc / descDefault asc.
qcorsFull-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

MethodPOST
URLhttps://sampleapi.top/api/posts
HeaderContent-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

  • Resourcesposts, 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 token demo-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.

Read the docs →

Need an interactive client or one of the special testing surfaces (echo / forced status / delay / auth)? Use the Advanced menu in the navigation.