API Status: All Systems Live Docs Sandbox Login
Quick Start Guide

Sports API Quick Start Guide
Integrate in Minutes.

No configuration overhead. No sales pipeline before you can test. This guide walks you through account setup, API key creation, SDK installation, and your first authenticated request — with working code you can copy and run immediately.

~5 min to first call No credit card required JS · Python · PHP · cURL Sandbox included free
terminal — quick_start.sh
# Step 1 — install the SDK
$ npm install @techmagnetics/sports-sdk
added 1 package in 0.8s

# Step 2 — set your API key
$ export TM_API_KEY=tm_live_sk_••••••••••••

# Step 3 — fetch live football odds
$ node run_first_call.js

// Response received:
✓ 200 OK · 148ms · 3 live matches
events[0]: "Arsenal vs Chelsea"
odds.home: 2.15 · draw: 3.40 · away: 3.10
node v20.11.0 · @techmagnetics/sports-sdk@3.8.2 ● live
5 minAvg time to first call
6SDK Languages
30+Sports in Sandbox
180msAvg API Latency
99.99%Uptime SLA
FreeSandbox forever

Your First API Call
Shouldn't Take a Week.

Most sports data providers bury their setup behind procurement, custom quotes, and NDAs before you can test a single endpoint. We give you full sandbox access from minute one — live data schema, real response structure, no waiting.

Instant API Key Sandbox Mirrors Production Setup in Under 5 Minutes
1

Create Your Tech Magnetics Account

~1 min

Head to techmagnetics.io/signup and create a free account with your work email. No credit card is required — the sandbox tier is free permanently and gives you access to the full API schema against live-delayed data.

After submitting your email you'll receive a verification link within 30 seconds. Click it and your developer dashboard is ready immediately.

Use a work email if you plan to invite teammates to your dashboard later. You can always change it, but team invitations are domain-matched by default.

📧
Enter work email
No password yet needed
✉️
Verify email link
Arrives in <30 seconds
🎉
Dashboard ready
Instant access, no approval
2

Generate Your API Key

~1 min

Inside your dashboard, navigate to API Keys → New Key. Give it a descriptive name (e.g. my-football-app-dev), choose your scope, and click Generate. Your key is shown once — copy it immediately.

Your API Key (sandbox)
tm_sandbox_sk_a3f8c2d9e1b7••••••••••••••••

Never commit your API key to a public repository. Store it in an environment variable (TM_API_KEY) or a secrets manager like Vault, AWS Secrets Manager, or GitHub Actions secrets.

You can create multiple keys per project, scope them to specific endpoints or sports, and set expiry dates. All key activity is logged in your dashboard with per-endpoint call counts.

3

Install the SDK for Your Language

~1 min

We publish official SDKs for six languages. Each SDK wraps the full REST and WebSocket API, ships with TypeScript definitions (even for non-TS packages), and is semantically versioned. Install the one that matches your stack:

terminal bash
# Install with npm (JavaScript / TypeScript)
$ npm install @techmagnetics/sports-sdk

# Or with yarn
$ yarn add @techmagnetics/sports-sdk

 added 1 package · 0.9s
terminal python
# Install with pip (Python 3.8+)
$ pip install techmagnetics-sdk

# Or with pipenv
$ pipenv install techmagnetics-sdk

Successfully installed techmagnetics-sdk-3.8.2
terminal php
# Install with Composer (PHP 8.0+)
$ composer require techmagnetics/sports-sdk

 Package operations: 1 install · 0 updates · 0 removals
terminal curl
# No SDK needed — use cURL directly
$ curl -s -H "Authorization: Bearer YOUR_API_KEY" \
     "https://api.techmagnetics.io/v1/livescores?sport=football"

# The REST API follows standard HTTP conventions.
# All responses are JSON. See the API reference for parameters.

All SDKs ship with full TypeScript definitions, JSDoc/docstring coverage, and match the same API surface. Switching languages later requires only changing the import — the method names and parameters are consistent across all SDK languages.

4

Make Your First API Call

~2 min

The example below fetches live prematch football odds for the Premier League — returning available markets, current prices, and fixture metadata in a single call. Replace YOUR_API_KEY with your sandbox key from Step 2.

first_call.js JavaScript
import { TechMagnetics } from '@techmagnetics/sports-sdk';

const client = new TechMagnetics({
  apiKey: process.env.TM_API_KEY,
  region: 'eu-west-1'
});

// Fetch prematch odds — Premier League, 1X2 + Over/Under markets
const response = await client.odds.prematch({
  sport:       'football',
  competition: 'premier_league',
  markets:    ['1x2', 'over_under_2_5'],
  limit:      10
});

console.log(`Found ${response.events.length} fixtures`);
console.log(response.events[0]);

