top of page

My Sports Feeds API | Real-Time Sports Data by SportsFirst

Integrate MySportsFeeds API for real-time NFL, NBA, MLB, NHL scores, stats, and DFS data. Free for personal use. Built by SportsFirst.

API football

MySportFeeds API Integration: Complete Guide for Sports Data Development



What is MySportFeeds API?


MySportFeeds API is a comprehensive sports data platform that provides real-time and historical statistics for major professional sports leagues in the USA. This powerful API delivers accurate game scores, player statistics, team standings, schedules, and live play-by-play data for NFL, NBA, MLB, NHL, and more.


SportsFirst specializes in integrating MySportFeeds API into custom sports applications, enabling developers to build data-rich fantasy sports platforms, sports betting apps, league management systems, and fan engagement applications with reliable, up-to-date sports information.




MySportFeeds API Overview



League

Coverage

Update Frequency

Historical Data

NFL (National Football League)

Complete season stats, play-by-play

Real-time during games

2009-present

NBA (National Basketball Association)

Player stats, box scores, standings

Real-time during games

2012-present

MLB (Major League Baseball)

Game stats, pitcher analytics

Real-time during games

2012-present

NHL (National Hockey League)

Player performance, team stats

Real-time during games

2012-present

MLS (Major League Soccer)

Match statistics, player data

Real-time during matches

2017-present

Key Features of MySportFeeds API



Comprehensive Sports Data Endpoints


Game & Schedule Data:


  • Current season schedules

  • Game start times and venues

  • Final scores and game status

  • Postponed/rescheduled game updates


Player Statistics:


  • Season averages and totals

  • Game-by-game performance

  • Advanced analytics and metrics

  • Injury reports and roster status


Team Information:


  • Season standings and rankings

  • Team performance metrics

  • Roster information

  • Historical records


Live Game Data:


  • Real-time score updates

  • Play-by-play commentary

  • Quarter/period breakdowns

  • Live player statistics



MySportFeeds API Integration



Step 1: Authentication Setup

All MySportFeeds API requests require Basic Authentication using your API key:


// Node.js Authentication Example
const axios = require('axios');

const API_KEY = 'your_api_key_here';
const PASSWORD = 'MYSPORTSFEEDS';
const BASE_URL = 'https://api.mysportsfeeds.com/v2.1/pull';

const auth = {
  username: API_KEY,
  password: PASSWORD
};

// Example API Request
async function getGameSchedule(league, season) {
  try {
    const response = await axios.get(
      `${BASE_URL}/${league}/${season}/games.json`,
      { auth }
    );
    return response.data;
  } catch (error) {
    console.error('API Error:', error.message);
  }
}

Step 2: Fetching Current Season Standings


# Python Integration Example
import requests
from requests.auth import HTTPBasicAuth

API_KEY = 'your_api_key_here'
PASSWORD = 'MYSPORTSFEEDS'
BASE_URL = 'https://api.mysportsfeeds.com/v2.1/pull'

def get_nba_standings(season='current'):
    url = f'{BASE_URL}/nba/{season}/standings.json'
    
    response = requests.get(
        url,
        auth=HTTPBasicAuth(API_KEY, PASSWORD)
    )
    
    if response.status_code == 200:
        return response.json()
    else:
        print(f'Error: {response.status_code}')
        return None

# Get current NBA standings
standings_data = get_nba_standings()


Step 3: Retrieving Player Statistics


// React Native Example - Player Stats
const fetchPlayerStats = async (playerId, season) => {
  const endpoint = `${BASE_URL}/nba/${season}/player_stats_totals.json`;
  
  try {
    const response = await fetch(endpoint, {
      method: 'GET',
      headers: {
        'Authorization': 'Basic ' + btoa(`${API_KEY}:${PASSWORD}`)
      }
    });
    
    const data = await response.json();
    
    // Filter for specific player
    const playerStats = data.playerStatsTotals.find(
      player => player.player.id === playerId
    );
    
    return playerStats;
  } catch (error) {
    console.error('Failed to fetch player stats:', error);
  }
};

Step 4: Real-Time Game Scores



<?php
// PHP Example - Live Game Scores

$apiKey = 'your_api_key_here';
$password = 'MYSPORTSFEEDS';
$league = 'nfl';
$season = 'current';
$date = date('Ymd'); // Today's date

$url = "https://api.mysportsfeeds.com/v2.1/pull/{$league}/{$season}/games.json?date={$date}";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "{$apiKey}:{$password}");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

$response = curl_exec($ch);
curl_close($ch);

$gameData = json_decode($response, true);

