Golang interface allowing to communicate with the Football-Data API to process football/soccer match information.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
CHANGELOG.md
README.md
api_methods.go
api_types.go
api_url.go
client.go
client_test.go
example_test.go
req_competition.go
req_competition_fixtures.go
req_competition_leaguetable.go
req_competition_teams.go
req_competitions.go
req_fixture.go
req_fixtures.go
req_soccerseason.go
req_soccerseason_fixtures.go
req_soccerseason_leaguetable.go
req_soccerseason_teams.go
req_soccerseasons.go
req_team.go
req_team_fixtures.go
req_team_players.go
response_meta.go
util.go
util_test.go

README.md

Football-Data API for Golang

Build Status GoDoc

This library provides functionality to communicate with the API provided by http://football-api.org. This way programs can use data provided by the API in order to show information about football/soccer games from various seasons for free.

How to use this library?

Before you use this library please register for a free API key in order to increase your usage limits. The library also works without an API key.

You can install this library by running:

go get github.com/icedream/go-footballdata

Afterwards you can use this library like this:

package main

import (
	"fmt"
	"net/http"

	"github.com/icedream/go-footballdata"
)

func main() {
	// Create client (optionally with auth token)
	client := new(footballdata.Client).
		WithToken("<insert your api token here>")

	// Get list of seasons...
	competitions, err := client.Competitions().Do()
	if err != nil {
		panic(err)
	}

	// ...and print them
	for _, competition := range competitions {
		fmt.Println(competition.Id, competition.Caption)
	}
}