You need to discover which odds files your subscription can read before building a data pipeline. By the end of this guide, you can list those files, inspect the response in Python, and understand how to retrieve and refresh odds data through the same API.
Fonbet Odds API exposes a list of readable files and an endpoint for retrieving an odds file. It is available through Zyla API Hub, where a single account and API key can be used across marketplace APIs.
Getting started on Zyla API Hub
Open the Fonbet Odds API listing linked at the end of this article. Click Subscribe or Start Free Trial when available, then get your API key from your Zyla API Hub account. Use that key in the Authorization: Bearer YOUR_API_KEY header.
Access uses a subscription and quota, not pay-per-call billing. For your first API, the stated trial option is seven days or 50 requests; check the API page for current access options and pricing.
The marketplace catalog contains more than 10,000 public APIs. For this integration, you only need the Fonbet Odds API subscription and the two endpoints described below.
List the files your subscription can read
Call List Files first. It returns the odds filenames available to your subscription, sorted by name. Use the returned names as the source of truth rather than assuming a file is available.
The endpoint is GET https://zylalabs.com/api/13783/fonbet-odds-api/31607/list-files. The request below needs only your bearer token; replace YOUR_API_KEY before running it.
curl -s -X GET "https://zylalabs.com/api/13783/fonbet-odds-api/31607/list-files" \
-H "Authorization: Bearer YOUR_API_KEY"
The example response is:
{
"company": "fonbet",
"count": 1,
"files": [
"site_livepre_fonbet.json"
]
}
company identifies the bookmaker, count reports the number of files, and files contains the filenames. In this response, the subscription can read site_livepre_fonbet.json. This is a file listing, not the contents of the odds file.
Read the listing in Python
This example uses Python’s standard library, so it does not require a separate HTTP package. It calls the same endpoint, reads all three response fields, and prints each available filename.
import json
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = "https://zylalabs.com/api/13783/fonbet-odds-api/31607/list-files"
request = Request(
url,
headers={"Authorization": "Bearer YOUR_API_KEY"},
method="GET",
)
try:
with urlopen(request) as response:
result = json.load(response)
except HTTPError as error:
sys.exit(f"List Files request failed: HTTP {error.code}")
except URLError as error:
sys.exit(f"Could not reach List Files: {error.reason}")
print(f"Company: {result['company']}")
print(f"File count: {result['count']}")
for filename in result["files"]:
print(filename)
Replace YOUR_API_KEY with your key before running the script. The code stops on an HTTP or connection error instead of treating a failed request as an empty listing.
Iterate over files to use the actual names returned. The count is useful for reporting, but the array contains the values your integration needs. If your application stores the listing, refresh it when you need to discover the files your current subscription can read.
Retrieve an odds file
After listing the available names, use Get Data to retrieve an odds file. Its request URL is GET https://zylalabs.com/api/13783/fonbet-odds-api/31608/get-data, using the same bearer-token authorization.
The response wraps the bookmaker’s JSON in four fields:
company: the bookmaker identifier.file: the name of the returned file.updated_at: when the file was last refreshed, in UTC.data: the bookmaker’s own JSON, unchanged.
Keep the envelope alongside the data if your application needs to track which file it processed and when that file was refreshed. Check file against the names returned by List Files. For file-selection details beyond the request shown here, consult the API listing rather than adding a guessed parameter.
Use the refresh time for conditional requests
Get Data also sends the file’s refresh time in a Last-Modified response header. To check for changes, save that header value and send it back in an If-Modified-Since header on a subsequent Get Data request. The endpoint can return HTTP 304 when the file has not changed.
Handle that response separately from a response containing a file: retain your previously stored data instead of trying to parse a new JSON body. On a successful response containing data, update your stored file and its Last-Modified value together. This keeps the cache validator associated with the content it describes.
updated_at is useful for displaying or logging the UTC refresh time. For the conditional request, use the actual Last-Modified header value returned by the server rather than constructing a header from a timestamp yourself.
Where the file listing fits in an integration
A sports-data dashboard can list the available files during setup, then retrieve the relevant odds data for display. Showing the returned filename and refresh time in an operational view helps the team distinguish file discovery from data retrieval.
A scheduled ingestion job can use List Files as a discovery step and Get Data as a separate retrieval step. Store the file name and refresh metadata with the ingested data, and treat a 304 response as a signal to keep the existing copy.
A data-processing service can also use the listing to check what its subscription currently permits before attempting downstream processing. Because data is the bookmaker’s unchanged JSON, keep parsing logic separate from the outer envelope: read company, file, and updated_at as metadata, then process data according to the content your application needs.
Call the API from an AI agent
Zyla API Hub APIs can also be called through an MCP-compatible client, including Claude Code, Cursor, and Windsurf. Configure the client with https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY, replacing YOUR_API_KEY with your Hub key. See the MCP link for the Hub endpoint.
For this task, ask the agent to list the files accessible through Fonbet Odds API before retrieving data. Have it use the returned names and preserve the file and refresh metadata when presenting results. Treat the API key in the MCP connection URL as a secret when sharing client configuration.
FAQ
Does List Files return the odds data?
No. It returns the company, file count, and readable filenames. Get Data returns an odds file inside an envelope containing the file name, refresh time, and bookmaker JSON.
Do I need to send a filename to List Files?
No. The List Files request shown above uses bearer authorization and no request parameters. Call it first to discover the names your subscription can read.
How can I avoid processing an unchanged file?
Save the Last-Modified header from Get Data and return it as If-Modified-Since on a later request. If the server responds with 304, retain the data you already stored.
What timezone is the file refresh time in?
The updated_at field is in UTC. The response also provides the refresh time in the Last-Modified header for conditional requests.
How do I get access to the API?
Create a free Zyla API Hub account, open the listing, and choose Subscribe or Start Free Trial when available. Check the listing for current access options and pricing.
Ready to list the files available to your subscription? Start 7-day trial on Fonbet Odds API and get an API key from your account.