A Go Client for the Football-data.org API.
# In terminal do:
$ go get -u github.com/tralahm/football-data.org
package main
import (
"fmt"
football_data "github.com/tralahm/football-data.org"
)
func main() {
XAuthToken := "your football-data api key"
apiClient := football_data.NewAPIClient(XAuthToken)
leaguesResponse := apiClient.GetLeagues()
fmt.Println(leaguesResponse.Competitions[0])
LeagueID := "2018"
competition := apiClient.GetLeague(LeagueID)
fmt.Println(competition)
gamesResponse := apiClient.GetGames(LeagueID)
fmt.Println(gamesResponse.Matches[0])
teamsResponse := apiClient.GetTeams(LeagueID)
fmt.Println(teamsResponse.Teams[0])
GameID := "239019"
gameR := apiClient.GetGameDetails(GameID)
fmt.Println(gameR.Head2Head, gameR.Match)
standingsResponse := apiClient.GetLeague(LeagueID)
fmt.Println(standingsResponse.Standings[0])
}