Welcome to the Broken API on RapidAPI! This API is designed to help you thoroughly test your integrations against various error scenarios that you might encounter in the real world. It mimics a broken production RESTful API, simulating common issues such as timeouts, incorrect status codes, missing or bad response bodies, and erroneous headers.
The Broken API is a valuable tool for developers and QA testers looking to ensure their applications can gracefully handle unexpected issues that can occur with external APIs. By using this API, you can validate how your system responds to different error scenarios, thereby improving the reliability and resilience of your software.
To use the Broken API, you need to create an account on RapidAPI (if you haven’t already) and subscribe to this API. Once subscribed, you will receive an API key that you can use to make requests to the API.
You can test against a random broken event by using the following endpoints:
GET /broken
POST /broken
PUT /broken
PATCH /broken
These endpoints simulate random broken events, such as timeouts, incorrect status codes, missing or bad response bodies, and erroneous headers. The API will choose a random broken event for you.
You can test against a specific broken event by providing the type of error you want to simulate in the what_should_break
path parameter. Use the following endpoints:
GET /broken/{what_should_break}
POST /broken/{what_should_break}
PUT /broken/{what_should_break}
PATCH /broken/{what_should_break}
Valid values for the what_should_break
parameter are: timeout
, status-code
, body-missing
, and body-wrong
.
You can request a specific status code to be returned using the following endpoints:
GET /status-code/{code}
POST /status-code/{code}
PUT /status-code/{code}
PATCH /status-code/{code}
Provide the desired status code in the code
path parameter, within the range of 100 to 599.
You can request a specific time to be waited before responding using the following endpoints:
GET /timeout/{time}
POST /timeout/{time}
PUT /timeout/{time}
PATCH /timeout/{time}
Specify the time to wait in milliseconds using the time
path parameter, ranging from 1 to 30,000 milliseconds.
The Broken API returns various HTTP status codes to simulate different error conditions, including:
200 OK
: A successful response.503 Service Unavailable
: Simulates a status code error.408 Request Timeout
: Represents a request timeout.459 Unknown Status Code
: Mimics an unknown status code.Here are some examples of how you can use the Broken API:
GET https://broken-api.rapidapi.com/broken
GET https://broken-api.rapidapi.com/broken/timeout
GET https://broken-api.rapidapi.com/status-code/202
GET https://broken-api.rapidapi.com/timeout/40
If you have any questions, encounter issues, or need assistance with the Broken API, please reach out to our support team through the RapidAPI platform.
Happy testing!