You need live sports data wired into your Python app this week, without wrestling multiple providers, keys, or docs. By the end of this guide you’ll search FlashScore entities (teams, players, tournaments), list supported sports, and fetch countries/competitions for a sport using the FlashScore - Live API on Zyla API Hub—complete with copy-pasteable cURL and Python code that you can drop into production.
What you can build with FlashScore - Live API
The FlashScore - Live API provides programmatic access to FlashScore’s structured sports directory: search entities by name, enumerate supported sports, and list countries/competitions for a sport. This is ideal for:
- Onboarding flows where users pick a team or competition and you store its canonical ID.
- Autocomplete for teams or tournaments in a sportsbook, score app, or CMS.
- Discovery features (browse sports, then narrow to countries/competitions).
Because it’s on Zyla API Hub, you use one account, one API key, and a subscription + quota model across all your integrations—no per-call pricing.
Getting started on Zyla API Hub
Open the listing for the API here: FlashScore - Live API. Click Subscribe (or Start Free Trial when available) to get your API key. This API uses subscription + quota (not pay-per-call). The first API offers a 7-day trial or 50 requests. No Free Plan is available. For current access options and quotas, always confirm on the API page before deploying.
All requests require an Authorization header:
- Authorization: Bearer YOUR_API_KEY
Endpoints you’ll use
Below are the available paths on this listing, exactly as documented on Zyla API Hub. Do not add body parameters—these are simple GETs with query strings where specified.
1) Search
Search FlashScore entities (teams, players, tournaments) by query string.
- Method: GET
- URL: https://zylalabs.com/api/12518/flashscore-live-api/23852/search
- Params:
- q (string, required): the search term (example: real madrid)
cURL
curl -s -X GET "https://zylalabs.com/api/12518/flashscore-live-api/23852/search?q=real+madrid" \
-H "Authorization: Bearer YOUR_API_KEY"
JSON response
[{"id":"W8mj7MDD","type":"team","name":"Real Madrid","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/E99TZ05n-ttfpEDUq.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"SlAdQJK4","type":"team","name":"Real Madrid U19","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/IgG3LUAK-xGwa4c2B.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"MP6gLUO7","type":"team","name":"Real Madrid","url":"real-madrid","sport":{"id":3,"name":"Basketball"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/pn8TQOkQ-bXlcmj9T.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"2anA8FkF","type":"team","name":"Real Madrid U21","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/p048BCQt-SKpsUss3.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"4xlfVfnP","type":"team","name":"Real Madrid W","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Women","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/4CKmt8Rt-WpmKUEXD.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"fyNss8GQ","type":"team","name":"Real Madrid B","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/f5FO93Tc-ltKPQjEk.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"46uFRv4a","type":"team","name":"Real Madrid C","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/bupmbK6n-QkBtimSf.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"UiUgFWdq","type":"team","name":"Real Madrid U20","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flash…
What to use in your app:
- id: the canonical FlashScore identifier for the entity you’ll store.
- type: entity kind (e.g., team) to filter the UI options.
- name, gender, country_name: presentable metadata for dropdowns and labels.
- sport.id and sport.name: constrain subsequent flows (e.g., country lists per sport).
- image_path and country_image_path: optional icons/crests in your UI.
2) Get sports
Returns a list of all available sports supported.
- Method: GET
- URL: https://zylalabs.com/api/12518/flashscore-live-api/23853/get-sports
- Params: none documented.
cURL
The response is a list of sports objects including sport_id, sport_url, and name (e.g., Football, Tennis, Basketball). Use sport_id when calling Get countries.
3) Get countries
Returns a list of countries for a specific sport.
- Method: GET
- URL: https://zylalabs.com/api/12518/flashscore-live-api/23854/get-countries
- Params:
- sport_id (string, required): example 2
cURL
The response includes country_id, country_url, and name for the specified sport. For Tennis (sport_id 2), entries include ATP/WTA singles and doubles, exhibition tours, and more. Use these to populate competition filters or build navigation to tournaments within a sport.
Python: search and normalize entities
The snippet below calls the Search path on the same listing, reads core fields, and normalizes results for storage and UI display. It uses the documented Authorization header and the real query parameter q=real+madrid.
Python
import os
import sys
import requests
API_KEY = os.getenv("ZYLA_API_KEY", "YOUR_API_KEY")
BASE_URL = "https://zylalabs.com/api/12518/flashscore-live-api"
def search_entities(query: str):
url = f"{BASE_URL}/23852/search"
params = {"q": query}
headers = {"Authorization": f"Bearer {API_KEY}"}
try:
resp = requests.get(url, headers=headers, params=params, timeout=15)
resp.raise_for_status()
except requests.RequestException as e:
print(f"HTTP error: {e}", file=sys.stderr)
return []
try:
data = resp.json()
except ValueError:
print("Non-JSON response", file=sys.stderr)
return []
# Normalize only the fields we plan to store/display
normalized = []
for item in data:
sport = item.get("sport") or {}
normalized.append({
"id": item.get("id"),
"type": item.get("type"),
"name": item.get("name"),
"sport_id": sport.get("id"),
"sport_name": sport.get("name"),
"gender": item.get("gender"),
"country_name": item.get("country_name"),
"image_path": item.get("image_path"),
"country_image_path": item.get("country_image_path"),
"slug": item.get("url"),
})
return normalized
if __name__ == "__main__":
results = search_entities("real madrid")
for r in results[:5]:
print(f"{r['id']} | {r['type']} | {r['name']} | {r['sport_name']} | {r['country_name']}")
Notes that save you time:
- Timeouts: set a client timeout (above uses 15s) to avoid hanging requests.
- Empty results: the API can validly return an empty list; handle it in your UI.
- Caching: these are GET requests; you can cache by query string for short TTLs to cut latency and quota usage.
Practical integration patterns
Search-driven onboarding
Flow: user types in a team → you call Search with q, show top matches with badges from image_path and country_image_path → store id + type + sport_id. This lets you preconfigure alerts, sections, or widgets bound to that canonical id.
Sport → country navigation
Flow: call Get sports to populate a sport select, then call Get countries with sport_id when the user picks a sport. Use country_id and name values to build your competition filters. For tennis, entries reflect tours and competition groupings (e.g., ATP/WTA singles/doubles).
Autocomplete microservice
Wrap the Search endpoint with a small cache (e.g., 60–300 seconds per query) and return a minimal JSON of {id, type, name, sport_name, country_name}. This keeps your frontends fast and consistent across web and mobile.
Working with the API from AI agents (MCP)
Every Zyla API is callable from AI coding agents and MCP-compatible clients (Claude Code, Cursor, Windsurf, etc.) using the MCP endpoint. Configure your client to reach:
- https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
Your agent can then make the same GET requests to the paths shown above on this listing. For guidance on wiring MCP clients, see the MCP reference.
Error handling, quotas, and deployment tips
- Authorization: All calls require Authorization: Bearer YOUR_API_KEY. Keep keys in server-side config or secret managers.
- HTTP methods: All documented paths here are GET. Do not send a body; use query string parameters exactly as listed.
- Quotas: This API is subscription + quota. The first API offers a 7-day trial or 50 requests and has no Free Plan. Confirm your current quota on the API page before load testing.
- Pagination: Not documented on these endpoints. Expect full arrays for your filters and search; add client-side pagination if needed.
- Resilience: Implement retries with backoff for transient 5xx responses. Do not retry 4xx without code changes.
- Observability: Log request method, URL, and status code—not the key. For debugging, dump response headers and the first N bytes of the body.
End-to-end example: browse to tennis tours then search
- List sports:
- GET https://zylalabs.com/api/12518/flashscore-live-api/23853/get-sports (Authorization header only)
- Extract the entry with name Tennis, read sport_id (2 in the sample response set).
- List countries/competitions for Tennis:
- GET https://zylalabs.com/api/12518/flashscore-live-api/23854/get-countries?sport_id=2
- Render ATP/WTA sections in your UI using name and country_id.
- Search specific entities:
- GET https://zylalabs.com/api/12518/flashscore-live-api/23852/search?q=real+madrid
- Store ids of selected entities for later usage in your features.
Security and performance checklist
- Keep your API key server-side; proxy frontend requests through your backend.
- Use HTTPS-only endpoints exactly as documented on zylalabs.com.
- Apply short TTL caching on GETs by full URL (including query string) to improve responsiveness.
- Validate and sanitize the q parameter from user input; pass it as-is to the API after URL encoding.
- Set reasonable timeouts (connect/read) and enforce upper bounds on response sizes in your HTTP client.
Copy-ready request snippets
Search for “real madrid” (cURL)
List all sports (cURL)
Get countries/competitions for Tennis (cURL)
Where to go next
Explore the full listing on Zyla: FlashScore - Live API. Create a free account to get your key and start integrating within minutes: Register. You can also call these APIs directly from AI coding agents using MCP as described above.
FAQ
Does the FlashScore - Live API require an Authorization header?
Yes. Send Authorization: Bearer YOUR_API_KEY with every request.
Is there a free plan?
No Free Plan is available. The first API offers a 7-day trial or 50 requests. Check the API page for current access options and pricing.
Which endpoints are available on this listing?
Search (GET /23852/search with q), Get sports (GET /23853/get-sports), and Get countries (GET /23854/get-countries with sport_id).
Can I pass a request body?
No. The documented endpoints are GET-only; use the query parameters exactly as listed.
How do I call the API from an AI agent?
Point your MCP-compatible client to https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and have it issue the same GET requests shown in this guide. See the MCP reference for details.
Official API response
[{"id":"W8mj7MDD","type":"team","name":"Real Madrid","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/E99TZ05n-ttfpEDUq.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"SlAdQJK4","type":"team","name":"Real Madrid U19","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/IgG3LUAK-xGwa4c2B.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"MP6gLUO7","type":"team","name":"Real Madrid","url":"real-madrid","sport":{"id":3,"name":"Basketball"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/pn8TQOkQ-bXlcmj9T.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"2anA8FkF","type":"team","name":"Real Madrid U21","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/p048BCQt-SKpsUss3.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"4xlfVfnP","type":"team","name":"Real Madrid W","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Women","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/4CKmt8Rt-WpmKUEXD.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"fyNss8GQ","type":"team","name":"Real Madrid B","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/f5FO93Tc-ltKPQjEk.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"46uFRv4a","type":"team","name":"Real Madrid C","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/bupmbK6n-QkBtimSf.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"UiUgFWdq","type":"team","name":"Real Madrid U20","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flash…
Official API response
[{"id":"W8mj7MDD","type":"team","name":"Real Madrid","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/E99TZ05n-ttfpEDUq.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"SlAdQJK4","type":"team","name":"Real Madrid U19","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/IgG3LUAK-xGwa4c2B.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"MP6gLUO7","type":"team","name":"Real Madrid","url":"real-madrid","sport":{"id":3,"name":"Basketball"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/pn8TQOkQ-bXlcmj9T.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"2anA8FkF","type":"team","name":"Real Madrid U21","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/p048BCQt-SKpsUss3.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"4xlfVfnP","type":"team","name":"Real Madrid W","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Women","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/4CKmt8Rt-WpmKUEXD.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"fyNss8GQ","type":"team","name":"Real Madrid B","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/f5FO93Tc-ltKPQjEk.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"46uFRv4a","type":"team","name":"Real Madrid C","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/bupmbK6n-QkBtimSf.png","country_image_path":"https:\/\/static.flashscore.com\/res\/image\/data\/QFbOpTR6-GtJBBjyH.png"},{"id":"UiUgFWdq","type":"team","name":"Real Madrid U20","url":"real-madrid","sport":{"id":1,"name":"Soccer"},"gender":"Men","country_name":"Spain","image_path":"https:\/\/static.flash…