{"id":13581817,"url":"https://github.com/vultr/govultr","last_synced_at":"2026-02-06T00:05:40.296Z","repository":{"id":34989433,"uuid":"184792968","full_name":"vultr/govultr","owner":"vultr","description":"Vultr Go API client","archived":false,"fork":false,"pushed_at":"2025-05-06T14:39:25.000Z","size":925,"stargazers_count":239,"open_issues_count":6,"forks_count":58,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-08T05:34:47.504Z","etag":null,"topics":["api","go","golang","vultr","vultr-api"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vultr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-03T17:13:37.000Z","updated_at":"2025-05-06T14:39:29.000Z","dependencies_parsed_at":"2024-03-08T00:21:56.934Z","dependency_job_id":"7575bae8-f7bb-485a-b099-a439d4cb1a4e","html_url":"https://github.com/vultr/govultr","commit_stats":{"total_commits":626,"total_committers":29,"mean_commits":"21.586206896551722","dds":0.4073482428115016,"last_synced_commit":"e3ae6995bf904843bf634caa3d30de0dc9c4a44a"},"previous_names":[],"tags_count":98,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vultr%2Fgovultr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vultr%2Fgovultr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vultr%2Fgovultr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vultr%2Fgovultr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vultr","download_url":"https://codeload.github.com/vultr/govultr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052692,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","go","golang","vultr","vultr-api"],"created_at":"2024-08-01T15:02:15.555Z","updated_at":"2026-02-06T00:05:40.231Z","avatar_url":"https://github.com/vultr.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# GoVultr\n\n[![Automatic Releaser](https://github.com/vultr/govultr/actions/workflows/releaser.yml/badge.svg)](https://github.com/vultr/govultr/actions/workflows/releaser.yml)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/vultr/govultr/v3)](https://pkg.go.dev/github.com/vultr/govultr/v3)\n[![Unit/Coverage Tests](https://github.com/vultr/govultr/actions/workflows/coverage.yml/badge.svg)](https://github.com/vultr/govultr/actions/workflows/coverage.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/vultr/govultr)](https://goreportcard.com/report/github.com/vultr/govultr)\n\nThe official Vultr Go client - GoVultr allows you to interact with the Vultr V2 API.\n\n## Installation\n\n```sh\ngo get -u github.com/vultr/govultr/v3\n```\n\n## Usage\n\nVultr uses a personal access token (PAT) to interact/authenticate with the\nAPIs. Generate an API Key from the [API menu](https://my.vultr.com/settings/#settingsapi) \nin the Vultr Customer Portal.\n\nTo instantiate a GoVultr client, invoke `NewClient()`. Most operations require\nthat you pass a PAT to an `oauth2` library to create the `*http.Client`, which\nconfigures the `Authorization` header with your PAT as the `bearer api-key`. If \na PAT is not provided, public operations like listing plans or applications\nwill still work.\n\nThe client has three optional parameters:\n\n- BaseUrl: Change the Vultr default base URL\n- UserAgent: Change the Vultr default UserAgent\n- RateLimit: Set a delay between calls. Vultr limits the rate of back-to-back calls. Use this parameter to avoid rate-limit errors.\n\n### Example Client Setup\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"os\"\n\n  \"github.com/vultr/govultr/v3\"\n  \"golang.org/x/oauth2\"\n)\n\nfunc main() {\n  apiKey := os.Getenv(\"VultrAPIKey\")\n\n  config := \u0026oauth2.Config{}\n  ctx := context.Background()\n  ts := config.TokenSource(ctx, \u0026oauth2.Token{AccessToken: apiKey})\n  vultrClient := govultr.NewClient(oauth2.NewClient(ctx, ts))\n\n  // Optional changes\n  _ = vultrClient.SetBaseURL(\"https://api.vultr.com\")\n  vultrClient.SetUserAgent(\"mycool-app\")\n  vultrClient.SetRateLimit(500)\n}\n```\n\nPassing `nil` to `NewClient` will work for routes that do not require\nauthentication.\n\n```go\n  ... \n\n  vultrClient := govultr.NewClient(nil)\n  ctx := context.Background()\n  plans, _, _, err := vultrClient.Plan.List(ctx, \"\", nil)\n\n  ...\n```\n\n### Example Usage\n\nCreate a VPS\n\n```go\ninstanceOptions := \u0026govultr.InstanceCreateReq{\n  Label:                \"awesome-go-app\",\n  Hostname:             \"awesome-go.com\",\n  Backups:              \"enabled\",\n  EnableIPv6:           BoolToBoolPtr(false),\n  OsID:                 362,\n  Plan:                 \"vc2-1c-2gb\",\n  Region:               \"ewr\",\n}\n\nres, err := vultrClient.Instance.Create(context.Background(), instanceOptions)\n\nif err != nil {\n  fmt.Println(err)\n}\n```\n\n## Pagination\n\nGoVultr v2 introduces pagination for all list calls. Each list call returns a\n`meta` struct containing the total amount of items in the list and\nnext/previous links to navigate the paging.\n\n```go\n// Meta represents the available pagination information\ntype Meta struct {\n  Total int `json:\"total\"`\n  Links *Links\n}\n\n// Links represent the next/previous cursor in your pagination calls\ntype Links struct {\n  Next string `json:\"next\"`\n  Prev string `json:\"prev\"`\n}\n\n```\nPass a `per_page` value to the `list_options` struct to adjust the number of\nitems returned per call. The default is 100 items per page and max is 500 items\nper page.\n\nThis example demonstrates how to retrieve all of your instances, with one\ninstance per page.\n\n```go\nlistOptions := \u0026govultr.ListOptions{PerPage: 1}\nfor {\n    i, meta, err := client.Instance.List(ctx, listOptions)\n    if err != nil {\n        return nil, err\n    }\n    for _, v := range i {\n        fmt.Println(v)\n    }\n\n    if meta.Links.Next == \"\" {\n        break\n    } else {\n        listOptions.Cursor = meta.Links.Next\n        continue\n    }\n}\n```\n## Versioning\n\nThis project follows [SemVer](http://semver.org/) for versioning. For the\nversions available, see the [tags on this\nrepository](https://github.com/vultr/govultr/tags).\n\n## Documentation\n\nSee our documentation for [detailed information about API v2](https://www.vultr.com/api/).\n\nSee our [GoDoc](https://pkg.go.dev/github.com/vultr/govultr/v3) documentation for more details about this client's functionality.\n\n## Contributing\n\nFeel free to send pull requests our way! Please see the [contributing guidelines](CONTRIBUTING.md).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvultr%2Fgovultr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvultr%2Fgovultr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvultr%2Fgovultr/lists"}