Run a TTFB test

POST /v1/ttfb-tests

Runs a new TTFB test for a region.

application/json

Body

This is the TTFB test body object

  • url string

    The url of the webpage

  • region string

    Values are asia, america, or europe.

Responses

  • 201

    A TTFB result to be returned

    Hide response attributes Show response attributes object
  • 400

    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.

  • 402

    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"
}
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 (400)
{
  "code": "string",
  "message": "string"
}
Response examples (402)
{
  "code": "string",
  "message": "string"
}