/* Output:
{
  id: "prem_ars_che_20260628",
  home: "Arsenal",   away: "Chelsea",
  kickoff: "2026-06-28T15:00:00Z",
  odds: { home: 2.15,  draw: 3.40,  away: 3.10 },
  markets: { over_2_5: 1.85, under_2_5: 2.00 }
}
*/
first_call.py Python
import os
from techmagnetics import TechMagnetics

client = TechMagnetics(
    api_key=os.environ["TM_API_KEY"],
    region="eu-west-1"
)

# Fetch prematch football odds — Premier League
response = client.odds.prematch(
    sport="football",
    competition="premier_league",
    markets=["1x2", "over_under_2_5"],
    limit=10
)

print(f"Found {len(response.events)} fixtures")
print(response.events[0])

# Output:
# TmEvent(id='prem_ars_che_20260628', home='Arsenal',
#   away='Chelsea', odds=TmOdds(home=2.15, draw=3.40, away=3.10))
first_call.php PHP
<?php
use TechMagnetics\Client;

$client = new Client([
    'api_key' => $_ENV['TM_API_KEY'],
    'region'  => 'eu-west-1'
]);

// Fetch prematch football odds
$response = $client->odds()->prematch([
    'sport'       => 'football',
    'competition' => 'premier_league',
    'markets'     => ['1x2', 'over_under_2_5'],
    'limit'       => 10
]);

echo count($response->events) . " fixtures found\n";
var_dump($response->events[0]);
terminal cURL
# Fetch prematch Premier League odds via raw cURL
$ curl -s \
  -H "Authorization: Bearer $TM_API_KEY" \
  -H "Accept: application/json" \
  "https://api.techmagnetics.io/v1/odds/prematch
    ?sport=football&competition=premier_league
    &markets=1x2,over_under_2_5&limit=10" | jq .

# Response (truncated):
{
  "status": 200,
  "latency_ms": 148,
  "events": [
    {
      "id": "prem_ars_che_20260628",
      "home": "Arsenal",
      "away": "Chelsea",
      "odds": { "home": 2.15, "draw": 3.40, "away": 3.10 }
    }
  ]
}

A 200 OK with event data means you're fully connected. If you see a 401 Unauthorized, double-check that your TM_API_KEY environment variable is set and the key hasn't expired.

5

Subscribe to a Live WebSocket Stream

~2 min

For live scores, in-play odds, and real-time match events, use our WebSocket feed instead of polling. One persistent connection delivers all event updates for your subscribed fixtures — no repeated HTTP overhead.

websocket_stream.js JavaScript
import { TechMagnetics } from '@techmagnetics/sports-sdk';

const client = new TechMagnetics({ apiKey: process.env.TM_API_KEY });

// Subscribe to live football events — Premier League only
const stream = client.stream.connect({
  sport:       'football',
  competition: 'premier_league',
  channels:   ['livescore', 'odds', 'events']
});

// Goal scored
stream.on('goal', (event) => {
  console.log(`⚽ GOAL: ${event.scorer} (${event.team}) — ${event.minute}'`);
});

// Odds update (fires on any market movement)
stream.on('odds_update', (update) => {
  console.log(`📊 Odds updated: home now ${update.odds.home}`);
});

// Auto-reconnects on disconnect — no extra setup needed
stream.on('reconnect', () => console.log('Reconnected to stream'));

The SDK handles reconnection, exponential back-off, and message ordering automatically. In the sandbox environment, stream events are replayed from a recent live match to give you realistic testing conditions without waiting for a real fixture.

6

Handle Errors Correctly

~2 min

All API errors return standard HTTP status codes with a structured JSON body. The SDK also surfaces typed error classes so you can catch specific failure modes without parsing raw response text.

error_handling.js JavaScript
import { TechMagnetics, TmAuthError, TmRateLimitError, TmNotFoundError }
  from '@techmagnetics/sports-sdk';

try {
  const data = await client.odds.prematch({ sport: 'cricket' });
} catch (err) {

  if (err instanceof TmAuthError) {
    // 401 — invalid or expired API key
    console.error('Check your TM_API_KEY environment variable');

  } else if (err instanceof TmRateLimitError) {
    // 429 — slow down; retry after err.retryAfter seconds
    await sleep(err.retryAfter * 1000);

  } else if (err instanceof TmNotFoundError) {
    // 404 — competition or fixture not found
    console.warn('Competition not found — check your coverage plan');

  } else {
    // 5xx — transient server error, safe to retry with back-off
    throw err;
  }
}
Common HTTP Status Codes
200 OK Request succeeded. Response body contains data.
400 Bad request — missing or invalid query parameter. Check error.param.
401 Auth API key missing, invalid, or expired. Regenerate in dashboard.
403 Endpoint not covered by your plan. Upgrade or contact support.
429 Rate limit hit. Back off and retry after Retry-After header value.
5xx Transient server error. Safe to retry with exponential back-off.
7

Switch to a Production API Key

~1 min

When you're ready to go live, upgrade your account to a paid plan, generate a production key (prefix tm_live_sk_), and swap the environment variable. No code changes required — the production endpoint is identical to sandbox, but returns real-time data without delay.

