Run a TTFB test

POST /v1/ttfb-tests

Runs a new TTFB test for a region.

Body

This is the TTFB test body object

  • url string

    The url of the webpage

  • region string

    Values are asia, america, or europe.

Responses

  • A TTFB result to be returned

    Hide response attributes Show response attributes object
  • Invalid Request body or missing required parameters

    Hide response attributes Show response attributes object
    • code string

      An error code specific to the error.

    • message string

      A human-readable message providing more details about the error.

  • Insufficient Credits

    Hide response attributes Show response attributes object
    • code string

      An error code specific to the error.

    • message string

      A human-readable message providing more details about the error.

POST /v1/ttfb-tests
curl \
 -X POST https://api.speedvitals.com/v1/ttfb-tests \
 -H "X-API-KEY: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"url":"https://speedvitals.com","region":"asia"}'
Request example
{
  "url": "https://speedvitals.com",
  "region": "asia"
}
Request examples
{
  "url": "https://speedvitals.com",
  "region": "asia"
}
Response examples (201)
{
  "url": "https://speedvitals.com",
  "region": "america",
  "result": [
    {
      "location_id": "del",
      "location_name": "Delhi",
      "status": "success",
      "data": {
        "timings": {
          "dns_lookup": 2,
          "server_processing": 18,
          "tcp_connection": 10,
          "tls_handshake": 25,
          "total": 56,
          "ttfb": 55
        },
        "http_version": 2,
        "http_status": 200,
        "response_headers": {
          "accept-ranges": "bytes",
          "age": 520141,
          "cache-control": "max-age=604800",
          "vary": "Accept-Encoding",
          "x-cache": "HIT"
        }
      },
      "error": null
    },
    "{...}",
    "{...}"
  ]
}
Response examples (201)
{
  "url": "string",
  "region": "asia",
  "result": [
    {
      "location_id": "string",
      "location_name": "string",
      "status": "success",
      "data": {
        "timings": {
          "dns_lookup": 42,
          "server_processing": 42,
          "tcp_connection": 42,
          "tls_handshake": 42,
          "total": 42,
          "ttfb": 42
        },
        "http_version": 42,
        "http_status": 42,
        "response_headers": {}
      },
      "error": {
        "code": "string",
        "message": "string"
      }
    }
  ]
}
Response examples (400)
{
  "code": "string",
  "message": "string"
}
Response examples (400)
{
  "code": "string",
  "message": "string"
}
Response examples (402)
{
  "code": "string",
  "message": "string"
}
Response examples (402)
{
  "code": "string",
  "message": "string"
}