API reference
testingapis.com is a free API for testing HTTP clients. It has 360 endpoints in 53 groups: realistic resources such as products, books and countries, plus endpoints for status codes, redirects, cookies, caching, authentication schemes, file formats, streaming and failure injection. Echo, HTTP methods, status codes, and the products, posts and todos resources need no account. The rest need a free account: send its API key in the X-TestingApis-Key header.
https://api.testingapis.comfetch('https://api.testingapis.com/api/Products?limit=3')
.then(res => res.json())
.then(data => console.log(data))Discovery
| What | Where |
|---|---|
| OpenAPI 3.0 document | https://api.testingapis.com/openapi/v1.jsonSign in to see |
| Swagger UI | https://api.testingapis.com/swagger/index.htmlSign in to see |
| Live route catalog | GET https://api.testingapis.com/apiSign in to see |
| Health checks | GET https://api.testingapis.com/api/healthGET https://api.testingapis.com/api/health/liveGET https://api.testingapis.com/api/health/ready |
| GraphQL | |
| WebSockets | wss://api.testingapis.com/ws/echowss://api.testingapis.com/ws/ticker |
Authentication
Endpoints without an authentication note are public. The endpoints that test authentication accept the fixed test credentials below. They are not secret.
| Scheme | How to send it | Test values | Used by |
|---|---|---|---|
| HTTP Basic | Authorization: Basic base64(user:pass) | apibee / password123 · Admin / Admin@1234 (original API) | /api/auth/basic*, /api/AuthTest/secure-data |
| Bearer (static) | Authorization: Bearer <token> | apibee-token-123 · admin-token · user-token · readonly-token | /api/auth/bearer, /api/auth/roles/* |
| JWT | Authorization: Bearer <jwt> | POST /api/auth/jwt/login with admin / admin123 or user / user123 · POST /api/User/Login with Michael / Thompson | /api/auth/jwt/me, /api/auth/jwt/admin, /api/Admin/authorize |
| API key | X-API-Key header, ?api_key= or api_key cookie | apibee-key-123 | /api/auth/api-key/* |
| OAuth 2.0 | Authorization: Bearer <access_token> | Clients apibee-client / apibee-secret and apibee-public (PKCE) · users apibee / password123, jane / jane123 | /api/auth/oauth/protected, /userinfo |
| OAuth 1.0a | Authorization: OAuth oauth_consumer_key="…", oauth_signature="…", … | Consumer apibee-consumer-key / apibee-consumer-secret · token apibee-access-token / apibee-token-secret (never expires) · HMAC-SHA1, HMAC-SHA256, HMAC-SHA512 or PLAINTEXT | /api/auth/oauth1, /api/auth/oauth1/* |
| Digest | RFC 7616 challenge and response | apibee / password123 | /api/auth/digest |
| HMAC signature | X-Timestamp and X-Signature headers | Secret apibee-hmac-secret | /api/auth/hmac |
| Session cookie | Cookie apibee_session | POST /api/cookies/login with test / test123 or admin / admin123 | /api/cookies/me |
| CSRF | XSRF-TOKEN cookie and X-CSRF-Token header | Token from GET /api/auth/csrf/token | /api/auth/csrf/submit |
A 401 means credentials are missing or invalid. A 403 means they are valid but not allowed, for example user-token on /api/auth/roles/admin.
Examples use these placeholders for values that change per run:
| Placeholder | Where to get it |
|---|---|
{{userJwt}} / {{adminJwt}} | accessToken from POST /api/auth/jwt/login with user / user123 or admin / admin123. |
{{refreshToken}} | refreshToken from POST /api/auth/jwt/login. |
{{legacyJwt}} | token from POST /api/User/Login with Michael / Thompson (role Admin). |
{{oauthAccessToken}} | access_token from POST /api/auth/oauth/token. |
{{oauth1RequestToken}} / {{oauth1RequestSecret}} / {{oauth1Verifier}} | oauth_token and oauth_token_secret from POST /api/auth/oauth1/request_token with oauth_callback=oob, then oauth_verifier from GET /api/auth/oauth1/authorize. |
{{csrfToken}} | token from GET /api/auth/csrf/token. The same value is set as the XSRF-TOKEN cookie. |
{{sessionId}} | apibee_session cookie set by POST /api/cookies/login (test / test123). |
{{unixTimestamp}} / {{hmacSignature}} | The current Unix time in seconds, and the hex HMAC-SHA256 of "{timestamp}.{raw body}" with key apibee-hmac-secret. |
{{uuid}} | Any new UUID, used as an Idempotency-Key. |
Sign in to see the details
The parameters, request and response examples and the live Try it panel for the authentication endpoints are for signed-in members. Accounts are free and take a few seconds to create.
Delays and simulated errors
Two query parameters work on every endpoint:
| Parameter | Effect | Example |
|---|---|---|
delay | Waits N seconds before responding. Maximum 10. | /api/Products?delay=2 |
error | Returns a simulated error instead of the real response: 400, 401, 403, 404, 408, 429, 500, 502 or 503. Adds the header X-Simulated: true. | /api/Products?error=503 |
Combined, as in ?delay=2&error=503, the request waits and then fails. A simulated error looks like this:
{
"status": 503,
"error": "Service Unavailable",
"message": "Simulated error. Use ?error={code} to test different status codes.",
"simulated": true
}Filtering, sorting and pagination
Every resource list endpoint, such as GET /api/Products, accepts these query parameters:
| Parameter | Meaning | Example |
|---|---|---|
limit | Page size, 1 to 100. Without it, all records are returned. | ?limit=10 |
page | 1-based page number. Requires limit. | ?limit=10&page=2 |
offset | Skip N records, as an alternative to page. | ?limit=10&offset=20 |
sort, order | Sort by any field. order is asc (default) or desc. | ?sort=price&order=desc |
q | Case-insensitive search in title, name, body, description and text fields. | ?q=keyboard |
any field | Exact, case-insensitive filter on that property. | ?category=books&inStock=true |
Lists return a plain JSON array. Totals are in the X-Total-Count, X-Page, X-Per-Page and X-Total-Pages headers. Cursor, Link header, keyset and HAL pagination are shown in Pagination.
Responses and errors
| Situation | Status | Body |
|---|---|---|
| Get one record | 200 | The record |
| List records | 200 | Array of records, plus pagination headers |
| Create | 201 | { message, data } |
| Bulk create | 201 | { message, data: [ … ] } |
| Replace or update | 200 | { message, data } |
| Partial update (PATCH) | 200 | { message, changed, ignored, data } |
| Delete | 200 | { message } |
| Bulk delete | 200 | { message, deleted, notFound } |
| Error | 4xx or 5xx | { status, error, message } |
| Model validation error | 400 | application/problem+json with errors per field |
| Business validation | 422 | application/problem+json (RFC 7807) with errors per field |
{
"status": 404,
"error": "Not Found",
"message": "Book with ID 999 does not exist."
}Every response allows any origin (Access-Control-Allow-Origin: *, without credentials) and exposes the pagination, caching, rate limit and versioning headers to browser code. The X-RateLimit-* headers are informational; real limiting only happens on Rate limit.
All data lives in memory. Creates, updates and deletes work, but everything returns to the seed data when the server restarts.
Calling from a browser
- Cookies. Browsers do not let JavaScript set the Cookie header, and cross-origin requests carry no credentials. Cookie-based endpoints only work from the same origin or through the proxy.
- Redirects.
fetch()follows redirects and hides the 3xx response. To see the real status and Location header, use the proxy. - Proxy.
POST /api/Proxy/callforwards a request from the server and returns its status and body. It avoids CORS, cookie and redirect limits, but does not relay response headers. - Streams.
/api/stream/sseis Server-Sent Events. The NDJSON, chunked, drip and JSON array streams arrive incrementally; read them with a streaming reader. - WebSockets.
/ws/echoand/ws/tickerneed the WebSocket API, not fetch. - Digest auth. Browsers only perform the challenge and response through their own login prompt.
- Failure injection.
/api/chaos/abortand/api/chaos/partialdrop the connection on purpose./api/chaos/timeoutand/api/chaos/slowcan take up to 60 seconds. - Forbidden headers. Browsers refuse to set Host, Content-Length, Accept-Encoding, Cookie and a few others.
Sign in to see the details
The parameters, request and response examples and the live Try it panel for these notes are for signed-in members. Accounts are free and take a few seconds to create.
Endpoints
360 endpoints in 53 groups. Each group opens its reference, with parameters and example requests and responses.
Start here
4 endpointsA live catalog of every endpoint, plus health checks.
HTTP basics
44 endpointsMethods, status codes, redirects, cookies, caching and request bodies.
Formats & data
62 endpointsCommon content types, file downloads, JSON edge cases and utilities.
Auth & security
38 endpointsAuth schemes, OAuth 2.0 and 1.0a, JWT, rate limiting and payments.
API patterns
50 endpointsStreaming, WebSockets, async jobs, pagination, failure injection and more.
Resources
142 endpointsRealistic data sets such as products, posts, books and countries.
Original API
20 endpointsThe first version of the API: users in JSON and XML, uploads and auth tests.