{
  "openapi": "3.0.1",
  "info": {
    "title": "MLB NHL Schedule Scraper",
    "description": "Retrieve MLB and NHL schedules for an inclusive date range, with game IDs, season, game type, UTC start time, status, team names, scores, and venue. The Actor maps both leagues into a consistent dataset shape and follows NHL weekly schedule dates as needed.",
    "version": "0.1",
    "x-build-id": "etNCL0SlovbWOCkfa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~mlb-nhl-games-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-mlb-nhl-games-scraper",
        "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/axiomworks~mlb-nhl-games-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-mlb-nhl-games-scraper",
        "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/axiomworks~mlb-nhl-games-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-mlb-nhl-games-scraper",
        "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": [
          "startDate",
          "endDate"
        ],
        "properties": {
          "startDate": {
            "title": "First included game date (YYYY-MM-DD)",
            "type": "string",
            "description": "First included schedule date, e.g. \"2025-03-01\". Required, together with endDate; format YYYY-MM-DD only; use the same date for both to collect one day. Dates are league calendar dates, not UTC start-time filters."
          },
          "endDate": {
            "title": "Last included game date (YYYY-MM-DD)",
            "type": "string",
            "description": "Last included schedule date, e.g. \"2025-03-02\". Required; must be on or after startDate. Both endpoints are inclusive. Short historical ranges give quick, populated samples."
          },
          "leagues": {
            "title": "Leagues to collect (MLB, NHL)",
            "type": "array",
            "description": "League codes (uppercase, case-sensitive) as a nonempty array, e.g. [\"NHL\"] or [\"MLB\",\"NHL\"]. Default collects MLB then NHL. Leagues run in the supplied order and share maxItems; a small limit may be filled by the first league.",
            "items": {
              "type": "string",
              "enum": [
                "MLB",
                "NHL"
              ]
            },
            "default": [
              "MLB",
              "NHL"
            ]
          },
          "teams": {
            "title": "Team name or abbreviation filters",
            "type": "array",
            "description": "Team names, abbreviations, or exact numeric team IDs as strings, e.g. [\"Yankees\",\"TOR\",\"147\"]. Default [] keeps all teams. Any entry may match either side; names and abbreviations use case-insensitive substring matching, IDs match exactly. Unmatched filters return zero rows successfully.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum game rows across all leagues",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Each row is one game. Shared result limit across selected leagues after team filtering, 1-10000, default 50; e.g. 7 returns exactly 7 rows when enough games match. It is not a per-league limit. Processing stops when this limit or your run charge limit is reached.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Request proxy settings (default direct)",
            "type": "object",
            "description": "Apify proxy configuration, e.g. {\"useApifyProxy\":false} for direct requests (default). Set {\"useApifyProxy\":true} to use Apify Proxy for blocked networks. Persistent endpoint failures are logged; other selected leagues continue and an empty run succeeds with guidance.",
            "default": {
              "useApifyProxy": false
            }
          },
          "statuses": {
            "title": "Source game status filters",
            "type": "array",
            "description": "Source status values to keep, e.g. [\"Final\"] for MLB or [\"OFF\", \"FINAL\"] for NHL. Default [] keeps every status. Matches exactly ignoring case; combined with teams and date filters before the shared maxItems limit. Unknown statuses return zero rows successfully.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "timezone": {
            "title": "Local start time timezone",
            "type": "string",
            "description": "IANA timezone for the added localStartTime field, e.g. America/New_York or Europe/Paris. Default UTC. startTime stays UTC; timezone identifies the zone used for the local wall-clock value, including daylight saving changes.",
            "default": "UTC"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}