Quickstart
Get started with the ALT Sports Data API in minutes using real alternative sports examples.
Quickstart
Get up and running with ALT Sports Data in a few minutes.
This quickstart assumes ALT Sports Data has already issued your credential. If not, start with Credentials and Testing.
Prerequisites
- An ALT Sports Data API credential
- Node.js 16+ (for TypeScript/JavaScript) or Python 3.8+
Step 1: Install the SDK
npm install altsportsdata📦 Package: altsportsdata on npm
pip install altsportsdata📦 Package: altsportsdata on PyPI
Step 2: Initialize the Client
import { AltSportsData } from 'altsportsdata';
const client = new AltSportsData({
apiKey: process.env.ALTSPORTSDATA_API_KEY
});from altsportsdata import AltSportsData
import os
client = AltSportsData(
api_key=os.getenv('ALTSPORTSDATA_API_KEY')
)Step 3: Fetch Your First Data
Let's fetch current or upcoming Formula 1 events:
const events = await client.events.list({
leagueId: 'f1',
limit: 10,
});
events.data.forEach((event) => {
console.log(`${event.name} — ${event.startTime}`);
});events = client.events.list(
league_id="f1",
limit=10,
)
for event in events.data:
print(f"{event.name} — {event.start_time}")Step 4: Pull an alt-sports route you can recognize
Here is a second example using a league that feels more specific to ALT Sports Data.
const sports = await client.sports.list({
limit: 10
});
sports.data.forEach((sport) => {
console.log(`${sport.code} — ${sport.name}`);
});sports = client.sports.list(
limit=10
)
for sport in sports.data:
print(f"{sport.code} — {sport.name}")Step 5: Test the same route in the docs
If you want to confirm the route before coding against it:
- open the API Reference
- select a route from the left navigation
- enter your credential
- test the request from the right-side panel
Using Raw HTTP (Optional)
Prefer to use HTTP directly? Here are examples:
curl -X GET "https://api.altsportsdata.com/api/v1/public/events?league_id=f1&limit=10" \
-H "X-API-KEY: YOUR_API_KEY"const url = "https://api.altsportsdata.com/api/v1/public/events?league_id=f1&limit=10";
const response = await fetch(url, {
headers: { "X-API-KEY": "YOUR_API_KEY" }
});
const events = await response.json();
console.log(events.data);require 'net/http'
require 'json'
uri = URI('https://api.altsportsdata.com/api/v1/public/events')
uri.query = URI.encode_www_form({ league_id: 'f1', limit: 10 })
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['X-API-KEY'] = 'YOUR_API_KEY'
response = http.request(request)
data = JSON.parse(response.body)
puts data<?php
$url = 'https://api.altsportsdata.com/api/v1/public/events?league_id=f1&limit=10';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-KEY: YOUR_API_KEY'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
?>using System;
using System.Net.Http;
using System.Threading.Tasks;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY");
var url = "https://api.altsportsdata.com/api/v1/public/events?league_id=f1&limit=10";
var response = await client.GetStringAsync(url);
Console.WriteLine(response);package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.altsportsdata.com/api/v1/public/events?league_id=f1&limit=10"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("X-API-KEY", "YOUR_API_KEY")
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class QuickStart {
public static void main(String[] args) throws Exception {
String urlString = "https://api.altsportsdata.com/api/v1/public/events?league_id=f1&limit=10";
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("X-API-KEY", "YOUR_API_KEY");
BufferedReader in = new BufferedReader(
new InputStreamReader(conn.getInputStream())
);
String line;
StringBuilder response = new StringBuilder();
while ((line = in.readLine()) != null) {
response.append(line);
}
in.close();
System.out.println(response.toString());
}
}Example Response
{
"data": [
{
"id": "event_001",
"name": "Australian Grand Prix",
"league_id": "f1",
"status": "scheduled"
}
],
"meta": {
"total": 10,
"limit": 10,
"has_more": true,
"api_version": "v1",
"timestamp": "2026-03-07T00:00:00Z"
}
}Next Steps
- Understand credentials: Credentials and Testing
- Explore routes directly: API Reference
- Learn the SDKs: TypeScript | Python
- For sportsbooks: Integration guide