{
  "openapi": "3.0.1",
  "info": {
    "title": "Page View Generator / Stress Tester",
    "description": "Simulates realistic page views to a URL using rotating Apify residential proxies for stress testing and traffic analysis.",
    "version": "1.0",
    "x-build-id": "j52aTSQrXMNhz2X06"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/practicaltools~pageview-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-practicaltools-pageview-generator",
        "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/practicaltools~pageview-generator/runs": {
      "post": {
        "operationId": "runs-sync-practicaltools-pageview-generator",
        "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/practicaltools~pageview-generator/run-sync": {
      "post": {
        "operationId": "run-sync-practicaltools-pageview-generator",
        "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": [
          "url"
        ],
        "properties": {
          "url": {
            "title": "Target URL",
            "type": "string",
            "description": "The URL to simulate browser page views on. Must be a valid HTTP or HTTPS URL."
          },
          "requestCount": {
            "title": "Page View Count",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Total number of browser page views to simulate.",
            "default": 50
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of browser instances running in parallel.",
            "default": 5
          },
          "minDelayMs": {
            "title": "Minimum Pre-Request Delay (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum delay in milliseconds before dispatching each browser request. Randomized between min and max to simulate staggered traffic.",
            "default": 0
          },
          "maxDelayMs": {
            "title": "Maximum Pre-Request Delay (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum delay in milliseconds before dispatching each browser request.",
            "default": 0
          },
          "minTimeOnPageMs": {
            "title": "Minimum Time on Page (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum time in milliseconds the browser spends on the page after load (simulates reading time).",
            "default": 2000
          },
          "maxTimeOnPageMs": {
            "title": "Maximum Time on Page (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum time in milliseconds the browser spends on the page after load.",
            "default": 8000
          },
          "simulateBehavior": {
            "title": "Simulate User Behavior",
            "type": "boolean",
            "description": "When enabled, the browser scrolls through the page and moves the mouse to mimic real user interaction. Capped at 5 seconds total.",
            "default": false
          },
          "blockResources": {
            "title": "Block Images, Fonts & Media",
            "type": "boolean",
            "description": "Block images, fonts and media from loading. Significantly reduces session time and proxy bandwidth cost while preserving JS execution and analytics firing. Recommended for speed and cost efficiency.",
            "default": true
          },
          "waitUntil": {
            "title": "Wait Until",
            "enum": [
              "domcontentloaded",
              "load",
              "networkidle"
            ],
            "type": "string",
            "description": "Page load event to wait for before considering navigation complete. 'load' is recommended — it waits for scripts (including analytics) to finish loading, ensuring pageview beacons fire reliably. 'domcontentloaded' is faster but may miss analytics. 'networkidle' is the most conservative.",
            "default": "load"
          },
          "proxyGroups": {
            "title": "Proxy Groups",
            "type": "array",
            "description": "Apify proxy groups to use for rotating IPs. Use RESIDENTIAL for residential IPs.",
            "default": [
              "RESIDENTIAL"
            ],
            "items": {
              "type": "string"
            }
          },
          "countryCode": {
            "title": "Country Code",
            "pattern": "^[A-Z]{2}$",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Optional ISO 3166-1 alpha-2 country code to restrict proxy IPs (e.g. US, GB, DE). Leave empty for all countries."
          },
          "headers": {
            "title": "Extra HTTP Headers",
            "type": "object",
            "description": "Additional HTTP headers to inject into every browser request (e.g. {\"Accept-Language\": \"en-US,en;q=0.9\"}).",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}