Skip to content
Quickstart

Quickstart

Your first authenticated call, in curl, in plain Python, and with the official SDK.

curl

curl -sS https://api.foresportia.com/v1/matches/today \
  -H "X-API-Key: $FORESPORTIA_API_KEY"

Python, without the SDK

import os
import requests

response = requests.get(
    "https://api.foresportia.com/v1/matches/today",
    headers={"X-API-Key": os.environ["FORESPORTIA_API_KEY"]},
    timeout=20,
)
response.raise_for_status()
for match in response.json()["matches"]:
    print(match["id"], match["home_team"], match["away_team"])

Python, with the official SDK

pip install foresportia
from foresportia import ForesportiaClient

with ForesportiaClient.from_env() as client:
    today = client.list_today_matches()

for match in today.data:
    print(match.id, match.home_team, "vs", match.away_team)

See Python SDK for the full typed surface.

Next

The examples above contain placeholders only. Use an environment variable or a secret manager for the key. Then pick a route in Endpoints.