// Process game scores
foreach ($gameData['games'] as $game) {
    echo "Game: " . $game['schedule']['awayTeam']['abbreviation'] . 
         " vs " . $game['schedule']['homeTeam']['abbreviation'] . "\n";
    echo "Score: " . $game['score']['awayScoreTotal'] . 
         " - " . $game['score']['homeScoreTotal'] . "\n\n";
}
?>


API Response Data Structure


{
  "lastUpdatedOn": "2026-03-21T15:30:00.000Z",
  "games": [
    {
      "schedule": {
        "id": 67890,
        "startTime": "2026-03-21T19:00:00.000Z",
        "awayTeam": {
          "id": 142,
          "abbreviation": "LAL",
          "city": "Los Angeles",
          "name": "Lakers"
        },
        "homeTeam": {
          "id": 143,
          "abbreviation": "GSW",
          "city": "Golden State",
          "name": "Warriors"
        },
        "venue": {
          "name": "Chase Center",
          "city": "San Francisco"
        }
      },
      "score": {
        "currentQuarter": 3,
        "currentQuarterSecondsRemaining": 480,
        "awayScoreTotal": 78,
        "homeScoreTotal": 82,
        "quarters": [
          {
            "quarterNumber": 1,
            "awayScore": 28,
            "homeScore": 25
          },
          {
            "quarterNumber": 2,
            "awayScore": 24,
            "homeScore": 30
          },
          {
            "quarterNumber": 3,
            "awayScore": 26,
            "homeScore": 27
          }
        ]
      }
    }
  ]
}

Rate Limits & Best Practices



MySportFeeds API Usage Guidelines


Plan Tier

Requests/Day

Concurrent Requests

Price

Free Trial

250 requests

1 concurrent

Free for 7 days

Basic

5,000 requests

2 concurrent

Contact for pricing

Pro

25,000 requests

5 concurrent

Contact for pricing

Enterprise

Unlimited

Custom

Custom pricing


Best Practices for MySportFeeds API:


  1. Implement Caching – Cache frequently accessed data to reduce API calls

  2. Use Webhooks – Subscribe to data change notifications instead of polling

  3. Request Only Needed Data – Use query parameters to filter responses

  4. Handle Rate Limits – Implement exponential backoff for failed requests

  5. Monitor API Status – Check MySportFeeds status page for outages



// Caching Implementation Example
const NodeCache = require('node-cache');
const cache = new NodeCache({ stdTTL: 300 }); // 5-minute cache

async function getCachedStandings(league, season) {
  const cacheKey = `standings_${league}_${season}`;
  
  // Check cache first
  let standings = cache.get(cacheKey);
  
  if (!standings) {
    // Fetch from API if not cached
    standings = await getStandings(league, season);
    cache.set(cacheKey, standings);
  }
  
  return standings;
}

Use Cases for MySportFeeds API


Real-World Applications


Fantasy Sports Platforms:


  • Daily fantasy sports scoring systems

  • Season-long league management

  • Player draft tools with live stats

  • Real-time roster optimization


Sports Betting Applications:


  • Live odds calculation engines

  • Pre-game statistical analysis

  • In-play betting data feeds

  • Historical performance analytics


Sports Media & Broadcasting:


  • Live score widgets for websites

  • Mobile app score notifications

  • Broadcast graphics data integration

  • Sports journalism data research


League Management Systems:


  • Recreational league standings

  • Tournament bracket management

  • Team performance tracking

  • Player statistics dashboards

Advanced Integration Techniques


Webhook Implementation


// Express.js Webhook Receiver
const express = require('express');
const app = express();

app.post('/webhooks/mysportsfeeds', express.json(), (req, res) => {
  const event = req.body;
  
  // Process different event types
  switch(event.type) {
    case 'game.final':
      updateGameResults(event.data);
      break;
    case 'player.injury':
      notifyFantasyUsers(event.data);
      break;
    case 'standings.update':
      refreshLeaderboards(event.data);
      break;
  }
  
  res.status(200).send('Webhook received');
});

app.listen(3000);

Error Handling Strategy


import time
from requests.exceptions import RequestException

def api_request_with_retry(url, max_retries=3):
    """
    Robust API request with exponential backoff
    """
    for attempt in range(max_retries):
        try:
            response = requests.get(
                url,
                auth=HTTPBasicAuth(API_KEY, PASSWORD),
                timeout=10
            )
            
            if response.status_code == 200:
                return response.json()
            elif response.status_code == 429:
                # Rate limit exceeded
                wait_time = 2 ** attempt
                print(f'Rate limited. Waiting {wait_time}s...')
                time.sleep(wait_time)
            else:
                print(f'Error {response.status_code}: {response.text}')
                return None
                
        except RequestException as e:
            print(f'Request failed: {e}')
            if attempt < max_retries - 1:
                time.sleep(2 ** attempt)
    
    return None



