Skip to content

Instantly share code, notes, and snippets.

@kgravenreuth
Created September 16, 2021 03:10
Show Gist options
  • Save kgravenreuth/e51b2178bae982ad7aea53a9840ea922 to your computer and use it in GitHub Desktop.
Save kgravenreuth/e51b2178bae982ad7aea53a9840ea922 to your computer and use it in GitHub Desktop.
Cloudbet API Account Balances in Go
req, err := http.NewRequest("GET", "https://sports-api.cloudbet.com/pub/v1/account/currencies", nil)
if err != nil {
return err
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-API-Key", "eyJ...") // <-- use your API key
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return err
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
return err
}
fmt.Printf("%s\n", bodyText) // {"currencies":["BONUS_EUR","BTC","ETH","PLAY_EUR"]}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment