This project has migrated to sourcehut
Unofficial Go client library for the-odds-api.
import "github.com/fischersean/odds-api-go"
Then run go mod tidy
package main
import (
"fmt"
"github.com/fischersean/odds-api-go"
)
func main() {
c := oddsapi.NewClient("YOUR API KEY HERE")
s, err := c.GetSports(oddsapi.GetSportsInput{
IncludeInactive: false,
})
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(s)
}
package main
import (
"fmt"
"github.com/fischersean/odds-api-go"
)
func main() {
c := oddsapi.NewClient("YOUR API KEY HERE")
s, err := c.GetEvents(oddsapi.GetEventsInput{
Sports: []string{"americanfootball_nfl"},
Regions: []oddsapi.RegionType{oddsapi.RegionUS},
Markets: []oddsapi.MarketType{oddsapi.MarketMoneyline},
})
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(s)
}