You need league details for a sports app this week: league IDs, league names, and how they connect to teams and players. By the end of this guide, you’ll be able to query the FotMob API on Zyla API Hub to search for leagues, pull team profiles that include league context, and map user timezones for better scheduling UX—all with copy-pasteable requests.
What this API does and how it helps you ship
The FotMob API provides structured football data that working developers can drop straight into production. In the context of “league details,” you can:
- Discover leagues by name and retrieve their IDs using the Search endpoint (it returns leagueId and leagueName on matching entities).
- Fetch team details, which include general metadata and league context (as described by the endpoint).
- Resolve and present timezones for users when showing match times or schedules.
Typical use cases include: building team and league pickers, connecting squads to their competitions, and normalizing event times across user locales.
Getting started on Zyla API Hub
Open the FotMob API page on Zyla API Hub, click Subscribe or Start Free Trial if available, and generate an API key. Authentication is via the HTTP header Authorization: Bearer YOUR_API_KEY. Billing is subscription + quota (not pay-per-call). For the first API, you can start a 7-day trial on the listing page; check the API page for current access options and pricing.
Every request in this article uses the Zyla API Hub execution URL. Do not use any origin host—you can call directly from your backend with your single Zyla API key.
Core endpoints you’ll use
Below are the endpoints relevant to building league-centric features. Each is a GET and requires the Authorization header.
Search teams, players and leagues
Method: GET
URL: https://zylalabs.com/api/13505/fotmob-api/29856/search-teams-players-and-leagues
Purpose: Returns search suggestions for teams, players and leagues matching the query. For league-driven workflows, this is where you capture leagueId and leagueName from results associated to teams or matches.
Required params:
- q (string): the search query
Copy-paste cURL (searching for “arsenal”):
curl -s -X GET "https://zylalabs.com/api/13505/fotmob-api/29833/get-timezones" \
-H "Authorization: Bearer YOUR_API_KEY"
Use this to quickly locate a leagueId and leagueName you’ll store or use to filter downstream data. The search response includes entries like:
[
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
"Africa/Bissau",
"Africa/Blantyre",
"Africa/Brazzaville",
"Africa/Bujumbura",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Africa/Conakry",
"Africa/Dakar",
"Africa/Dar_es_Salaam",
"Africa/Djibouti",
"Africa/Douala",
"Africa/El_Aaiun",
"Africa/Freetown",
"Africa/Gaborone",
"Africa/Harare",
"Africa/Johannesburg",
"Africa/Juba",
"Africa/Kampala",
"Africa/Khartoum",
"Africa/Kigali",
"Africa/Kinshasa",
"Africa/Lagos",
"Africa/Libreville",
"Africa/Lome",
"Africa/Luanda",
"Africa/Lubumbashi",
"Africa/Lusaka",
"Africa/Malabo",
"Africa/Maputo",
"Africa/Maseru",
"Africa/Mbabane",
"Africa/Mogadishu",
"Africa/Monrovia",
"Africa/Nairobi",
"Africa/Ndjamena",
"Africa/Niamey",
"Africa/Nouakchott",
"Africa/Ouagadougou",
"Africa/Porto-Novo",
"Africa/Sao_Tome",
"Africa/Tripoli",
"Africa/Tunis",
"Africa/Windhoek",
"America/Adak",
"America/Anchorage",
"America/Anguilla",
"America/Antigua",
"America/Araguaina",
"America/Argentina/Buenos_Aires",
"America/Argentina/Catamarca",
"America/Argentina/Cordoba",
"America/Argentina/Jujuy",
"America/Argentina/La_Rioja",
"America/Argentina/Mendoza",
"America/Argentina/Rio_Gallegos",
"America/Argentina/Salta",
"America/Argentina/San_Juan",
"America/Argentina/San_Luis",
"America/Argentina/Tucuman",
"America/Argentina/Ushuaia",
"America/Aruba",
"America/Asuncion",
"America/Atikokan",
"America/Bahia",
"America/Bahia_Banderas",
"America/Barbados",
"America/Belem",
"America/Belize",
"America/Blanc-Sablon",
"America/Boa_Vista",
"America/Bogota",
"America/Boise",
"America/Cambridge_Bay",
"America/Campo_Grande",
"America/Cancun",
"America/Caracas",
"America/Cayenne",
"America/Cayman",
"America/Chicago",
"America/Chihuahua",
"America/Ciudad_Juarez",
"America/Costa_Rica",
"America/Coyhaique",
"America/Creston",
"America/Cuiaba",
"America/Curacao",
"America/Danmarkshavn",
"America/Dawson",
"America/Dawson_Creek",
"America/Denver",
"America/Detroit",
"America/Dominica",
"America/Edmonton",
"America…
From these suggestions, you can extract leagueId and leagueName for team or match contexts, which is often all you need to filter or link content by competition.
Get team details
Method: GET
URL: https://zylalabs.com/api/13505/fotmob-api/29857/get-team-details
Purpose: Returns the general details (name, country, league, links) for a team. Use it to confirm a team’s league context and show canonical names in your UI.
Required params:
- team_id (string): the team identifier
Example request (for team_id 8634):
The response contains general team metadata. Use it to align team records with the league you discovered from Search. Because the example below is authoritative, keep its field names and types as-is when modeling your integration:
{
"id": 8634,
"type": "team",
"name": "Barcelona",
"latestSeason": "2026/2027",
"shortName": "Barcelona",
"country": "ESP",
"gender": "male",
"faqJSONLD": {
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "When is Barcelona's next match?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Barcelona's next match is at 15:30 BST on Sun, 16 Aug 2026 against Basel."
}
},
{
"@type": "Question",
"name": "Where is Barcelona's stadium?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Barcelona stadium is located in Barcelona and is called Spotify Camp Nou."
}
},
{
"@type": "Question",
"name": "What is the capacity of Spotify Camp Nou?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The capacity for Spotify Camp Nou is 99787."
}
}…
Practical notes:
- Use latestSeason to scope your UI by season (e.g., filter rosters or fixtures you hold elsewhere by that season string).
- Store country and gender if you let users filter by region or competition type.
Get player details
Method: GET
URL: https://zylalabs.com/api/13505/fotmob-api/29855/get-player-details
Purpose: Returns the player profile (bio, current team, traits and career data). When building league views, link a player’s primaryTeam to a team, then derive its league context using team or search data.
Required params:
- player_id (string): the player identifier
Example request (for player_id 961995):
Sample response (truncated to key fields you’ll wire up):
{
"id": 961995,
"name": "Bukayo Saka",
"birthDate": {
"utcTime": "2001-09-05T00:00:00.000Z",
"timezone": "UTC"
},
"contractEnd": {
"utcTime": "2030-06-30T00:00:00.000Z",
"timezone": "UTC"
},
"isCoach": false,
"isCaptain": false,
"gender": "male",
"primaryTeam": {
"teamId": 9825,
"teamName": "Arsenal",
"onLoan": false,
"teamColors": {
"color": "#bd0510",
"colorAlternate": "#bd0510",
"colorAway": "#101010",
"colorAwayAlternate": "#ffffff"
}
},
"positionDescription": {
"positions": [
{
"strPos": {
"label": "Right Winger",
"key": "rightwinger"
},
"strPosShort": {
"label": "RW",
"key": "rightwinger_short"
},
"occurences": 41,
"position": "82",
"isMainPosition": true,
"pitchPositionData": {
"right": 0.83,
"top": 0.26
}
},…
Practical notes:
- Use primaryTeam.teamId to connect players to the team record you got from team details or search suggestions.
- Time fields use UTC; convert using your user’s timezone preference.
Get timezones (official example)
Method: GET
URL: https://zylalabs.com/api/13505/fotmob-api/29833/get-timezones
Purpose: Returns supported timezone identifiers. Use this to present a safe, whitelisted list for user settings or to map scheduled match times.
Official cURL:
Official JSON response:
[
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
"Africa/Bissau",
"Africa/Blantyre",
"Africa/Brazzaville",
"Africa/Bujumbura",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Africa/Conakry",
"Africa/Dakar",
"Africa/Dar_es_Salaam",
"Africa/Djibouti",
"Africa/Douala",
"Africa/El_Aaiun",
"Africa/Freetown",
"Africa/Gaborone",
"Africa/Harare",
"Africa/Johannesburg",
"Africa/Juba",
"Africa/Kampala",
"Africa/Khartoum",
"Africa/Kigali",
"Africa/Kinshasa",
"Africa/Lagos",
"Africa/Libreville",
"Africa/Lome",
"Africa/Luanda",
"Africa/Lubumbashi",
"Africa/Lusaka",
"Africa/Malabo",
"Africa/Maputo",
"Africa/Maseru",
"Africa/Mbabane",
"Africa/Mogadishu",
"Africa/Monrovia",
"Africa/Nairobi",
"Africa/Ndjamena",
"Africa/Niamey",
"Africa/Nouakchott",
"Africa/Ouagadougou",
"Africa/Porto-Novo",
"Africa/Sao_Tome",
"Africa/Tripoli",
"Africa/Tunis",
"Africa/Windhoek",
"America/Adak",
"America/Anchorage",
"America/Anguilla",
"America/Antigua",
"America/Araguaina",
"America/Argentina/Buenos_Aires",
"America/Argentina/Catamarca",
"America/Argentina/Cordoba",
"America/Argentina/Jujuy",
"America/Argentina/La_Rioja",
"America/Argentina/Mendoza",
"America/Argentina/Rio_Gallegos",
"America/Argentina/Salta",
"America/Argentina/San_Juan",
"America/Argentina/San_Luis",
"America/Argentina/Tucuman",
"America/Argentina/Ushuaia",
"America/Aruba",
"America/Asuncion",
"America/Atikokan",
"America/Bahia",
"America/Bahia_Banderas",
"America/Barbados",
"America/Belem",
"America/Belize",
"America/Blanc-Sablon",
"America/Boa_Vista",
"America/Bogota",
"America/Boise",
"America/Cambridge_Bay",
"America/Campo_Grande",
"America/Cancun",
"America/Caracas",
"America/Cayenne",
"America/Cayman",
"America/Chicago",
"America/Chihuahua",
"America/Ciudad_Juarez",
"America/Costa_Rica",
"America/Coyhaique",
"America/Creston",
"America/Cuiaba",
"America/Curacao",
"America/Danmarkshavn",
"America/Dawson",
"America/Dawson_Creek",
"America/Denver",
"America/Detroit",
"America/Dominica",
"America/Edmonton",
"America…
Use these identifiers with any datetime library to convert match or contract UTC timestamps for display.
How to assemble “league details” with the available endpoints
While there isn’t a dedicated “get league details” endpoint, you can derive the essential pieces for most production UIs:
- Search by team or league keyword with the Search endpoint and capture leagueId and leagueName from suggestions.
- Optionally enrich context by fetching team details for relevant teams; the team profile includes general details and league context.
- Link players to teams via primaryTeam.teamId (from player details) when building squad lists filtered by league.
- Localize times using the timezones endpoint plus any utcTime fields found in player or search match metadata.
Code example: search leagues by keyword (Python)
This example calls the Search endpoint, then extracts leagueId/leagueName pairs from the suggestions. It mirrors the cURL shown earlier.
import os
import requests
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
q = "arsenal"
url = "https://zylalabs.com/api/13505/fotmob-api/29856/search-teams-players-and-leagues"
headers = {"Authorization": f"Bearer {API_KEY}"}
params = {"q": q}
resp = requests.get(url, headers=headers, params=params, timeout=30)
resp.raise_for_status()
data = resp.json()
league_refs = []
for block in data:
for s in block.get("suggestions", []):
# Suggestions can be team, player, match, league (varies).
# We only collect entries that expose leagueId/leagueName.
league_id = s.get("leagueId")
league_name = s.get("leagueName")
if league_id is not None and league_name is not None:
league_refs.append({"leagueId": league_id, "leagueName": league_name})
# Deduplicate while preserving order
seen = set()
unique_leagues = []
for item in league_refs:
key = (item["leagueId"], item["leagueName"])
if key not in seen:
seen.add(key)
unique_leagues.append(item)
print(unique_leagues)
Tips:
- Cache results by query q for a short TTL (e.g., a few hours) if you render a search-as-you-type UI.
- leagueId is numeric in the sample; store it as an integer in your DB to avoid type mismatches.
Practical implementation details
- Authentication: set Authorization: Bearer YOUR_API_KEY on every call.
- Timestamps: utcTime values are in UTC. Convert using a supported timezone from the timezones endpoint or your own map.
- Caching: search endpoints are good candidates for short-lived caches to avoid re-querying on the same input.
- Quotas: billing is subscription + quota, not pay-per-call. The first API offers a 7-day trial on the item page; check the listing for current limits before load testing.
- Error handling: treat non-2xx responses as transient (retry with backoff) or validation errors (surface to the user) depending on context.
Real-world use cases
- League picker: Use the Search endpoint to populate a dropdown with leagueName/leagueId pairs as the user types. Persist leagueId for later filtering.
- Team directory by league: After the user selects a league from search results, show teams known to map to that league. Use team details to confirm identity and metadata (name, country, latestSeason).
- Squad explorer: Fetch player details, link by primaryTeam.teamId, and show only players whose teams belong to the league the user selected.
- Time-aware schedules: If you also show upcoming matches from your own store, present matchDate and utcTime alongside a timezone from get-timezones so users see localized kickoff times.
Calling the API from AI agents via MCP
If you’re working inside an MCP-compatible client (e.g., Claude Code, Cursor, Windsurf), you can route calls to the same endpoints through the Zyla MCP endpoint:
Provide your Zyla API key when configuring the MCP tool so your agent can call FotMob API endpoints using the same authorization. This keeps your IDE/agent workflows and server code on the same data contract.
End-to-end flow to get league details this week
- Subscribe on the FotMob API listing and grab your API key.
- Implement a simple search box that calls the Search endpoint and captures leagueId/leagueName from suggestions.
- Store the selected leagueId. Optionally fetch team details for teams you’ll display under that league.
- When you show players or matches, derive league context through their related team or via the search suggestions you already have.
- Use the timezones endpoint to render user-local times for events with utcTime fields.
FAQ
How do I obtain a leagueId?
Use the Search endpoint with a query string (e.g., a league or team name). The suggestions array includes leagueId and leagueName for matching entities.
Can I fetch a league profile directly?
A dedicated “league details” endpoint is not listed here. Derive league information via Search (leagueId, leagueName) and team details for context.
What timezone are datetime fields in?
UTC. Convert using a timezone from the get-timezones endpoint and your user’s preference.
Is there a free plan?
No free plan is indicated. Billing is subscription + quota. The FotMob API listing offers a 7-day trial; check the item page for current access options.
How do I authenticate?
Send Authorization: Bearer YOUR_API_KEY on every request to the Zyla API Hub endpoints.
Ready to wire this up? Create your account, get your key, and start building with the FotMob API. The 7-day trial begins on the item page: Start 7-day trial on FotMob API. Zyla API Hub aggregates more than 10,000 public APIs under one key, so you can add the next integration without changing your auth flow.
Official API response
[
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
"Africa/Bissau",
"Africa/Blantyre",
"Africa/Brazzaville",
"Africa/Bujumbura",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Africa/Conakry",
"Africa/Dakar",
"Africa/Dar_es_Salaam",
"Africa/Djibouti",
"Africa/Douala",
"Africa/El_Aaiun",
"Africa/Freetown",
"Africa/Gaborone",
"Africa/Harare",
"Africa/Johannesburg",
"Africa/Juba",
"Africa/Kampala",
"Africa/Khartoum",
"Africa/Kigali",
"Africa/Kinshasa",
"Africa/Lagos",
"Africa/Libreville",
"Africa/Lome",
"Africa/Luanda",
"Africa/Lubumbashi",
"Africa/Lusaka",
"Africa/Malabo",
"Africa/Maputo",
"Africa/Maseru",
"Africa/Mbabane",
"Africa/Mogadishu",
"Africa/Monrovia",
"Africa/Nairobi",
"Africa/Ndjamena",
"Africa/Niamey",
"Africa/Nouakchott",
"Africa/Ouagadougou",
"Africa/Porto-Novo",
"Africa/Sao_Tome",
"Africa/Tripoli",
"Africa/Tunis",
"Africa/Windhoek",
"America/Adak",
"America/Anchorage",
"America/Anguilla",
"America/Antigua",
"America/Araguaina",
"America/Argentina/Buenos_Aires",
"America/Argentina/Catamarca",
"America/Argentina/Cordoba",
"America/Argentina/Jujuy",
"America/Argentina/La_Rioja",
"America/Argentina/Mendoza",
"America/Argentina/Rio_Gallegos",
"America/Argentina/Salta",
"America/Argentina/San_Juan",
"America/Argentina/San_Luis",
"America/Argentina/Tucuman",
"America/Argentina/Ushuaia",
"America/Aruba",
"America/Asuncion",
"America/Atikokan",
"America/Bahia",
"America/Bahia_Banderas",
"America/Barbados",
"America/Belem",
"America/Belize",
"America/Blanc-Sablon",
"America/Boa_Vista",
"America/Bogota",
"America/Boise",
"America/Cambridge_Bay",
"America/Campo_Grande",
"America/Cancun",
"America/Caracas",
"America/Cayenne",
"America/Cayman",
"America/Chicago",
"America/Chihuahua",
"America/Ciudad_Juarez",
"America/Costa_Rica",
"America/Coyhaique",
"America/Creston",
"America/Cuiaba",
"America/Curacao",
"America/Danmarkshavn",
"America/Dawson",
"America/Dawson_Creek",
"America/Denver",
"America/Detroit",
"America/Dominica",
"America/Edmonton",
"America…