Links

Load Testing API

Ddosify Load Testing API
You can automate the process of load testing your web applications or APIs, and easily incorporate load testing into your CI/CD pipeline.
Our API provides a wide range of features, including the ability to create load test plans, run load tests, and retrieve detailed reports and metrics on test results. You can also create environment variables and test data (CSV) using this API. The API is designed to be easy to use, with a RESTful architecture and JSON-based responses.
In this section, you will find the APIs for test and plan endpoints. It's recommended to start the load test with a test plan using this endpoint. You can create test plans easily with no-code UI using Ddosify Cloud. You can select the Save as Test Plan in the summary page of the test suite. Once you create the test plan you can get the test plan id from the URL: https://app.ddosify.com/load/configure-test-plans/<TEST_PLAN_ID>
You can also find different examples of this API.
All endpoints require the X-API-KEY header for authentication. Please check the Get Your API Key section to learn how you can get it.
For every successful load test, you'll be charged for request_count and duration in the body config_data.
API concurrency limit is 5 requests per second for GET endpoints and 2 requests per second for others. You will get HTTP 429 (Concurrency Limit Exceeded) when you reach the concurrency.

Load Test

post
https://api.ddosify.com/v1
/load/test/
Create a Load Test
get
https://api.ddosify.com/v1
/load/test/
Get Load Tests
get
https://api.ddosify.com/v1
/load/test/<TEST_ID>/
Retrieve details of the Load Test
get
https://api.ddosify.com/v1
/load/test/<TEST_ID>/result/
Result of Load Test
get
https://api.ddosify.com/v1
/load/test/<TEST_ID>/stop/
Stop the Load Test
get
https://api.ddosify.com/v1
/load/locations/
Get Supported Load Locations

Config Data

Config data contains the configuration of the load test to start a load test and create load test plan endpoints. Here is an example:
{
"steps": [
{
"id": 1,
"url": "https://servdown.com",
"name": "Home Page",
"method": "POST",
"others": {
"h2": false,
"disable-redirect": false,
"disable-compression": false
},
"headers": {
"Test-Header": "Test Value",
"Test-Header2": "Test Value2"
},
"payload": "{\"id\": 24}",
"timeout": 15
},
{
"id": 2,
"url": "https://app.servdown.com",
"name": "Servdown App",
"method": "GET",
"others": {
"h2": false,
"disable-redirect": false,
"disable-compression": false
},
"timeout": 15
}
],
"proxy_config": {
"US": 50,
"DE": 50
},
"iteration_count": 1000,
"load_type": "linear",
"duration": 20
}
This load-testing configuration includes two steps, each of which represents a specific action to be executed by the load-testing tool.
The first step represents a POST request to the "https://servdown.com" URL with a payload of {"id": 24}. The headers of the request include Test-Header with a value of Test Value and Test-Header2 with a value of Test Value2. The timeout for this step is set to 15 seconds.
The second step represents a GET request to the "https://app.servdown.com" URL. The timeout for this step is also set to 15 seconds.
The proxy_config field indicates that the load testing tool will use a mix of US (United States) and DE (Germany) servers, with a 50/50 distribution. You can get the full list of the supported locations by using this endpoint.
The iteration_count field indicates that the load testing tool will execute each step 1000 times. There will be a total of 1000*2=2000 requests.
The load_type field specifies a linear load pattern, which means that the load will be the same over time.
The duration field indicates that the load testing will last for 20 seconds.
Key
Supported
Description
proxy_config
"AU","BE","CA","CH","CN","DE","ES","FI","FR","GB","HK","HR","HU","IL","IT","JP","NL","NO","PL","RO","RS","SE","TR","UA","US"
Supported locations. You can get the list with this endpoint.
load_type
"linear", "waved", "incremental"
Type of the load. More.

Load Test Plan

post
https://api.ddosify.com/v1
/load/plan/
Create a Load Test Plan
get
https://api.ddosify.com/v1
/load/plan/
Get Load Test Plans
get
https://api.ddosify.com/v1
/load/plan/<PLAN_ID>/
Retrieve details of the Load Test Plan
patch
https://api.ddosify.com/v1
/load/plan/<PLAN_ID>/
Update the Load Test Plan
delete
https://api.ddosify.com/v1
/load/plan/<PLAN_ID>/
Delete the Load Test Plan

Environment

post
https://api.ddosify.com/v1
/environment/
Create Environment
get
https://api.ddosify.com/v1
/environment/
Get Environments
get
https://api.ddosify.com/v1
/environment/<ENVIRONMENT_ID>/
Retrieve details of the Environment
patch
https://api.ddosify.com/v1
/environment/<ENVIRONMENT_ID>/
Update the Environment
delete
https://api.ddosify.com/v1
/environment/<ENVIRONMENT_ID>/
Delete the Environment

vars

vars represents the environment variables for Create Environment endpoint.
Each key-value pair consists of a key and a value. The key represents the name of the environment variable to be set, and the value represents the value to be assigned to that variable.
The types of values can be bool, number, string and array. Here is an example of vars:
[
{"key": "test_key_bool", "value": false},
{"key": "test_key_string", "value": "test_value_2"},
{"key": "test_key_number_int", "value": 15},
{"key": "test_key_number_float", "value": 15.2},
{"key": "test_key_array", "value": [14, 12, 15]}
]
In this specific example, there are five environment variables:
  • test_key_bool with a type of bool and value of false
  • test_key_string with a type of string and value of test_value_2
  • test_key_number_int with a type of number and value of 15
  • test_key_number_float with a type of number and value of 15.2
  • test_key_array with a type of array and value of [14, 12, 15]

Test Data (CSV)

post
https://api.ddosify.com/v1
/testdata/
Create Test Data
get
https://api.ddosify.com/v1
/testdata/
Get Test Data
get
https://api.ddosify.com/v1
/testdata/<TEST_DATA_ID>/
Retrieve details of the Test Data
delete
https://api.ddosify.com/v1
/testdata/<TEST_DATA_ID>/
Delete the Test Data

file_config

Here is an example of file_config for Create Test Data endpoint:
{
"delimiter": ";",
"vars": {
"0": {
"tag": "year"
},
"1": {
"tag": "city"
},
"2": {
"tag": "sport"
},
"5": {
"tag": "event"
},
"7": {
"tag": "medal"
},
"8": {
"tag": "no"
}
},
"allow_quota": true,
"order": "random",
"skip_first_line": true,
"skip_empty_line": true
}
This configuration defines the settings for parsing a CSV file. Here's a breakdown of each of the options specified:
  • delimiter: The delimiter is used to separate fields in the CSV file. In this case, the delimiter is ;
  • vars: A mapping of column numbers to variable names. Each key represents the column number (starting from 0), and the value is an object that specifies the variable name (tag). For example, the column at index 0 (the first column) will be mapped to the variable year, the column at index 1 will be mapped to the variable city, and so on.
  • allow_quota: A boolean value that specifies whether or not the CSV file allows the use of quotes to enclose fields. In this case, it is set to true, indicating that quotes are allowed.
  • order: Specifies the order in which the rows in the CSV file should be parsed. In this case, it is set to random, indicating that the rows should be parsed in random order. Options: random, sequential
  • skip_first_line: A boolean value that specifies whether or not the first line of the CSV file should be skipped during parsing. In this case, it is set to true, indicating that the first line should be skipped.
  • skip_empty_line: A boolean value that specifies whether or not empty lines should be skipped during parsing. In this case, it is set to true, indicating that empty lines should be skipped.