Links
Comment on page

Latency Testing API

Ddosify Latency Testing API
You can instantly start a geo-targeted latency test or you can create/delete/update a latency test plan to re-use it with Latency API.

Geo-Targeting

You will see the locations key in the request body of related API endpoints. The usage of this key let you able to perform latency test for desired locations.

Format of locations Object

You can target from continent to city by using the below format.
["<continent_code>.<country_code>.<state_code_if_exists>.<city_code>", ...]

Example Usages of locations Object

locations
Target Locations
["NA.US.TX.DA"]
Dallas
["NA.US.TX.*"]
All supported cities in Texas
["NA.US.*"]
All supported cities in USA
["EU.FR.PR"]
Paris
["NA.US.*", "EU.FR.PR"]
All supported cities in USA and Paris
["*"]
All supported cities

Endpoints

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.
You'll be charged for 5K Requests for every successful latency test.
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.
get
https://api.ddosify.com/v1
/latency/locations/
Get supported latency locations
post
https://api.ddosify.com/v1
/latency/test/
Start a latency test. You'll be charged for 5K Requests
post
https://api.ddosify.com/v1
/latency/plan/
Create a new latency test plan
post
https://api.ddosify.com/v1
/latency/plan/<PLAN_ID>/test/
Start a latency test with the plan id. You'll be charged for 5K Requests
get
https://api.ddosify.com/v1
/latency/plan/<PLAN_ID>/
Retrieve details of the latency test plan
get
https://api.ddosify.com/v1
/latency/plan/
Get latency test plans
put
https://api.ddosify.com/v1
/latency/plan/<PLAN_ID>/
Update the latency test plan
delete
https://api.ddosify.com/v1
/latency/plan/<PLAN_ID>/
Delete the latency test plan
get
https://api.ddosify.com/v1
/balance/
Get available credit

Scheduling

You can create periodic latency tests with the scheduling mechanism. The scheduler is basically a wrapper over Latency Test Plan to make it periodically runnable with the given configurations.

Scheduler Object

Key
Value
Description
name
String
Scheduler name
interval
String
Interval time between each run. Format: "(digit)(s|m|h)" Examples: "30s" : Runs every 30 seconds "4m" : Runs every 4 minutes "1h" : Runs every 1 hour
is_active
Bool
Enable/disable logic for the scheduler
total_run_count
Integer
The maximum number of run counts for the scheduler. If it is null then the scheduler runs forever.
test_plan_id
UUID
Latency Test Plan to be used by scheduler
run_count
Integer
This is a read-only field and is updated by the scheduler every time a test is finished.
The minimum interval value is "30s".

Lifecycle of a Scheduler

At the beginning of each interval, the Scheduler first checks is_active to be sure that the scheduler is active. Then it controls if the number of test runs reached its maximum value by comparing total_run_count with run_count. If these two checks passed, the scheduler starts a new Latency Test by using the Latency Test Plan.
Be careful about the infinite Schedulers (whentotal_run_count is null). They run forever until you stop them.
post
https://api.ddosify.com/v1
/latency/scheduler
Create a scheduler
get
https://api.ddosify.com/v1
/latency/scheduler/<SCHEDULER_ID>/
Retrieve details of the scheduler
get
https://api.ddosify.com/v1
/latency/scheduler/
List all the schedulers
get
https://api.ddosify.com/v1
/latency/scheduler?test_plan=<PLAN_ID>
List all the schedulers with Latency Test Plan ID
get
https://api.ddosify.com/v1
/latency/scheduler/<SCHEDULER_ID>/result/
Get the result of executed latency tests in descending order by date
patch
https://api.ddosify.com/v1
/latency/scheduler/<SCHEDULER_ID>/
Update the Scheduler
delete
https://api.ddosify.com/v1
/latency/scheduler/<SCHEDULER_ID>
Delete the Scheduler