TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Responds with a status code picked at random from a weighted pool

GETPOSTPUTPATCHDELETEHEADOPTIONShttps://api.testingapis.com/api/status/random

Accepts any verb. The X-Status-Pool response header shows the parsed pool.

Parameters 1

NameTypeDescription
codesquery · stringComma-separated code[:weight] entries, e.g. 200:3,500:1 (200 is three times as likely). Codes must be 200-599, weights 1-100 (default 1), at most 20 entries. Default pool: 200,201,400,404,500.

Responses

200
Or whichever code was drawn; the body and headers match /api/status/{code}.
400
Invalid code, weight or pool size.

Example

Request
curl -X GET "https://api.testingapis.com/api/status/random?codes=200:3,500:1"
Response200 OK
X-Status-Pool: 200:3,500:1

{
  "status": 200,
  "statusText": "OK",
  "category": "success",
  "message": "This is a 200 response. Use /api/status/{code} to request any status."
}