.env env
# Development / sandbox
TM_API_KEY=tm_sandbox_sk_a3f8c2d9e1b7••••

# Production (swap this in when you deploy)
# TM_API_KEY=tm_live_sk_••••••••••••••••

# Optional: set preferred region for lower latency
TM_REGION=eu-west-1   # eu-west-1 | us-east-1 | ap-southeast-1

You're production-ready. Your sandbox API key continues working for testing and staging environments — it never expires and doesn't count toward your production quota.

Live Data Flowing Into
Every Screen, Everywhere.

Once your integration is live, every connected stadium display, mobile app, and web widget updates in lockstep with the action on the pitch. Our sub-200ms delivery pipeline means your users see the same moment fans at the ground do.

<200ms Global Delivery Mobile · Web · Embedded Auto-reconnecting Streams
What's Possible

Five Calls That Cover
Most Sports App Use Cases

Once you understand the authentication and response structure, these are the five endpoints that power the majority of what developers build with our API.

Pull Prematch Odds

Get upcoming fixture odds with all available markets before the match starts. Filter by sport, competition, or specific teams.

GET /v1/odds/prematch
Stream Live Scores

Subscribe via WebSocket for push-based score updates, goal events, yellow cards, and match status changes in real time.

WS /v1/livescores/stream
Fetch Player Stats

Season-to-date and career statistics for any player in a supported league — goals, assists, minutes played, and advanced metrics.

GET /v1/stats/player/{id}
List Upcoming Fixtures

Query the full fixture calendar for any sport and competition, with venue, broadcaster, and estimated attendance data included.

GET /v1/fixtures
Query Historical Data

Pull years of past results, head-to-head records, and historical odds for training models or building analytics dashboards.

GET /v1/historical/results
Register Webhooks

POST a URL to receive push notifications for events you care about — goal alerts, odds movements, match start/end, and more.

POST /v1/webhooks/subscribe

Clean Code. Clean Schema.
No Surprises in Production.

Our OpenAPI 3.1 specification is always in sync with the deployed API. Import it into Postman, generate typed clients automatically, or browse the interactive explorer in your dashboard — every endpoint, parameter, and response field is documented and versioned.

OpenAPI 3.1 Spec Typed SDK Clients 6-Month Deprecation Window
Sport Coverage

Same API Key Across
Every Sport in the Sandbox

Switch the sport parameter and the same code that fetched Premier League odds now returns IPL cricket markets or NBA live scores — no new authentication, no new endpoint pattern.

Cricket
GET /v1/odds/prematch?sport=cricket
Basketball
WS /v1/livescores/stream?sport=basketball
American Football
GET /v1/stats/player?sport=nfl

From API to App in
a Single Afternoon.

With working code samples for every endpoint and SDK wrappers that handle auth, retries, and connection management, most developers ship a working proof-of-concept in hours — not days. The same data that powers enterprise platforms is available to you from the free sandbox tier.

iOS & Android Ready Web & Server-Side Edge & Serverless Support
Next Steps

Where to Go From Here

You've made your first call. Here are the most valuable resources to explore next as you build out your integration.

Full API Reference

Every endpoint documented with parameters, response schemas, example requests, and error codes — searchable and interactive.

Read the docs
SDK Deep-Dive

Full API surface for all six official SDKs, including advanced options like custom retry strategies, middleware hooks, and response transformers.

Browse SDKs
Interactive Sandbox

Run live API calls against real match data directly from your browser. No code required — great for exploring response schemas before building.

Open sandbox
WebSocket Guide

Advanced configuration for live data streams — custom event filters, message batching, subscription management, and reconnection strategies.

WebSocket reference
Webhooks & Push Events

Configure outbound webhooks to receive score, odds, or injury alerts pushed to your own endpoint — no polling, no missed events.

Webhook setup
Developer Community

Join 5,000+ developers in our Slack workspace. Ask questions, share code, and get early access to beta endpoints before they ship.

Join Slack

Engineering Support
When You Actually Need It.

Our developer relations team responds in our public Slack within the same business day. On Growth and Enterprise plans, you get a dedicated integration engineer who knows your codebase and can pair-program your setup, review your implementation, and escalate production issues directly to our infrastructure team.

Slack Community Access Dedicated Engineer (Growth+) Same-Day Response
Ready to Build — No Waiting

Your Free API Key Is
One Click Away.

Sandbox access, full schema, and six SDK languages — all available the moment you sign up. No procurement, no NDA, no credit card. Start building the sports app you've been planning and upgrade only when you go to production.

Instant sandbox activation 10,000 free calls/month WebSocket access included Full OpenAPI spec & SDKs

Free tier never expires · No credit card · Upgrade only when you go live

5,000+ Developers Onboarded · 30+ Sports in Sandbox · <180ms Avg Latency · 99.99% Uptime SLA