Frank's Sports Betting
Frank's Sports Betting · GPT Actions
Live Sports Odds API
This API provides access to live and historical sports odds, scores, and data for various sports events.
GET /sportsRetrieve a list of in-season sports.GET /sports/{sport}/oddsRetrieve odds for upcoming and live games.GET /sports/{sport}/scoresGet scores for a specific sport.
原始 API 定义
{
"openapi": "3.1.0",
"info": {
"title": "Live Sports Odds API",
"description": "This API provides access to live and historical sports odds, scores, and data for various sports events.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://odds.p.rapidapi.com/v4"
}
],
"paths": {
"/sports": {
"get": {
"summary": "Retrieve a list of in-season sports.",
"operationId": "getSports",
"parameters": [
{
"name": "all",
"in": "query",
"required": false,
"description": "Set to true to return both in and out of season sports.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "An array of in-season sports.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SportData"
}
}
}
}
}
}
}
},
"/sports/{sport}/odds": {
"get": {
"summary": "Retrieve odds for upcoming and live games.",
"operationId": "getOdds",
"parameters": [
{
"name": "sport",
"in": "path",
"required": true,
"description": "The specific sport to retrieve odds for.",
"schema": {
"type": "string"
}
},
{
"name": "regions",
"in": "query",
"required": true,
"description": "The regions for which to retrieve odds, e.g., 'us'.",
"schema": {
"type": "string"
}
},
{
"name": "markets",
"in": "query",
"required": true,
"description": "The betting markets to retrieve odds for, e.g., 'h2h,spreads'.",
"schema": {
"type": "string"
}
},
{
"name": "dateFormat",
"in": "query",
"required": false,
"description": "The format of the dates in the response, e.g., 'iso'.",
"schema": {
"type": "string"
}
},
{
"name": "oddsFormat",
"in": "query",
"required": false,
"description": "The format in which the odds will be returned, e.g., 'decimal'.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Odds data for the specified sport.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OddsData"
}
}
}
}
}
}
}
},
"/sports/{sport}/scores": {
"get": {
"summary": "Get scores for a specific sport.",
"operationId": "getSportScores",
"parameters": [
{
"name": "sport",
"in": "path",
"required": true,
"description": "The sport key obtained from calling the /sports endpoint.",
"schema": {
"type": "string"
}
},
{
"name": "apiKey",
"in": "query",
"required": true,
"description": "An API key is emailed when you sign up to a plan.",
"schema": {
"type": "string"
}
},
{
"name": "daysFrom",
"in": "query",
"required": false,
"description": "Optional - The number of days in the past from which to return completed games. If this parameter is missing, only live and upcoming games are returned.",
"schema": {
"type": "integer"
}
},
{
"name": "dateFormat",
"in": "query",
"required": false,
"description": "Optional - Determines the format of timestamps in the response.",
"schema": {
"type": "string"
}
},
{
"name": "eventIds",
"in": "query",
"required": false,
"description": "Optional - Comma-separated game ids.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Scores data for the specified sport.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ScoresData"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"SportData": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the sport."
},
"name": {
"type": "string",
"description": "Name of the sport."
},
"details": {
"type": "string",
"description": "Detailed information about the sport."
}
}
},
"OddsData": {
"type": "object",
"properties": {
"sportKey": {
"type": "string",
"description": "Unique identifier for the sport event."
},
"odds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "number"
}
}
}
}
},
"required": [
"sportKey",
"odds"
]
},
"ScoresData": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the game."
},
"sport_key": {
"type": "string",
"description": "Key of the sport for the game."
},
"sport_title": {
"type": "string",
"description": "Title of the sport."
},
"commence_time": {
"type": "string",
"format": "date-time",
"description": "Start time of the game."
},
"completed": {
"type": "boolean",
"description": "Whether the game has completed."
},
"home_team": {
"type": "string",
"description": "Name of the home team."
},
"away_team": {
"type": "string",
"description": "Name of the away team."
},
"scores": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"score": {
"type": "string"
}
}
}
},
"last_update": {
"type": "string",
"format": "date-time",
"description": "Time of the last update to the game's data."
}
}
}
},
"securitySchemes": {
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "X-RapidAPI-Key"
}
}
},
"security": [
{
"ApiKeyAuth": []
}
]
}