Table of Contents

    API

    Mock Server

    Use this URL to access a mockup of the API server. Your traffic will be recorded and compared to the documentation. You'll find your traffic analysis in the inspector or directly here in the documentation, right next to each resource.

loader.io API load testing documentation

All requests require an API key. While you can specify the API key in the body of your request, we’d prefer it be passed via the loaderio-Auth header. You can do this as follows:

In the Header: loaderio-Auth: {api_key}

In the Body: api_key={api_key}

Application Resources

GET

/v2/apps

List registered applications

Response

200 (OK)
Content-Type: application/json
[
  {
    "app": "gonnacrushya.com",
    "status": "verified",
    "app_id": "0f2fabf74c5451cf71dce7cf43987477"
  },
  {
    "app": "google.com",
    "status": "unverified",
    "app_id": "b579bbed7ef480e7318ac4d7b69e5caa"
  }
]

GET

/v2/apps/{app_id}

Application status

Response

200 (OK)
Content-Type: application/json
{
  "app": "gonnacrushya.com",
  "status": "verified",
  "app_id": "0f2fabf74c5451cf71dce7cf43987477"
}

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

POST

/v2/apps

Response

200 (OK)
Content-Type: application/json
{
  "message": "success",
  "app_id": "0f2fabf74c5451cf71dce7cf43987477",
  "verification_id": "loaderio-0f2fabf74c5451cf71dce7cf43987477"
}

Response

422
Content-Type: application/json
{
  "message":"error",
  "errors":["We are unable to register this app"]
}

POST

/v2/apps/{app_id}/verify

Verify a registered application

Response

200 (OK)
Content-Type: application/json
{
  "app_id": "0f2fabf74c5451cf71dce7cf43987477",
  "message": "success"
}

Response

422
Content-Type: application/json
{
  "app_id": "0f2fabf74c5451cf71dce7cf43987477",
  "message":"error",
  "errors":["can't verify domain gonnacrushya.com"]
}

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

DELETE

/v2/apps/{app_id}

Delete application. All past test data will also be deleted and will not be able to be recovered.

Response

200 (OK)
Content-Type: application/json

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

Test Resources

GET

/v2/tests

List of load tests

Response

200 (OK)
Content-Type: application/json
[
  {
    "name":"",
    "duration":60,
    "timeout":10000,
    "notes":"",
    "initial":0,
    "total":60,
    "status":"complete",
    "test_id":"9b24d675afb6c09c6813a79c956f0d02",
    "test_type":"Non-Cycling",
    "callback":"http://loader.io",
    "callback_email":"test@mail.com",
    "scheduled_at": "2013-06-07T19:30:00+03:00",
    "urls":
    [
      {
        "url":"http://loader.io/signin",
        "raw_post_body":null,
        "request_type":"GET",
        "payload_file_url":null,
        "headers":{ "header": "value", "header2": "value2" },
        "request_params":{ "param": "value", "param2": "value2" },
        "authentication":{"login": "login", "password": "password", "type": "basic"}
      }
    ]
  }
]

POST

/v2/tests

Create a new load test

Response

200 (OK)
Content-Type: application/json
{
    "message":"success",
    "test_id":"0642ee5387b4ee35b581b6bf1332c70b",
    "status":"processing"
    "result_id": "35b581b6bf1332c70b0642ee5387b4ee"
}

Response

200 (OK)
Content-Type: application/json
{
    "message":"success",
    "test_id":"0642ee5387b4ee35b581b6bf1332c70b",
    "status":"unverified"
}

Response

422
Content-Type: application/json
{
    "message":"error",
    "errors":["can't create test"]
}

GET

/v2/tests/{test_id}

Load test status

Response

200 (OK)
Content-type: application/json
{
  "name":"",
  "duration":60,
  "timeout":10000,
  "notes":"",
  "initial":0,
  "total":60,
  "status":"complete",
  "test_id":"9b24d675afb6c09c6813a79c956f0d02",
  "test_type":"Non-Cycling",
  "callback":"http://loader.io",
  "callback_email":"test@mail.com",
  "scheduled_at": "2013-06-07T19:30:00+03:00",
  "urls":
  [
    {
      "url":"http://loader.io/signin",
      "raw_post_body":null,
      "request_type":"GET",
      "payload_file_url":null,
      "headers":{ "header": "value", "header2": "value2" },
      "request_params":{"param": "value", "param2": "value2" },
      "authentication":{"login": "login", "password": "password", "type": "basic"}
    }
  ]
}

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

PUT

/v2/tests/{test_id}/run

Run load test

Response

200 (OK)
Content-Type: application/json
{
    "message":"success",
    "test_id":"0642ee5387b4ee35b581b6bf1332c70b",
    "status":"processing"
    "result_id": "35b581b6bf1332c70b0642ee5387b4ee"
}

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

Response

422
Content-Type: application/json
{
    "message":"error",
    "errors":["Can't run test for unverified application"]
}

PUT

/v2/tests/{test_id}/stop

Stop load test

Response

200 (OK)
Content-type: application/json
{
  "message":"success",
  "test_id":"1187538bb5d5fd60a1b99a6e67978c15",
  "status":"finished",
  "result_id":"7c55ad8408f7c4326b7fa0e069b7a011"
}

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

Response

422
Content-Type: application/json
{
    "message":"error",
    "errors":["Can't stop test with finished status"]
}

Test results

GET

/v2/tests/{test_id}/results

Load test results

Response

200 (OK)
Content-type: application/json
[
  {
    "result_id": "8fb213af34c1cf7b675dc21e900e533a",
    "started_at":"2013-06-10T23:42:01+02:00",
    "status":"ready",
    "public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
    "success":77,
    "error":0,
    "timeout_error":0,
    "network_error":0,
    "data_sent":28259,
    "data_received":8393,
    "avg_response_time":1,
    "avg_error_rate":0.0
  }
]

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

GET

/v2/tests/{test_id}/results/{result_id}

Load test result

Response

200 (OK)
Content-type: application/json
{
  "result_id": "8fb213af34c1cf7b675dc21e900e533a",
  "started_at":"2013-06-10T23:42:01+02:00",
  "status":"ready",
  "public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
  "success":77,
  "error":0,
  "timeout_error":0,
  "network_error":0,
  "data_sent":28259,
  "data_received":8393,
  "avg_response_time":1,
  "avg_error_rate":0.0
}

Response

404 (Not Found)
Content-Type: application/json
{
  "message":"error",
  "errors":["Requested record was not found"]
}

Servers

GET

/v2/servers

Load test server's ip addresses

Response

200 (OK)
Content-type: application/json
{
  "ip_addresses": ["127.0.0.1"]
}