{
  "openapi": "3.0.1",
  "info": {
    "title": "GTFS + GTFS-Realtime Transit Feed Monitor (open-licensed)",
    "description": "Normalize and monitor open-licensed public-transit feeds. Static GTFS (zipped CSV) to schedule snapshots and diffs; GTFS-Realtime (protobuf) to alerts, vehicle positions and trip updates. Only verifiably open-licensed feeds are decoded; each record carries its source license and attribution.",
    "version": "0.1",
    "x-build-id": "lq0w1UafazCymcbSw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bytehavenstudios~gtfs-transit-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bytehavenstudios-gtfs-transit-monitor",
        "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/bytehavenstudios~gtfs-transit-monitor/runs": {
      "post": {
        "operationId": "runs-sync-bytehavenstudios-gtfs-transit-monitor",
        "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/bytehavenstudios~gtfs-transit-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-bytehavenstudios-gtfs-transit-monitor",
        "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": [
          "feeds"
        ],
        "properties": {
          "feeds": {
            "title": "Feeds (Mobility Database IDs or direct GTFS / GTFS-RT URLs)",
            "type": "array",
            "description": "Each entry is either a Mobility Database mdb_source_id (e.g. \"mdb-1\" or just \"1\") or a direct feed URL. Static GTFS = a .zip URL; GTFS-Realtime = a protobuf (.pb) URL. Mobility Database IDs are resolved against the CC0 catalog and license-checked automatically.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "vehicle-positions",
              "service-alerts",
              "trip-updates",
              "static-diff"
            ],
            "type": "string",
            "description": "static-diff = decode zipped GTFS into a schedule snapshot (and diff vs the previous run when monitoring); service-alerts / vehicle-positions / trip-updates = decode a GTFS-Realtime protobuf feed of that entity type.",
            "default": "vehicle-positions"
          },
          "openLicensesOnly": {
            "title": "Open-licensed feeds only (compliance filter)",
            "type": "boolean",
            "description": "COMPLIANCE FILTER — keep this ON. When on, a feed is decoded/redistributed only if its license is verifiably open (catalog license matches CC0 / CC-BY / ODC-BY / public-domain, or the feed is on the built-in verified-open allowlist). Feeds with unknown/absent/restrictive licenses are skipped. Turning this OFF makes YOU responsible for each feed's license per the Mobility Database Terms.",
            "default": true
          },
          "sinceDate": {
            "title": "Only records/alerts on/after (YYYY-MM-DD)",
            "type": "string",
            "description": "Monitoring filter. static-diff: only report schedule changes effective on/after this date. service-alerts: only alerts active on/after this date. Leave empty for no date filter."
          },
          "maxRecordsPerFeed": {
            "title": "Max records per feed",
            "minimum": 0,
            "type": "integer",
            "description": "Cap normalized records emitted per feed (vehicle positions, alerts, trip updates, or diff rows). 0 = no cap.",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Delay between feed requests (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Pacing between successive feed fetches, to be a polite client of agency servers.",
            "default": 500
          },
          "fetchRetries": {
            "title": "Fetch retries (transient failures)",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Extra attempts after the first when a feed fetch hits a transient failure (network error, HTTP 408/429/5xx), with exponential backoff. Permanent errors (403/404/…) are never retried. 0 = no retry.",
            "default": 2
          },
          "retryBaseDelayMs": {
            "title": "Retry backoff base (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Base delay for retry backoff; the wait doubles each attempt (base, 2×, 4×, …).",
            "default": 500
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Most open GTFS/GTFS-RT feeds are plain public HTTP and need no proxy. Enable Apify Proxy only if a specific agency host rate-limits by IP.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}