{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Load Testing & Stress Test: Uptime, Speed, SSL",
    "description": "Load testing and stress test for your own website: up to 50 concurrent users for 5 minutes, p50/p90/p99 latency, error rate, throughput. Plus uptime, TTFB, SSL expiry, redirects and broken link checks, with a pass/fail verdict. No proxies, no fake traffic.",
    "version": "1.0",
    "x-build-id": "XR5xxEKJRbmP7nUsJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pnda~website-load-test/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pnda-website-load-test",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/pnda~website-load-test/runs": {
      "post": {
        "operationId": "runs-sync-pnda-website-load-test",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/pnda~website-load-test/run-sync": {
      "post": {
        "operationId": "run-sync-pnda-website-load-test",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "urls",
          "confirmOwnership"
        ],
        "properties": {
          "urls": {
            "title": "URLs of your website",
            "type": "array",
            "description": "1 to 50 pages of ONE website you own (home page, product page, API endpoint...). All URLs must be on the same domain or its subdomains. Each URL gets a health check; the load test spreads its requests over all of them.",
            "items": {
              "type": "string"
            }
          },
          "confirmOwnership": {
            "title": "I own this website or have permission to test it",
            "type": "boolean",
            "description": "Required. Only test websites you own or are explicitly allowed to test. Load testing a third-party website without permission can be illegal and is against the Apify terms. Requests are identified with the User-Agent 'pnda-load-test (+https://apify.com/pnda/website-load-test)'.",
            "default": false
          },
          "samplesPerUrl": {
            "title": "Samples per URL (health check)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many timed requests, each on a fresh connection, measure DNS, connect, TLS, TTFB and total time of every URL. Percentiles are computed over these samples.",
            "default": 5
          },
          "checkBrokenLinks": {
            "title": "Check broken links",
            "type": "boolean",
            "description": "Check every link, image, script and stylesheet of each HTML page (HEAD, GET fallback). $0.50 per 1,000 links checked.",
            "default": false
          },
          "maxLinksPerPage": {
            "title": "Max links per page",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Links checked per page, in page order.",
            "default": 100
          },
          "loadTest": {
            "title": "Run a load test",
            "type": "boolean",
            "description": "Send real concurrent traffic to your URLs and measure latency percentiles, error rate and throughput. $0.05 per started minute of load test.",
            "default": false
          },
          "concurrency": {
            "title": "Concurrent users",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Virtual users sending requests one after the other (keep-alive connections). Maximum 50.",
            "default": 10
          },
          "durationSecs": {
            "title": "Duration (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Length of the load test. Maximum 300 seconds (5 minutes).",
            "default": 30
          },
          "maxRequests": {
            "title": "Max requests",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "The test stops at this number of requests even before the duration. Maximum 20,000.",
            "default": 5000
          },
          "rampUpSecs": {
            "title": "Ramp-up (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Users are added linearly over this time, instead of all at once.",
            "default": 5
          },
          "method": {
            "title": "HTTP method",
            "enum": [
              "GET",
              "HEAD"
            ],
            "type": "string",
            "description": "GET downloads the full response (realistic). HEAD only asks for headers (lighter for your bandwidth).",
            "default": "GET"
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "A request without a full answer after this time counts as an error.",
            "default": 30
          },
          "stopOnErrorRatePercent": {
            "title": "Stop when server errors exceed (%)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety brake, measured on the last 100 requests: the test stops as soon as more than this share of them fail (5xx or no answer), so a site that is going down is not loaded further. The test also stops when your firewall or CDN blocks most requests (403 / 429).",
            "default": 50
          },
          "maxP90Ms": {
            "title": "Pass if p90 latency is below (ms)",
            "minimum": 1,
            "type": "integer",
            "description": "Load test threshold: 90% of requests must complete faster than this.",
            "default": 2000
          },
          "maxErrorRatePercent": {
            "title": "Pass if error rate is at most (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Load test threshold: share of requests answered 4xx / 5xx or not answered.",
            "default": 1
          },
          "maxTtfbMs": {
            "title": "Pass if median TTFB is below (ms)",
            "minimum": 1,
            "type": "integer",
            "description": "Health check threshold: median time to first byte of each URL.",
            "default": 800
          },
          "minSslDaysLeft": {
            "title": "Pass if the SSL certificate is valid for at least (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Health check threshold: days before the certificate expires.",
            "default": 14
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}