Giriş Yap API Anahtarı Al
Tutorials

How to Fetch Live Football Scores with an API (Python & JavaScript Guide)

Abstract illustration of a football API — soccer ball with data code elements on dark background

Learn how to fetch live football scores, league standings, and player stats using Football API with step-by-step Python and JavaScript examples.

Bu Sayfada

Live Football API is a REST API service that lets developers integrate live football match results, league standings, squad information, and match statistics into their applications. In this guide, you'll learn how to fetch live score data in just a few minutes.

What Is Live Football API and What Is It Used For?

Live Football API is a JSON-based REST service delivering real-time match data from 50+ leagues, including the Premier League, La Liga, and the Champions League. It's widely used by fantasy football apps, betting platforms, sports news sites, and mobile app developers.

Common use cases include:

  • Live score tracking and match events (goals, cards, substitutions)
  • League standings and fixture data
  • Player profiles and season statistics
  • Real-time notifications via webhooks

How to Get an API Key

  1. Create a free account at Live Football API
  2. You'll instantly receive 100 free credits — no credit card required
  3. Copy your unique API key from the dashboard

Fetching Live Scores with Python

Using Python's requests library, fetching today's matches is straightforward:

import requests

response = requests.get(
    'https://live-football-api.com/api/v1/matches',
    params={'api_key': 'YOUR_KEY', 'date': '2026-08-23', 'lang': 'en'}
).json()

for match in response['data']['matches']:
    home = match['home']['name']
    away = match['away']['name']
    home_score = match['home']['score']
    away_score = match['away']['score']
    print(f"{home} {home_score} - {away_score} {away}")

Fetching Live Scores with JavaScript

You can do the same in Node.js or the browser using fetch:

const res = await fetch(
  'https://live-football-api.com/api/v1/matches' +
  '?api_key=YOUR_KEY&date=2026-08-23&lang=en'
);
const result = await res.json();

result.data.matches.forEach(match => {
  console.log(`${match.home.name} ${match.home.score} - ${match.away.score} ${match.away.name}`);
});

Fetching League Standings

Use the /api/v1/league_standings endpoint with a league_id (obtained from the /leagues endpoint) to get up-to-date standings for any league. Like other endpoints, this costs 1 credit, and credits never expire.

Real-Time Goal Notifications with Webhooks

Instead of continuously polling the API, you can register a webhook to receive instant notifications for events like goals, cards, kickoff, and full-time. Registering a webhook is free — you're only charged 1 credit per delivered notification.

POST https://live-football-api.com/api/v1/webhook/register?api_key=YOUR_KEY
Content-Type: application/json

{
  "webhook_url": "https://yourapp.com/webhooks/football",
  "label": "my server"
}

For security, webhook notifications are always sent from a fixed IP address, so you can restrict incoming requests to your endpoint at the firewall level if needed.

Frequently Asked Questions

Is Live Football API free?

Yes, you get 100 free credits upon signup with no credit card required. Once credits run out, you can continue with pay-as-you-go credits or a monthly subscription.

Which leagues are supported?

50+ leagues and tournaments are supported, including the Premier League, La Liga, Serie A, Bundesliga, Champions League, and the World Cup.

How fast is the API?

Average response time is under 120ms, backed by a 99.9% uptime SLA.

Can I access historical match data?

Yes, a full historical match archive is available going back to the 1950s.

Bu Yazıyı Paylaş:
← Bloga Dön