Go SDK
A client for every API operation, with OAuth2 and iterators.
Install
Go 1.25 or later (tested on 1.25, 1.26 and 1.27). You also need OAuth2 credentials: the client ID and secret of a service account.
go get github.com/ovh/sdk-go
First program
This prints the details of your account: `GET /v1/me`. Copy it, set your credentials, run it.
package main import ( "context" "fmt" "log" "github.com/ovh/sdk-go/ovh" "github.com/ovh/sdk-go/pkg/me") func main() { client, err := ovh.NewClient() // reads OVH_CLIENT_ID, OVH_CLIENT_SECRET, OVH_REGION if err != nil { log.Fatal(err) } account, err := me.New(client).GetAccountDetails(context.Background()) // GET /v1/me if err != nil { log.Fatal(err) } fmt.Println("account:", ovh.Value(account.Nichandle)) fmt.Println("email: ", ovh.Value(account.Email)) fmt.Println("country:", ovh.Value(account.Country))}
Run it
export OVH_CLIENT_ID=... OVH_CLIENT_SECRET=...export OVH_REGION=eu # eu (default), ca or usgo run .