You need to show users a clean list of competitions (by sport and country) and wire it into your app this week. By the end of this guide, you’ll call a production endpoint that returns competition metadata (IDs, names, URLs, flags like hasStandings and hasStats), parse it, and plug it into your UI or backend workflow.
What you’ll build with the 365Scores API
The 365Scores API on Zyla API Hub returns structured sports data your application can immediately consume. For competition discovery, you’ll use an endpoint that fetches competitions for a given sport and country, including identifiers you’ll need to route users to standings, fixtures, or stats elsewhere in your stack.
Typical uses include:
- Country and league pickers in onboarding flows.
- Admin utilities to map competition IDs to internal content models.
- Cache warmers or CRON jobs to refresh the active list of competitions daily.
Getting started on Zyla API Hub
Open the API listing, subscribe, and grab your key:
- Visit the 365Scores API page on Zyla API Hub and click Subscribe or Start Free Trial.
- Copy your API key from the dashboard. All requests use Authorization: Bearer YOUR_API_KEY.
- Make your first call against the competition endpoint below.
Zyla API Hub aggregates more than 10,000 public APIs behind one account and one key. Usage is billed on a subscription with quotas (not pay-per-call). For this API, you can start a 7-day trial from the listing page: Start 7-day trial on 365Scores API.
Endpoint: Get competitions (by sport and country)
This endpoint returns competition data scoped by sport and country. You’ll use the IDs in your UI and store the names/flags to decide what to render (e.g., whether a league has standings or stats).
- Method: GET
- URL: https://zylalabs.com/api/13503/365scores-api/29728/get-competitions
- Required query parameters:
- sportId
- countryId
- langId
- timezone
- Authentication: Authorization: Bearer YOUR_API_KEY
cURL you can copy/paste
curl -s -X GET "https://zylalabs.com/api/13503/365scores-api/29728/get-competitions?sportId=1&countryId=11&langId=1&timezone=Europe%2FBerlin" \
-H "Authorization: Bearer YOUR_API_KEY"
Official JSON response
{
"sports": [
{
"id": 1,
"name": "Football",
"nameForURL": "football",
"drawSupport": true,
"imageVersion": 1
}
],
"countries": [
{
"id": 11,
"name": "Portugal",
"nameForURL": "portugal",
"sportTypes": [
2,
8,
1
],
"imageVersion": 1,
"isInternational": false
}
],
"competitions": [
{
"id": 73,
"countryId": 11,
"sportId": 1,
"name": "Liga Portugal",
"longName": "Portuguese Primeira Liga",
"hasStandings": true,
"hasBrackets": false,
"hasStats": true,
"hasTransfers": true,
"hasLiveStandings": false,
"hasStandingsGroups": false,
"hasBets": false,
"totalGames": 0,
"liveGames": 0,
"nameForURL": "liga-portugal",
"popularityRank": 10055229,
"tableName": "Standings",
"currentSeasonNum": 94,
"currentStageNum": 1,
"color": "#000925",
"competitorsType": 1,
"imageVersion": 7,
"hideOnCatalog": false,
"hideOnSearch": false,
"hasCurrentStageStandings": true,
"hasHistory": true,
"isActive": true
},
{
"id": 74,
"countryId": 11,
"sportId": 1,
"name": "Liga Portugal 2",
"shortName": "Liga Pro",
"hasStandings": true,
"hasBrackets": false,
"hasStats": true,
"hasTransfers": true,
"hasLiveStandings": false,
"hasStandingsGroups": false,
"hasBets": false,
"totalGames": 0,
"liveGames": 0,
"nameForURL": "liga-portugal-2",
"popularityRank": 650667,
"tableName": "Standings",
"currentSeasonNum": 38,
"currentStageNum": 1,
"color": "#186839",
"competitorsType": 1,
"imageVersion": 5,
"hideOnCatalog": false,
"hideOnSearch": false,
"hasCurrentStageStandings": true,
"hasHistory": true,
"isActive": true
},
{
"id": 75,
"countryId": 11,
"sportId"…
Fields you’ll actually use
- competitions[].id: Primary key you’ll store and pass around your system.
- competitions[].name and longName: Display strings for UI labels.
- competitions[].hasStandings, hasStats, hasTransfers: Gate UI features conditionally.
- competitions[].currentSeasonNum and currentStageNum: Context for season-aware views.
- competitions[].nameForURL: Useful for pretty URLs or slugs.
- sports[0] and countries[0]: Confirm the scope you requested (e.g., football in Portugal).
Note on timezones: the request includes timezone=Europe/Berlin. Keep it consistent across your calls so any downstream date/time fields you encounter from related endpoints remain aligned. The example above does not include timestamps, but using a stable timezone string is a good practice across your integration.
Python example: fetch and filter active competitions
The snippet below calls the same endpoint, enforces the Authorization header, and filters out inactive competitions before printing a compact payload you can hand to a front end.
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
URL = "https://zylalabs.com/api/13503/365scores-api/29728/get-competitions"
params = {
"sportId": "1",
"countryId": "11",
"langId": "1",
"timezone": "Europe/Berlin"
}
headers = {
"Authorization": f"Bearer {API_KEY}"
}
resp = requests.get(URL, params=params, headers=headers, timeout=30)
resp.raise_for_status()
data = resp.json()
competitions = data.get("competitions", [])
active = [c for c in competitions if c.get("isActive")]
# Minimal shape for your UI
result = [
{
"id": c["id"],
"name": c.get("name") or c.get("longName"),
"slug": c.get("nameForURL"),
"hasStandings": c.get("hasStandings"),
"hasStats": c.get("hasStats"),
"season": c.get("currentSeasonNum"),
"stage": c.get("currentStageNum")
}
for c in active
]
print({
"sport": (data.get("sports") or [{}])[0].get("name"),
"country": (data.get("countries") or [{}])[0].get("name"),
"count": len(result),
"competitions": result[:5] # preview top 5
})
Implementation notes that save time
- IDs are stable keys: store competitions[].id as your canonical reference. Names can change between seasons; slugs (nameForURL) are handy but not primary keys.
- Feature flags: hasStandings, hasStats, hasTransfers let you hide or show tabs without probing additional endpoints.
- Caching: country-level competition lists don’t change minute-to-minute. Cache for hours and invalidate when you deploy or on a daily schedule.
- Localization: use langId consistently for client language. If you support multiple locales, cache results per (sportId, countryId, langId).
- Timezones: keep timezone consistent across your app to avoid subtle differences in derived dates. Europe/Berlin is used in the example; pick one strategy and stick to it.
Step-by-step: wiring competition details into your app
1) Decide your scope
Pick sportId and countryId for your product launch scope. In the example above, sportId=1 (Football) and countryId=11 (Portugal). You can query different countries or sports by changing these IDs as needed in your integration.
2) Call the endpoint server-side
Send the Authorization: Bearer header from a secure backend. Avoid exposing YOUR_API_KEY in client-side code. The response includes sports, countries, and competitions arrays, which you can map to your page model.
3) Normalize and store
Persist competition id, name, slug, and flags. Most teams store a minimal row plus the raw JSON for debugging.
4) Render your UI
Show a country and league selector populated from your cache. Conditionally render tabs using the flags (e.g., show a “Standings” tab only when hasStandings is true).
5) Refresh on a schedule
Rebuild your cache at a cadence that fits your use case (e.g., daily). Track last-updated in metadata so you can troubleshoot quickly if a league list seems stale.
Related endpoints you might use next
If your competition view also links to player-focused pages, these endpoints return player details, matches, and stats. They’re separate from competition discovery, but often surface together in the same product areas.
Get player details
- Method: GET
- URL: https://zylalabs.com/api/13503/365scores-api/29748/get-player-details
- Params: playerId, langId, timezone
{
"sports": [
{
"id": 1,
"name": "Football",
"nameForURL": "football",
"drawSupport": true,
"imageVersion": 1
}
],
"countries": [
{
"id": 11,
"name": "Portugal",
"nameForURL": "portugal",
"sportTypes": [
2,
8,
1
],
"imageVersion": 1,
"isInternational": false
}
],
"competitions": [
{
"id": 73,
"countryId": 11,
"sportId": 1,
"name": "Liga Portugal",
"longName": "Portuguese Primeira Liga",
"hasStandings": true,
"hasBrackets": false,
"hasStats": true,
"hasTransfers": true,
"hasLiveStandings": false,
"hasStandingsGroups": false,
"hasBets": false,
"totalGames": 0,
"liveGames": 0,
"nameForURL": "liga-portugal",
"popularityRank": 10055229,
"tableName": "Standings",
"currentSeasonNum": 94,
"currentStageNum": 1,
"color": "#000925",
"competitorsType": 1,
"imageVersion": 7,
"hideOnCatalog": false,
"hideOnSearch": false,
"hasCurrentStageStandings": true,
"hasHistory": true,
"isActive": true
},
{
"id": 74,
"countryId": 11,
"sportId": 1,
"name": "Liga Portugal 2",
"shortName": "Liga Pro",
"hasStandings": true,
"hasBrackets": false,
"hasStats": true,
"hasTransfers": true,
"hasLiveStandings": false,
"hasStandingsGroups": false,
"hasBets": false,
"totalGames": 0,
"liveGames": 0,
"nameForURL": "liga-portugal-2",
"popularityRank": 650667,
"tableName": "Standings",
"currentSeasonNum": 38,
"currentStageNum": 1,
"color": "#186839",
"competitorsType": 1,
"imageVersion": 5,
"hideOnCatalog": false,
"hideOnSearch": false,
"hasCurrentStageStandings": true,
"hasHistory": true,
"isActive": true
},
{
"id": 75,
"countryId": 11,
"sportId"…
Get player matches
- Method: GET
- URL: https://zylalabs.com/api/13503/365scores-api/29749/get-player-matches
- Params: playerId, langId, timezone
Get player stats
- Method: GET
- URL: https://zylalabs.com/api/13503/365scores-api/29750/get-player-stats
- Params: playerId, langId, timezone
Calling the API from an AI agent via MCP
Every API on Zyla can be called from MCP-compatible clients (Claude Code, Cursor, Windsurf, etc.). Point your agent to the MCP endpoint and supply your key as a query parameter when configuring the tool host: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
Once configured, your agent can invoke the same competition endpoint you saw above with the required parameters. For documentation on MCP itself, see: MCP.
Common pitfalls and troubleshooting
- 401 errors: Ensure the Authorization header is exactly Authorization: Bearer YOUR_API_KEY with no extra spaces or schemes.
- Empty competitions array: Verify sportId and countryId are valid for your scope. Try a different pair if your initial combination isn’t returning leagues.
- Localization mismatch: If your UI is in a specific language, keep langId consistent across calls. Cache results per language.
- Timezone differences: Standardize timezone at the application level to avoid mixed UTC/local behaviors when you add other endpoints later.
Real-world integration patterns
- Server-rendered menus: On app boot, fetch competitions and render a league dropdown by country. Store only id, name, slug, and the feature flags.
- Batch ingest: Nightly job iterates the countries you support and refreshes competition data into your DB or KV store.
- Feature-gated pages: Don’t link to standings or stats if the API flags for a league say those resources aren’t available (hasStandings, hasStats).
- Deep linking: Use nameForURL to build human-readable slugs while routing by the numeric id behind the scenes.
FAQ
Can I change the sport and country?
Yes. Pass the appropriate sportId and countryId in the query string. The example uses Football in Portugal; update the IDs to match your scope.
Do I need to send an API key on every request?
Yes. Include Authorization: Bearer YOUR_API_KEY in every call from your server-side code.
How often should I refresh the competitions list?
Competition lists don’t change minute-to-minute. Most teams cache for hours or refresh daily. Choose a cadence aligned with your product’s needs.
What if I need player pages linked from a competition view?
Use the player endpoints shown above (details, matches, stats) to populate player-specific pages or modals. They are separate calls from competition discovery.
Is there a free plan?
Access options can change. Check the API page for current access options and pricing. You can start a 7-day trial from the marketplace listing.
Ready to ship competition details? Subscribe and get your key from the 365Scores API listing on Zyla API Hub: Start 7-day trial on 365Scores API. Then drop the cURL or Python sample into your backend, cache the results, and light up your UI.
Official API response
{
"sports": [
{
"id": 1,
"name": "Football",
"nameForURL": "football",
"drawSupport": true,
"imageVersion": 1
}
],
"countries": [
{
"id": 11,
"name": "Portugal",
"nameForURL": "portugal",
"sportTypes": [
2,
8,
1
],
"imageVersion": 1,
"isInternational": false
}
],
"competitions": [
{
"id": 73,
"countryId": 11,
"sportId": 1,
"name": "Liga Portugal",
"longName": "Portuguese Primeira Liga",
"hasStandings": true,
"hasBrackets": false,
"hasStats": true,
"hasTransfers": true,
"hasLiveStandings": false,
"hasStandingsGroups": false,
"hasBets": false,
"totalGames": 0,
"liveGames": 0,
"nameForURL": "liga-portugal",
"popularityRank": 10055229,
"tableName": "Standings",
"currentSeasonNum": 94,
"currentStageNum": 1,
"color": "#000925",
"competitorsType": 1,
"imageVersion": 7,
"hideOnCatalog": false,
"hideOnSearch": false,
"hasCurrentStageStandings": true,
"hasHistory": true,
"isActive": true
},
{
"id": 74,
"countryId": 11,
"sportId": 1,
"name": "Liga Portugal 2",
"shortName": "Liga Pro",
"hasStandings": true,
"hasBrackets": false,
"hasStats": true,
"hasTransfers": true,
"hasLiveStandings": false,
"hasStandingsGroups": false,
"hasBets": false,
"totalGames": 0,
"liveGames": 0,
"nameForURL": "liga-portugal-2",
"popularityRank": 650667,
"tableName": "Standings",
"currentSeasonNum": 38,
"currentStageNum": 1,
"color": "#186839",
"competitorsType": 1,
"imageVersion": 5,
"hideOnCatalog": false,
"hideOnSearch": false,
"hasCurrentStageStandings": true,
"hasHistory": true,
"isActive": true
},
{
"id": 75,
"countryId": 11,
"sportId"…