{
  "openapi": "3.0.1",
  "info": {
    "title": "Angelcam Car Detector",
    "description": "Checks Angelcam cameras for a parked car and reports presence, position and colour. Runs YOLOv8 locally - no external AI API keys.",
    "version": "0.1",
    "x-build-id": "s4nF8XMDQOVNpKhO2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pavel.kuba~angelcam-car-detector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pavel.kuba-angelcam-car-detector",
        "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/pavel.kuba~angelcam-car-detector/runs": {
      "post": {
        "operationId": "runs-sync-pavel.kuba-angelcam-car-detector",
        "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/pavel.kuba~angelcam-car-detector/run-sync": {
      "post": {
        "operationId": "run-sync-pavel.kuba-angelcam-car-detector",
        "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",
        "properties": {
          "cameraIds": {
            "title": "Camera IDs",
            "type": "array",
            "description": "Angelcam camera IDs to check. Leave empty and use 'Camera query' to resolve by name, or leave both empty to check every online camera.",
            "items": {
              "type": "string"
            }
          },
          "cameraQuery": {
            "title": "Camera query",
            "type": "string",
            "description": "Free-text camera reference (name, tag, location), resolved via the MCP find_camera tool. Ignored when Camera IDs are given."
          },
          "source": {
            "title": "Frame source",
            "enum": [
              "live",
              "snapshot"
            ],
            "type": "string",
            "description": "'live' grabs a fresh frame from the MJPEG live stream (recommended - periodic snapshots can be 30+ minutes old). 'snapshot' uses the latest Angelcam periodic snapshot.",
            "default": "live"
          },
          "region": {
            "title": "Parking spot region",
            "type": "object",
            "description": "Optional parking-spot region as fractions of the frame: {\"x\":0.2,\"y\":0.4,\"w\":0.3,\"h\":0.4} (or pixels). inRegion is true when a detected vehicle box overlaps the spot by at least \"Min region overlap\"."
          },
          "minRegionOverlap": {
            "title": "Min region overlap",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Percent of the vehicle box that must lie inside the region to count as parked there.",
            "default": 50
          },
          "confThreshold": {
            "title": "Detection confidence threshold",
            "minimum": 5,
            "maximum": 95,
            "type": "integer",
            "description": "YOLO confidence (percent) below which detections are ignored. Lower = more sensitive, more false positives.",
            "default": 45
          },
          "tiledDetection": {
            "title": "Tiled detection",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Tile the region of interest and run the detector on each tile. Needed for cars far from the camera - a full 2560x1440 frame is squeezed into 640x640, shrinking distant cars below the detector limit. \"auto\" tiles whenever a region is set.",
            "default": "auto"
          },
          "tileSize": {
            "title": "Tile size (px)",
            "minimum": 160,
            "maximum": 960,
            "type": "integer",
            "description": "Tile edge in source pixels. Smaller = more zoom on distant cars, more tiles, slower.",
            "default": 320
          },
          "saveFrames": {
            "title": "Save frames to key-value store",
            "type": "boolean",
            "description": "Store the analysed JPEG in the run's key-value store and link it from the dataset row.",
            "default": true
          },
          "angelcamMcpUrl": {
            "title": "Angelcam MCP URL",
            "type": "string",
            "description": "Base MCP endpoint of the Angelcam MCP server.",
            "default": "https://mcp.angelcam.com/api/mcp"
          },
          "angelcamClientId": {
            "title": "Angelcam OAuth client ID",
            "type": "string",
            "description": "From `npm run login`. Falls back to ANGELCAM_CLIENT_ID env var."
          },
          "angelcamRefreshToken": {
            "title": "Angelcam OAuth refresh token",
            "type": "string",
            "description": "Seed refresh token from `npm run login`. Only needed on the first run - the actor stores the rotated token in the 'angelcam-auth' key-value store afterwards. Falls back to ANGELCAM_REFRESH_TOKEN env var."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}