MySportFeeds API vs Alternatives


Competitive Analysis


Feature

MySportFeeds API

SportsRadar

ESPN API

Stats Perform

USA Sports Coverage

NFL, NBA, MLB, NHL, MLS

Extensive global coverage

NFL, NBA, MLB focus

Global multi-sport

Historical Data

2009+ (varies by sport)

Extensive archives

Limited historical

Comprehensive

Real-Time Updates

Yes (live games)

Yes

Limited free tier

Yes (premium)

Free Tier

7-day trial

No free tier

Limited endpoints

Contact for trial

Pricing

Affordable for startups

Enterprise-focused

Discontinued public API

Enterprise pricing

Documentation

Excellent

Very detailed

Limited

Professional

Ease of Integration

High (RESTful JSON)

Medium

Medium

Medium



Why Choose MySportFeeds API:


  • Cost-effective for sports startups

  • Comprehensive USA sports coverage

  • Excellent documentation and support

  • Reliable uptime and data accuracy

  • Flexible pricing tiers



HTTPS-Only Communication:


  • Always use HTTPS endpoints

  • Validate SSL certificates

  • Implement request signing for sensitive operations.


Data Privacy Compliance:


  • Cache personal data responsibly

  • Implement data retention policies

  • Follow GDPR/CCPA guidelines for user data

  • Encrypt stored API responses containing player information.




FAQs



What is MySportFeeds API used for?


MySportFeeds API is used to integrate real-time and historical sports data into applications. Common use cases include fantasy sports platforms, sports betting apps, league management systems, sports news websites, and mobile apps requiring live scores and player statistics for NFL, NBA, MLB, NHL, and MLS.


How do I authenticate MySportFeeds API requests?


Authentication requires Basic HTTP Authentication using your API key as the username and "MYSPORTSFEEDS" as the password. Include credentials in the Authorization header: Authorization: Basic base64(api_key:MYSPORTSFEEDS).


Does MySportFeeds API provide real-time game data?


Yes, MySportFeeds API provides real-time game scores, play-by-play data, and live statistics during active games for all supported leagues. Updates typically occur within seconds of actual game events.


What sports leagues are covered by MySportFeeds API?


The API covers major USA professional sports: NFL (National Football League), NBA (National Basketball Association), MLB (Major League Baseball), NHL (National Hockey League), and MLS (Major League Soccer) with comprehensive statistics and historical data.


How much does MySportFeeds API cost?


Pricing varies by tier: Free 7-day trial (250 requests/day), Basic plan (5,000 requests/day), Pro plan (25,000 requests/day), and custom Enterprise plans. Contact MySportFeeds directly for current pricing details.


What historical data is available in MySportFeeds API?


Historical data availability varies by sport: NFL data from 2009, NBA from 2012, MLB from 2012, NHL from 2012, and MLS from 2017. All historical seasons include complete game statistics, player performance, and team standings.


Are there rate limits for MySportFeeds API?


Yes, rate limits depend on your subscription tier. Free trials allow 250 requests/day with 1 concurrent request. Paid plans range from 5,000 to unlimited daily requests. Implement caching and efficient querying to stay within limits.


Can I use MySportFeeds API for commercial applications?


Yes, MySportFeeds API can be used for commercial applications including fantasy sports platforms, betting apps, and sports media sites. Review the terms of service and choose an appropriate subscription tier based on your usage requirements.


How accurate is MySportFeeds API data?


MySportFeeds maintains high data accuracy through partnerships with official sports data providers. Real-time data typically updates within seconds, and any corrections are applied promptly. Historical data is verified for accuracy and completeness.


Does MySportFeeds API support webhooks?


Yes, enterprise plans include webhook support for real-time notifications about game events, score changes, injury updates, and standings modifications. This eliminates the need for constant API polling and reduces request counts.


What programming languages work with MySportFeeds API?


MySportFeeds API is a RESTful API that works with any programming language supporting HTTP requests, including JavaScript/Node.js, Python, PHP, Ruby, Java, Swift, Kotlin, C#, and Go. All examples use standard HTTP libraries.


Can I test MySportFeeds API before purchasing?


Yes, MySportFeeds offers a free 7-day trial with 250 daily requests, allowing developers to test integration, explore endpoints, and evaluate data quality before committing to a paid subscription plan.


Are you looking to hire a qualified sports app development company?

Are you looking to hire a qualified sports app development company or want to discuss sports APIs?

Thanks for submitting!

bottom of page