Teams
Retrieve the teams supported by the API.
- Coverage
- MLB and NCAA Division I
- Pagination
- Not paginated
Four filters narrow the list, and any of them works on its own.
| Parameter | Use it for |
|---|---|
league |
The league a team plays in, such as MLB or NCAA. |
abbreviation |
The short code you already show in a scoreboard, such as TEX. |
displayName |
The name as it is usually written out, such as Texas Rangers. |
name |
Checking whether a specific team is supported. |
Ids and abbreviations
Matches and
highlights also accept
homeTeamAbbreviation and awayTeamAbbreviation, so those two
can be filtered by a team's abbreviation without resolving its id first.
Ids are what head to head, last five games and team statistics expect, so resolve once here and store them.
Parameters
| Parameter | Type | Description |
|---|---|---|
leagueoptional |
string |
No description in the spec.e.g. MLB
|
nameoptional |
string |
No description in the spec.e.g. Rangers
|
displayNameoptional
|
string |
No description in the spec.e.g. Texas Rangers
|
abbreviationoptional
|
string |
No description in the spec.e.g. TEX
|
Request
curl --request GET \
--url 'https://baseball.highlightly.net/teams?league=MLB&name=Rangers' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
league: 'MLB',
name: 'Rangers'
})
const response = await fetch(`https://baseball.highlightly.net/teams?${params}`, {
headers: {
'x-rapidapi-key': process.env.HIGHLIGHTLY_API_KEY
}
})
if (!response.ok) {
throw new Error(`Highlightly responded ${response.status}`)
}
const data = await response.json()
import os
import requests
response = requests.get(
'https://baseball.highlightly.net/teams',
params={
'league': 'MLB',
'name': 'Rangers',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
idnumberrequired
logostring
namestring
displayNamestringrequired
abbreviationstringrequired
leaguestringrequired
Example response
[
{
"id": 219,
"logo": "https://example.com/logos/team/219.png",
"name": "Bears",
"displayName": "Baylor",
"abbreviation": "BAY",
"league": "NCAA"
}
]
Values are the examples declared in the OpenAPI spec, not a captured live response.
Errors
| Status | Description |
|---|---|
400 |
Bad request descriptive error. |
500 |
Internal server error. |