# MLB team with record and recent and next games API

Fetch an MLB team profile by ID or abbreviation via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as id, output, raw, and retrieve structured data including MLB team identifier, official team full name, short club abbreviation, team division name, and team league name to build club landing pages and automated data workflows.

Documentation: https://openany.si/mlb-stats/mlb-stats-mlb-team-with-record-and-recent-and-next-games-api/12ae437b-7741-4fb3-9270-9a175b077ada/
API ID: 12ae437b-7741-4fb3-9270-9a175b077ada
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/mlb/v1/team
Page update time: 2026-12-03T02:44:10.183Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:44:09.224Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## MLB Team Profile API

Pass id (numeric team ID such as 147 or abbreviation such as nyy, lad or bos) and optional season. The JSON response returns franchise names, logo, league, division, home venue, record summary, previous\_games\[\] and next\_games\[\].

## What You Can Build

- **Build club landing pages**: Combine franchise metadata, logo, venue, division and record in a single API call.
- **Show recent form and upcoming fixtures**: Render previous\_games\[\] scores and next\_games\[\] matchups without querying separate schedule calls.
- **Link into rosters and box scores**: Pass id to MLB Team Roster API and previous\_games\[\].id to MLB Game Box Score API.

## Returned Data

| Field | Meaning |
| --- | --- |
| `id` | MLB team identifier |
| `name` | Official team full name |
| `abbreviation` | Short club abbreviation |
| `division.name` | Team division name |
| `league.name` | Team league name |
| `venue.name` | Home ballpark name |
| `record` | Current or season team record summary |
| `previous_games[].id` | Recent game identifier (gamePk) |
| `previous_games[].home.score` | Home team score in a recent game |
| `next_games` | Upcoming scheduled games list |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MLB team with record and recent and next games API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Team id (147) or abbreviation (nyy, lad, bos ...)."
        },
        "season": {
          "type": "string",
          "description": "Season year."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      },
      "required": [
        "id"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "abbreviation": {
      "type": "string"
    },
    "active": {
      "type": "boolean"
    },
    "cached": {
      "type": "boolean"
    },
    "club_name": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "division": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "fetched_at": {
      "type": "string"
    },
    "first_year": {
      "type": "integer"
    },
    "franchise_name": {
      "type": "string"
    },
    "id": {
      "type": "integer"
    },
    "league": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "location": {
      "type": "string"
    },
    "logo": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "next_games": {
      "type": "array",
      "items": {}
    },
    "parent_org": {
      "type": "null"
    },
    "previous_games": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "abstract_state": {
            "type": "string"
          },
          "away": {
            "type": "object",
            "properties": {
              "is_winner": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "probable_pitcher": {
                "type": "null"
              },
              "record": {
                "type": "object",
                "properties": {
                  "losses": {
                    "type": "integer"
                  },
                  "pct": {
                    "type": "string"
                  },
                  "wins": {
                    "type": "integer"
                  }
                }
              },
              "score": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "series_number": {
                "type": "integer"
              },
              "team": {
                "type": "object",
                "properties": {
                  "abbreviation": {
                    "type": "null"
                  },
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "date": {
            "type": "string"
          },
          "day_night": {
            "type": "string"
          },
          "decisions": {
            "type": "null"
          },
          "double_header": {
            "type": "string"
          },
          "game_number": {
            "type": "integer"
          },
          "game_type": {
            "type": "string"
          },
          "games_in_series": {
            "type": "integer"
          },
          "home": {
            "type": "object",
            "properties": {
              "is_winner": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "probable_pitcher": {
                "type": "null"
              },
              "record": {
                "type": "object",
                "properties": {
                  "losses": {
                    "type": "integer"
                  },
                  "pct": {
                    "type": "string"
                  },
                  "wins": {
                    "type": "integer"
                  }
                }
              },
              "score": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "series_number": {
                "type": "integer"
              },
              "team": {
                "type": "object",
                "properties": {
                  "abbreviation": {
                    "type": "null"
                  },
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "id": {
            "type": "integer"
          },
          "linescore": {
            "type": "null"
          },
          "scheduled_innings": {
            "type": "integer"
          },
          "season": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "series_game_number": {
            "type": "integer"
          },
          "start_time": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "status_code": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "venue": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "record": {
      "type": "null"
    },
    "season": {
      "type": "integer"
    },
    "short_name": {
      "type": "string"
    },
    "sport_id": {
      "type": "integer"
    },
    "spring_league": {
      "type": "string"
    },
    "spring_venue": {
      "type": "integer"
    },
    "team_name": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "venue": {
      "type": "object",
      "properties": {
        "field": {
          "type": "object",
          "properties": {
            "capacity": {
              "type": "integer"
            },
            "center": {
              "type": "integer"
            },
            "leftCenter": {
              "type": "integer"
            },
            "leftLine": {
              "type": "integer"
            },
            "rightCenter": {
              "type": "integer"
            },
            "rightLine": {
              "type": "integer"
            },
            "roofType": {
              "type": "string"
            },
            "turfType": {
              "type": "string"
            }
          }
        },
        "id": {
          "type": "integer"
        },
        "location": {
          "type": "object",
          "properties": {
            "address1": {
              "type": "string"
            },
            "azimuthAngle": {
              "type": "integer"
            },
            "city": {
              "type": "string"
            },
            "country": {
              "type": "string"
            },
            "defaultCoordinates": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number"
                },
                "longitude": {
                  "type": "number"
                }
              }
            },
            "elevation": {
              "type": "integer"
            },
            "phone": {
              "type": "string"
            },
            "postalCode": {
              "type": "string"
            },
            "state": {
              "type": "string"
            },
            "stateAbbrev": {
              "type": "string"
            }
          }
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/mlb/v1/team?id=nyy&output=json&raw=0' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "abbreviation": "NYY",
  "active": true,
  "cached": false,
  "club_name": "Yankees",
  "credits_used": 1,
  "division": {
    "id": 201,
    "name": "American League East"
  },
  "fetched_at": "2026-11-19T12:22:12.202Z",
  "first_year": 1903,
  "franchise_name": "New York",
  "id": 147,
  "league": {
    "id": 103,
    "name": "American League"
  },
  "location": "Bronx",
  "logo": "https://www.mlbstatic.com/team-logos/147.svg",
  "name": "New York Yankees",
  "next_games": [],
  "parent_org": null,
  "previous_games": [
    {
      "abstract_state": "Final",
      "away": {
        "is_winner": false,
        "probable_pitcher": null,
        "record": {
          "losses": 62,
          "pct": ".608",
          "wins": 96
        },
        "score": 2,
        "series_number": 51,
        "team": {
          "abbreviation": null,
          "id": 139,
          "name": "Tampa Bay Rays"
        }
      },
      "date": "2026-09-23",
      "day_night": "night",
      "decisions": null,
      "double_header": "N",
      "game_number": 1,
      "game_type": "R",
      "games_in_series": 4,
      "home": {
        "is_winner": true,
        "probable_pitcher": null,
        "record": {
          "losses": 67,
          "pct": ".576",
          "wins": 91
        },
        "score": 9,
        "series_number": 51,
        "team": {
          "abbreviation": null,
          "id": 147,
          "name": "New York Yankees"
        }
      },
      "id": 823492,
      "linescore": null,
      "scheduled_innings": 9,
      "season": "2026",
      "series": "Regular Season",
      "series_game_number": 3,
      "start_time": "2026-09-23T23:05:00Z",
      "status": "Final",
      "status_code": "F",
      "url": "https://www.mlb.com/gameday/823492",
      "venue": {
        "id": 3313,
        "name": "Yankee Stadium"
      }
    },
    {
      "abstract_state": "Final",
      "away": {
        "is_winner": false,
        "probable_pitcher": null,
        "record": {
          "losses": 63,
          "pct": ".604",
          "wins": 96
        },
        "score": 4,
        "series_number": 51,
        "team": {
          "abbreviation": null,
          "id": 139,
          "name": "Tampa Bay Rays"
        }
      },
      "date": "2026-09-24",
      "day_night": "night",
      "decisions": null,
      "double_header": "N",
      "game_number": 1,
      "game_type": "R",
      "games_in_series": 4,
      "home": {
        "is_winner": true,
        "probable_pitcher": null,
        "record": {
          "losses": 67,
          "pct": ".579",
          "wins": 92
        },
        "score": 6,
        "series_number": 51,
        "team": {
          "abbreviation": null,
          "id": 147,
          "name": "New York Yankees"
        }
      },
      "id": 823493,
      "linescore": null,
      "scheduled_innings": 9,
      "season": "2026",
      "series": "Regular Season",
      "series_game_number": 4,
      "start_time": "2026-09-24T23:05:00Z",
      "status": "Final",
      "status_code": "F",
      "url": "https://www.mlb.com/gameday/823493",
      "venue": {
        "id": 3313,
        "name": "Yankee Stadium"
      }
    },
    {
      "abstract_state": "Final",
      "away": {
        "is_winner": true,
        "probable_pitcher": null,
        "record": {
          "losses": 81,
          "pct": ".494",
          "wins": 79
        },
        "score": 10,
        "series_number": 52,
        "team": {
          "abbreviation": null,
          "id": 110,
          "name": "Baltimore Orioles"
        }
      },
      "date": "2026-09-25",
      "day_night": "night",
      "decisions": null,
      "double_header": "Y",
      "game_number": 1,
      "game_type": "R",
      "games_in_series": 3,
      "home": {
        "is_winner": false,
        "probable_pitcher": null,
        "record": {
          "losses": 68,
          "pct": ".575",
          "wins": 92
        },
        "score": 2,
        "series_number": 52,
        "team": {
          "abbreviation": null,
          "id": 147,
          "name": "New York Yankees"
        }
      },
      "id": 823491,
      "linescore": null,
      "scheduled_innings": 9,
      "season": "2026",
      "series": "Regular Season",
      "series_game_number": 1,
      "start_time": "2026-09-25T20:05:00Z",
      "status": "Final",
      "status_code": "F",
      "url": "https://www.mlb.com/gameday/823491",
      "venue": {
        "id": 3313,
        "name": "Yankee Stadium"
      }
    },
    {
      "abstract_state": "Final",
      "away": {
        "is_winner": false,
        "probable_pitcher": null,
        "record": {
          "losses": 82,
          "pct": ".491",
          "wins": 79
        },
        "score": 3,
        "series_number": 52,
        "team": {
          "abbreviation": null,
          "id": 110,
          "name": "Baltimore Orioles"
        }
      },
      "date": "2026-09-25",
      "day_night": "night",
      "decisions": null,
      "double_header": "Y",
      "game_number": 2,
      "game_type": "R",
      "games_in_series": 3,
      "home": {
        "is_winner": true,
        "probable_pitcher": null,
        "record": {
          "losses": 68,
          "pct": ".578",
          "wins": 93
        },
        "score": 6,
        "series_number": 52,
        "team": {
          "abbreviation": null,
          "id": 147,
          "name": "New York Yankees"
        }
      },
      "id": 823489,
      "linescore": null,
      "scheduled_innings": 9,
      "season": "2026",
      "series": "Regular Season",
      "series_game_number": 2,
      "start_time": "2026-09-25T20:10:00Z",
      "status": "Final",
      "status_code": "F",
      "url": "https://www.mlb.com/gameday/823489",
      "venue": {
        "id": 3313,
        "name": "Yankee Stadium"
      }
    },
    {
      "abstract_state": "Final",
      "away": {
        "is_winner": null,
        "probable_pitcher": null,
        "record": {
          "losses": 82,
          "pct": ".491",
          "wins": 79
        },
        "score": null,
        "series_number": 52,
        "team": {
          "abbreviation": null,
          "id": 110,
          "name": "Baltimore Orioles"
        }
      },
      "date": "2026-09-27",
      "day_night": "day",
      "decisions": null,
      "double_header": "N",
      "game_number": 1,
      "game_type": "R",
      "games_in_series": 3,
      "home": {
        "is_winner": null,
        "probable_pitcher": null,
        "record": {
          "losses": 68,
          "pct": ".578",
          "wins": 93
        },
        "score": null,
        "series_number": 52,
        "team": {
          "abbreviation": null,
          "id": 147,
          "name": "New York Yankees"
        }
      },
      "id": 823490,
      "linescore": null,
      "scheduled_innings": 9,
      "season": "2026",
      "series": "Regular Season",
      "series_game_number": 3,
      "start_time": "2026-09-27T17:05:00Z",
      "status": "Cancelled",
      "status_code": "CR",
      "url": "https://www.mlb.com/gameday/823490",
      "venue": {
        "id": 3313,
        "name": "Yankee Stadium"
      }
    }
  ],
  "record": null,
  "season": 2026,
  "short_name": "NY Yankees",
  "sport_id": 1,
  "spring_league": "Grapefruit League",
  "spring_venue": 2523,
  "team_name": "Yankees",
  "url": "https://www.mlb.com/yankees",
  "venue": {
    "field": {
      "capacity": 46537,
      "center": 408,
      "leftCenter": 399,
      "leftLine": 318,
      "rightCenter": 385,
      "rightLine": 314,
      "roofType": "Open",
      "turfType": "Grass"
    },
    "id": 3313,
    "location": {
      "address1": "One East 161st Street",
      "azimuthAngle": 75,
      "city": "Bronx",
      "country": "USA",
      "defaultCoordinates": {
        "latitude": 40.82919482,
        "longitude": -73.9264977
      },
      "elevation": 55,
      "phone": "(718) 293-4300",
      "postalCode": "10451",
      "state": "New York",
      "stateAbbrev": "NY"
    },
    "name": "Yankee Stadium"
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Can I look up a team using its abbreviation like nyy or lad?
Yes. The id parameter accepts either a numeric team ID (such as 147) or an abbreviation (such as nyy, lad or bos).

### Does this endpoint include recent and upcoming games?
Yes. It returns previous_games[] and next_games[] arrays alongside team profile metadata and record.

### Why might next_games be empty?
During the offseason or after a club's final scheduled game of the season, next_games[] can return an empty array.

### How do I get the club's full active roster?
Pass the team's ID or abbreviation to the MLB Team Roster API.

### Can I query a club's profile for a past season?
Yes. Pass the optional season year parameter to inspect that season's club context.

### How do caching and response trimming work?
Pass fresh=1 to skip the 24-hour cache, raw=0 to omit bulky raw blocks and fields to select specific keys.

## Available implementations
- apish: https://openany.si/mlb-stats/mlb-stats-mlb-team-with-record-and-recent-and-next-games-api/12ae437b-7741-4fb3-9270-9a175b077ada/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
