{
  "openapi": "3.0.1",
  "info": {
    "title": "TeamRankings Scraper - Ratings, Stats & Odds",
    "description": "Power ratings, 1,300+ team and player stat leaderboards, betting odds, projections and situational trends for NFL, NBA, MLB, WNBA and college sports.",
    "version": "0.1",
    "x-build-id": "xhvRi8n46Eogt0o9B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~teamrankings-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-teamrankings-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/parseforge~teamrankings-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-teamrankings-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/parseforge~teamrankings-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-teamrankings-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": [
          "sport",
          "dataset"
        ],
        "properties": {
          "sport": {
            "title": "League",
            "enum": [
              "nfl",
              "nba",
              "mlb",
              "wnba",
              "ncb",
              "ncf"
            ],
            "type": "string",
            "description": "Which league to scrape. TeamRankings publishes NFL, NBA, MLB, WNBA, NCAA basketball and NCAA football. There is no NHL section — teamrankings.com/nhl/ redirects to the home page.",
            "default": "nfl"
          },
          "dataset": {
            "title": "Dataset",
            "enum": [
              "rankings",
              "team-stats",
              "player-stats",
              "odds",
              "schedule",
              "standings",
              "projections",
              "trends",
              "team-profiles",
              "odds-history",
              "odds-movement"
            ],
            "type": "string",
            "description": "Which surface to pull. Each dataset bills its own per-row event, so you only pay for the one you ask for. Rankings and team stats accept a historical date; odds and schedule accept the matchup enrichment blocks below.",
            "default": "rankings"
          },
          "slugs": {
            "title": "Specific pages",
            "type": "array",
            "description": "Page slugs to pull for rankings / team stats / player stats, e.g. \"predictive-by-other\" or \"points-per-game\". Leave empty to take every page the league publishes, up to Max pages. A slug that does not exist is reported in the log rather than failing the run.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Stat categories",
            "type": "array",
            "description": "Alternative to Specific pages: take every stat in these categories. NFL/NCF use \"Scoring Offense\", \"Rushing Defense\", \"Turnovers\"… NBA/WNBA/NCB use \"Scoring\", \"Shooting\", \"Rebounding\"… MLB uses \"Team Batting\", \"Team Pitching\"… Ignored when Specific pages is set. Rankings have no categories.",
            "items": {
              "type": "string"
            }
          },
          "date": {
            "title": "Historical snapshot date",
            "type": "string",
            "description": "YYYY-MM-DD. Rankings and team stats are rebuilt as they stood on that date — TeamRankings keeps daily snapshots going back years. Leave empty for today."
          },
          "scheduleView": {
            "title": "Schedule view",
            "enum": [
              "daily",
              "season"
            ],
            "type": "string",
            "description": "Daily returns today's slate with the site's hotness score; Season returns the full published schedule (2,430 games for MLB, 272 for NFL).",
            "default": "daily"
          },
          "projectionView": {
            "title": "Projection view",
            "enum": [
              "standings",
              "postseason-seeds"
            ],
            "type": "string",
            "description": "Projected standings gives projected win totals plus playoff, division, top-seed and title odds. Postseason seeds gives per-seed probabilities and is published for MLB only.",
            "default": "standings"
          },
          "trendTypes": {
            "title": "Trend types",
            "type": "array",
            "description": "Which trend tables to pull: straight-up win records, against-the-spread records, or over/under records.",
            "items": {
              "type": "string",
              "enum": [
                "win",
                "ats",
                "ou"
              ],
              "enumTitles": [
                "Win trends",
                "Against the spread",
                "Over / under"
              ]
            },
            "default": [
              "win"
            ]
          },
          "trendSituations": {
            "title": "Trend situations",
            "type": "array",
            "description": "Situational split for each trend table. Every combination of type x situation is one page, so 3 types x 5 situations is 15 pages.",
            "items": {
              "type": "string",
              "enum": [
                "all_games",
                "is_after_win",
                "is_after_loss",
                "is_home",
                "is_away",
                "is_neutral",
                "is_fav",
                "is_dog",
                "is_home_fav",
                "is_home_dog",
                "is_away_fav",
                "is_away_dog",
                "no_rest",
                "one_day_off",
                "two_three_days_off",
                "four_plus_days_off",
                "is_doubleheader",
                "rest_advantage",
                "rest_disadvantage",
                "equal_rest",
                "is_league",
                "non_league",
                "is_division",
                "non_division",
                "is_regular_season",
                "is_playoff"
              ],
              "enumTitles": [
                "All games",
                "After a win",
                "After a loss",
                "As home team",
                "As away team",
                "At neutral site",
                "As favorite",
                "As underdog",
                "As home favorite",
                "As home underdog",
                "As away favorite",
                "As away underdog",
                "No rest",
                "1 day off",
                "2-3 days off",
                "4+ days off",
                "Second game of doubleheader",
                "With rest advantage",
                "With rest disadvantage",
                "With equal rest",
                "League games",
                "Non-league games",
                "Division games",
                "Non-division games",
                "Regular season games",
                "Playoff games"
              ]
            },
            "default": [
              "all_games"
            ]
          },
          "trendSeason": {
            "title": "Trend season",
            "type": "string",
            "description": "Four-digit season for the trends dataset, e.g. 2019. TeamRankings keeps trends back to 2007. Leave empty for the current season."
          },
          "oddsHistoryView": {
            "title": "Odds history view",
            "enum": [
              "results",
              "win",
              "spread",
              "over-under",
              "spread-and-over-under"
            ],
            "type": "string",
            "description": "Which historical study to pull. Not published for MLB.",
            "default": "results"
          },
          "oddsMovementView": {
            "title": "Odds movement view",
            "enum": [
              "ats-results",
              "ats-opening",
              "ats-movement",
              "ou-results",
              "ou-opening",
              "ou-movement"
            ],
            "type": "string",
            "description": "Which line-movement study to pull. Not published for MLB.",
            "default": "ats-movement"
          },
          "teams": {
            "title": "Teams",
            "type": "array",
            "description": "Keep only rows whose team name or slug contains one of these, case-insensitive. Matches either side of a game for the odds and schedule datasets.",
            "items": {
              "type": "string"
            }
          },
          "minRank": {
            "title": "Min rank",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only rows ranked at or below this number (1 is best)."
          },
          "maxRank": {
            "title": "Max rank",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only rows ranked at or above this number. Set 10 to keep the top ten."
          },
          "minValue": {
            "title": "Min value",
            "type": "number",
            "description": "Keep rows whose headline value (the stat value, or the rating on rankings) is at least this. Decimals are supported."
          },
          "maxValue": {
            "title": "Max value",
            "type": "number",
            "description": "Keep rows whose headline value is at most this. Decimals are supported."
          },
          "search": {
            "title": "Free-text search",
            "type": "string",
            "description": "Keep only rows containing this text anywhere, case-insensitive. Useful for a player name or a venue."
          },
          "includeLineMovement": {
            "title": "Line movement",
            "type": "boolean",
            "description": "For odds and schedule rows: open / high / low / current for the spread, money line and total, plus the per-book history table. Three extra requests per game. Billed as line-movement.",
            "default": false
          },
          "includePowerRatings": {
            "title": "Matchup power ratings",
            "type": "boolean",
            "description": "Both teams' eleven power ratings side by side with their league ranks and the resulting edge. One extra request per game. Billed as matchup-power-ratings.",
            "default": false
          },
          "includeHeadToHead": {
            "title": "Head to head history",
            "type": "boolean",
            "description": "Every prior meeting since 2007 with score, who covered and the over/under result. One extra request per game. Billed as head-to-head.",
            "default": false
          },
          "includeInjuries": {
            "title": "Injury report",
            "type": "boolean",
            "description": "Player, position, injury, status and the written detail for both teams. One extra request per game. Not billed when both teams report no injuries. Billed as injury-report.",
            "default": false
          },
          "includeMatchupTrends": {
            "title": "Matchup trends",
            "type": "boolean",
            "description": "The situational records TeamRankings shows on the matchup trends tab. One extra request per game. Billed as matchup-trends.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on rows written, and therefore on what the run can bill. Leave empty for no cap."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on how many leaf pages a run fetches (stat pages, ranking pages, trend combinations, team pages). Guards against asking for all 226 NFL stat pages by accident.",
            "default": 40
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel requests. 5 is safe for any run — a full 226-page sweep completed on Apify with no throttling. TeamRankings can throttle a single IP that sweeps repeatedly; the run waits that out rather than dropping pages.",
            "default": 5
          },
          "timeoutSecs": {
            "title": "Time budget (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop issuing requests after this long and flush what has been collected. The run also respects the platform timeout when that is nearer.",
            "default": 1500
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional and off by default, and normally unnecessary: a full 226-page NFL stat sweep ran clean from an Apify container without one. Turn it on if you sweep a whole league repeatedly from the same IP, which can trip a multi-minute HTTP 403.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}