How to Get Football Data in Go: Live Scores, Standings & Fixtures
Get live football scores, standings and fixtures in Go with GOAL API — the official Go SDK, a net/http version and WebSocket, with runnable code.
GOAL API

Go is a natural fit for football data — fast, concurrent, and great for the live-score services, bots and APIs that sit between the data and your users. This guide shows how to get football data in Go with GOAL API: live scores, standings and fixtures, using the official Go SDK, with a plain net/http version too.
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. Keep your key in an environment variable:
export GOAL_API_KEY="your_key_here"Install the Go SDK
The official SDK needs Go 1.21+ and has no third-party dependencies:
go get github.com/goal-api/goal-api-goThe package is goalapi. Construct one client and share it across goroutines — it's safe for concurrent use.
Pull live football scores
package main
import (
"context"
"fmt"
"log"
"os"
goalapi "github.com/goal-api/goal-api-go"
)
type Fixture struct {
HomeTeam struct{ Name string } `json:"homeTeam"`
AwayTeam struct{ Name string } `json:"awayTeam"`
HomeScore int `json:"homeScore"`
AwayScore int `json:"awayScore"`
}
func main() {
ctx := context.Background()
client, err := goalapi.New(os.Getenv("GOAL_API_KEY"))
if err != nil {
log.Fatal(err)
}
live, err := client.Fixtures.Live(ctx, nil)
if err != nil {
log.Fatal(err)
}
var fixtures []Fixture
if err := live.Into(&fixtures); err != nil {
log.Fatal(err)
}
for _, f := range fixtures {
fmt.Printf("%s %d-%d %s\n", f.HomeTeam.Name, f.HomeScore, f.AwayScore, f.AwayTeam.Name)
}
}Arsenal 2-1 Chelsea
Barcelona 0-0 Sevilla
Inter 3-1 NapoliYou decode each response into your own struct with page.Into(&dst), so you only pull the fields you care about.
Find a league, then render its table
leagues, err := client.Leagues.List(ctx, goalapi.Params{"search": "premier league", "limit": 10})
if err != nil {
log.Fatal(err)
}
// take the first league's id from the decoded result, then:
type Row struct {
Position int `json:"position"`
Points int `json:"points"`
Team struct{ Name string } `json:"team"`
}
table, err := client.Leagues.Standings(ctx, leagueID, nil)
if err != nil {
log.Fatal(err)
}
var rows []Row
if err := table.Into(&rows); err != nil {
log.Fatal(err)
}
for _, r := range rows {
fmt.Printf("%d. %s (%d pts)\n", r.Position, r.Team.Name, r.Points)
}client.Leagues.List takes params like search, isActive and limit; client.Leagues.Standings returns the table already ordered. Pass nil for params when you don't need filters.
Prefer the standard library?
You don't need the SDK — every endpoint is a REST call with a Bearer token, so net/http works too:
req, _ := http.NewRequest("GET", "https://api.goal-api.com/v1/fixtures/live", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("GOAL_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
// decode resp.Body with encoding/json into your structsThe SDK handles auth, retries and pagination for you; net/http gives you full control. Both use the same key against https://api.goal-api.com/v1.
Go real-time with WebSocket
For a live service, poll less and push more. GOAL API offers a WebSocket: request a short-lived token, connect, and subscribe to matches to receive goals, cards and substitutions as they happen — a good fit for Go's concurrency model, with each subscription handled in its own goroutine. The live scores over WebSocket guide covers connect, subscribe and reconnect.
What you can build with football data in Go
- A live-score microservice or an alert bot
- A fixtures-and-table API behind your own frontend
- Prefer another language? The same walkthrough exists for Python and JavaScript
Grab a free key and you're pulling live football data in Go in minutes.
FAQ
Is there an official Go football API SDK?
Yes. GOAL API ships an official Go SDK — go get github.com/goal-api/goal-api-go (package goalapi) — for Go 1.21+, with no third-party dependencies. You can also call the REST API directly with net/http.
How do I get live football scores in Go?
Construct the client with goalapi.New(apiKey), call client.Fixtures.Live(ctx, nil), and decode the result into your own struct with .Into(&dst). A free key covers it.
Is the Go client safe for concurrent use? Yes. Construct one client and share it across goroutines — it's safe for concurrent use, which suits live services that fan out many requests.
How do I get real-time updates in Go? Use the WebSocket: request a short-lived token, connect, and subscribe to matches to receive goals, cards and substitutions the moment they happen, each subscription in its own goroutine.


