How to Get Football Data in Flutter: Live Scores, Standings & Fixtures
Get football data in Flutter with GOAL API: live scores, standings and fixtures with the official Dart SDK, FutureBuilder examples and real-time WebSocket updates.
GOAL API

Flutter is the quickest way to ship a football app to iOS and Android from one codebase, and a live-score app is one of its best fits. This guide shows how to get football data in Flutter with GOAL API using the official Dart SDK — live scores, standings and fixtures, with runnable code.
Get a free API key
Create a free GOAL API key — no credit card. The free tier uses the same endpoints as the paid plans.
Add the Dart SDK
The official package works on Android, iOS, web, Windows, macOS and Linux:
dependencies:
goal_api: ^1.1.0import 'package:goal_api/goal_api.dart';Read this before you ship
One thing to get right from the start: an API key bundled into a Flutter app binary is effectively public. Anyone can pull it out of a shipped build. Use the key directly only in prototypes and internal tools. For a user-facing app, route requests through your own backend, keep the key there, and have the app talk to your server. The SDK's own docs make the same point, and it's worth designing for on day one rather than retrofitting after launch.
With that said, here's the client:
final goal = GoalApi(apiKey: 'your-key');Share one GoalApi instance across your app and call goal.close() when you're finished with it.
Pull live football scores
Methods return the decoded response, so you read ['data'] straight off the result:
import 'package:goal_api/goal_api.dart';
Future<void> main() async {
final goal = GoalApi(apiKey: 'your-key');
final page = await goal.fixtures.live();
for (final match in page['data'] as List) {
final m = match as Map<String, dynamic>;
print('${m['homeTeam']['name']} ${m['homeScore']}-${m['awayScore']} ${m['awayTeam']['name']}');
}
goal.close();
}Arsenal 2-1 Chelsea
Barcelona 0-0 Sevilla
Inter 3-1 NapoliFind a league and render its table
// Leagues, filtered — params are a plain Map, and nulls are dropped
final leagues = await goal.leagues.list({'search': 'premier league', 'limit': 10});
final leagueId = leagues['data'][0]['id'];
// The table, already ordered
final table = await goal.leagues.standings(leagueId);
for (final row in table['data'] as List) {
final r = row as Map<String, dynamic>;
print('${r['position']}. ${r['team']['name']} — ${r['points']} pts');
}Cache the league ID; it's stable, so there's no need to look it up on every launch.
Wiring it into a widget
Because the calls are plain Futures, a FutureBuilder is enough to get scores on screen:
FutureBuilder<Map<String, dynamic>>(
future: goal.fixtures.live(),
builder: (context, snap) {
if (!snap.hasData) return const Center(child: CircularProgressIndicator());
final matches = snap.data!['data'] as List;
return ListView.builder(
itemCount: matches.length,
itemBuilder: (context, i) {
final m = matches[i] as Map<String, dynamic>;
return ListTile(
title: Text('${m['homeTeam']['name']} vs ${m['awayTeam']['name']}'),
trailing: Text('${m['homeScore']}-${m['awayScore']}'),
);
},
);
},
)For a screen that updates during a match, move from a one-shot FutureBuilder to a stream backed by the WebSocket below.
Real-time scores
Polling drains batteries. GOAL API offers a WebSocket — request a short-lived token, connect, and subscribe to the matches on screen to receive goals, cards and substitutions the moment they happen. The SDK ships web_socket_channel as a dependency, so the transport is already there; the live scores over WebSocket guide covers connect, subscribe and reconnect. On mobile, remember to close the connection when the app backgrounds and re-subscribe on resume.
What you can build with football data in Flutter
- A cross-platform live-score app for iOS and Android
- A single-club companion app with fixtures, table and squad
- Prefer another language? The same walkthrough exists for Python, JavaScript and Go
Grab a free key and you're pulling live football data in Flutter in minutes.
FAQ
Is there an official Flutter/Dart football API SDK?
Yes. GOAL API publishes goal_api on pub.dev — add goal_api: ^1.1.0 to your pubspec and import package:goal_api/goal_api.dart. It supports Android, iOS, web, Windows, macOS and Linux.
How do I get live football scores in Flutter?
Construct the client with GoalApi(apiKey: ...), call goal.fixtures.live(), and read the ['data'] list from the result. A FutureBuilder is enough to render it. A free key covers it.
Is it safe to put my API key in a Flutter app? No. A key bundled in an app binary is effectively public. Use it directly only for prototypes; for a shipped app, proxy requests through your own backend and keep the key server-side.
How do I get real-time updates instead of polling? Use the WebSocket — request a short-lived token, connect, and subscribe to the matches on screen, closing the connection when the app backgrounds to save battery.


