{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenActive Opportunity Extractor",
    "description": "Point at ANY OpenActive dataset site, data catalog, or RPDE feed and harvest UK sports & activity opportunity data — classes, sessions, facility slots and events from 100s of leisure operators (GLL, Everyone Active, Halo...). Follows the RPDE cursor, handles tombstones. Pay per item.",
    "version": "0.1",
    "x-build-id": "POXHaq3OpkGZWos1e"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~openactive-opportunity-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-openactive-opportunity-extractor",
        "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/datamule~openactive-opportunity-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-openactive-opportunity-extractor",
        "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/datamule~openactive-opportunity-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-openactive-opportunity-extractor",
        "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": {
          "startUrl": {
            "title": "Start URL (feed, dataset site, or catalog)",
            "type": "string",
            "description": "In FEED mode: an OpenActive RPDE feed URL (e.g. https://halo-openactive.legendonlineservices.co.uk/api/facility-uses), a dataset-site URL (whose feeds are auto-resolved), or several feed URLs separated by commas. In CATALOG mode: the master data catalog (leave empty to default to https://openactive.io/data-catalogs/data-catalog-collection.jsonld), a single sub-catalog URL, or one dataset-site URL — traversal recurses from wherever you start."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "feed",
              "catalog"
            ],
            "type": "string",
            "description": "feed = harvest the RPDE opportunity items (classes, sessions, facility slots, events), following the cursor to the end. catalog = traverse the OpenActive data-catalog graph (collection → sub-catalogs → operator dataset sites → their feeds) and emit the operator feed inventory (one row per discovered feed).",
            "default": "feed"
          },
          "feedKind": {
            "title": "Feed kinds (optional filter)",
            "type": "array",
            "description": "Optional filter on which opportunity feed kind(s) to read when a dataset site exposes several. FacilityUse = bookable facilities; SessionSeries + ScheduledSession = recurring classes and their dated instances; Slot = bookable facility time-slots; Event = one-off events. Leave empty for all. In feed mode this filters which distributions of a dataset-site URL are harvested; in catalog mode it filters the emitted inventory.",
            "items": {
              "type": "string"
            }
          },
          "includeDeleted": {
            "title": "Include deleted items (tombstones)",
            "type": "boolean",
            "description": "RPDE feeds are change logs, so most pages carry deleted tombstones (state=deleted, no data) alongside updated items. When enabled (default), tombstones are emitted as deletion rows (deleted=true) so you can mirror the feed's change stream. Disable to keep only live (updated) opportunities.",
            "default": true
          },
          "maxRecords": {
            "title": "Max records (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum total rows to emit across all pages/feeds. Each emitted row is one billable item. The actor follows the RPDE cursor and stops at this cap, the end of the feed, or the page limit — whichever comes first. Default 5000.",
            "default": 5000
          },
          "maxPages": {
            "title": "Max pages per feed",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap on how many RPDE pages to fetch per feed before stopping (each page is typically tens–hundreds of items). RPDE feeds terminate naturally on the 'empty page pointing to itself' convention; this cap bounds very large feeds. Default 50.",
            "default": 50
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers sent with every request, as a JSON object. OpenActive feeds are open data and require no auth; this is only for the rare rate-gated operator or a custom User-Agent. Leave empty for public feeds."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}