Documentation

Every endpoint and parameter on one page. Use Ctrl+F.

https://sampleapi.top/api

Basics

Base URLhttps://sampleapi.top/api
TransportHTTPS
Response typeapplication/json; charset=utf-8
AuthNone, except /auth/bearer (demo token demo-token).
CORSWildcard origin, all standard methods, preflight cached 24h.
Max body1,048,576 bytes
Rate limit~120 requests / 60s per IP. Over → 429 with Retry-After.

Methods

MethodEffectWhere
GETReadAll endpoints
POSTSimulated create (returns generated id)Resource collections, echo, status
PUTSimulated full replaceResource items, echo, status
PATCHSimulated partial mergeResource items, echo, status
DELETESimulated deleteResource items, echo, status
HEADSame as GET, no bodyAny GET route
OPTIONSCORS preflight (204)Every endpoint

Writes never persist. Every user always sees the same baseline data.

Resources

Four resources with relations, filtering, sorting, and pagination.

PathDescription
/postsList, paginate, search, filter by userId.
/posts/{id}Single post.
/posts/{id}/commentsComments for a post.
/commentsList, filter by postId / email.
/comments/{id}Single comment.
/usersList of users.
/users/{id}Single user.
/users/{id}/postsPosts authored by user.
/users/{id}/todosTodos belonging to user.
/todosList, filter by userId / completed.
/todos/{id}Single todo.

Each path accepts GET, POST (collections) or PUT/PATCH/DELETE (items). Full reference at Advanced → Fake REST.

Query parameters (list endpoints)

ParamDefaultNotes
_page11-based.
_limit30Max 100.
_sortAny field name.
_orderascasc or desc.
qSubstring match across the resource's searchable fields.
userId, postId, completed, …Exact-match filter where supported.

Pagination response headers

X-Total-CountTotal items matching the query, before pagination.
X-PageCurrent page.
X-LimitItems per page actually used.

Other endpoints

EndpointPurposeReference
/anything/{path}Mirror request back as JSONEcho
/get, /post, /put, /patch, /deleteMethod-specific echoEcho
/headers, /ip, /user-agentSingle-field echo helpersEcho
/status/{code}Return any HTTP status 100-599Status
/delay/{seconds}Delay 0–5s before respondingStatus
/auth/bearerBearer token test (200/401/403)Auth
/uuid, /timeUUIDv4, server time
/hashmd5/sha1/sha256/crc32 of request body
/json-statsStats about a JSON body's shape
/validate/postValidate a post payload (422 on errors)

Errors

All error responses share this shape:

{
  "error": true,
  "status": 404,
  "message": "Post not found."
}
StatusWhen
400Invalid JSON, or a parameter is out of range.
401Missing Authorization on /auth/bearer.
403Wrong bearer token.
404Unknown route or item id.
405Method not allowed on that path (sends Allow).
413Body exceeded 1,048,576 bytes.
422Validation failed (with per-field errors map).
429Rate limited. Honor Retry-After.
500Unexpected.

Machine-readable specs

For client generators and import into your HTTP client of choice: