{"id":15107961,"url":"https://github.com/go-vk-api/vk","last_synced_at":"2025-03-30T18:31:27.315Z","repository":{"id":46003750,"uuid":"59954152","full_name":"go-vk-api/vk","owner":"go-vk-api","description":"Go library for accessing the VK API","archived":false,"fork":false,"pushed_at":"2021-10-27T20:21:58.000Z","size":18,"stargazers_count":47,"open_issues_count":2,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-20T23:12:24.247Z","etag":null,"topics":["go","golang","vk","vk-api","vkontakte","vkontakte-api"],"latest_commit_sha":null,"homepage":"https://vk.com/dev","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/go-vk-api.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-29T16:53:45.000Z","updated_at":"2025-02-12T08:29:18.000Z","dependencies_parsed_at":"2022-09-10T04:26:26.180Z","dependency_job_id":null,"html_url":"https://github.com/go-vk-api/vk","commit_stats":null,"previous_names":["urshadow/go-vk-api"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-vk-api%2Fvk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-vk-api%2Fvk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-vk-api%2Fvk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-vk-api%2Fvk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-vk-api","download_url":"https://codeload.github.com/go-vk-api/vk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246363633,"owners_count":20765323,"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":["go","golang","vk","vk-api","vkontakte","vkontakte-api"],"created_at":"2024-09-25T21:43:27.954Z","updated_at":"2025-03-30T18:31:22.301Z","avatar_url":"https://github.com/go-vk-api.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-vk-api\n[![GoDoc](https://godoc.org/github.com/go-vk-api/vk?status.svg)](https://godoc.org/github.com/go-vk-api/vk)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-vk-api/vk)](https://goreportcard.com/report/github.com/go-vk-api/vk)\n\nGolang bindings for the VK API\n\n## Install\n\nInstall the package with:\n\n```bash\ngo get github.com/go-vk-api/vk\n```\n\nImport it with:\n\n```go\nimport \"github.com/go-vk-api/vk\"\n```\n\nand use `vk` as the package name inside the code.\n\n## Example\n\n[Full example with errors handling](https://github.com/go-vk-api/vk/blob/master/example/example.go)\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/go-vk-api/vk\"\n\tlp \"github.com/go-vk-api/vk/longpoll/user\"\n)\n\nfunc main() {\n\tclient, _ := vk.NewClientWithOptions(\n\t\tvk.WithToken(os.Getenv(\"VK_ACCESS_TOKEN\")),\n\t)\n\n\t_ = printMe(client)\n\n\tlongpoll, _ := lp.NewWithOptions(client, lp.WithMode(lp.ReceiveAttachments))\n\n\tstream, _ := longpoll.GetUpdatesStream(0)\n\n\tfor update := range stream.Updates {\n\t\tswitch data := update.Data.(type) {\n\t\tcase *lp.NewMessage:\n\t\t\tif data.Text == \"/hello\" {\n\t\t\t\t_ = client.CallMethod(\"messages.send\", vk.RequestParams{\n\t\t\t\t\t\"peer_id\":          data.PeerID,\n\t\t\t\t\t\"message\":          \"Hello!\",\n\t\t\t\t\t\"forward_messages\": data.ID,\n\t\t\t\t\t\"random_id\":        0,\n\t\t\t\t}, nil)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc printMe(api *vk.Client) error {\n\tvar users []struct {\n\t\tID        int64  `json:\"id\"`\n\t\tFirstName string `json:\"first_name\"`\n\t\tLastName  string `json:\"last_name\"`\n\t}\n\n\t_ = api.CallMethod(\"users.get\", vk.RequestParams{}, \u0026users)\n\n\tme := users[0]\n\n\tlog.Println(me.ID, me.FirstName, me.LastName)\n\n\treturn nil\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-vk-api%2Fvk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-vk-api%2Fvk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-vk-api%2Fvk/lists"}