{"id":15107954,"url":"https://github.com/vorkytaka/easyvk-go","last_synced_at":"2025-10-23T02:31:38.248Z","repository":{"id":57495411,"uuid":"88286046","full_name":"Vorkytaka/easyvk-go","owner":"Vorkytaka","description":"Simple way to work with VK API","archived":false,"fork":false,"pushed_at":"2019-09-16T11:23:54.000Z","size":84,"stargazers_count":46,"open_issues_count":2,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-12T09:49:28.997Z","etag":null,"topics":["golang","vk","vk-api","vkontakte"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vorkytaka.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":"2017-04-14T16:55:11.000Z","updated_at":"2023-09-10T09:22:57.000Z","dependencies_parsed_at":"2022-08-31T12:52:00.897Z","dependency_job_id":null,"html_url":"https://github.com/Vorkytaka/easyvk-go","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vorkytaka%2Feasyvk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vorkytaka%2Feasyvk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vorkytaka%2Feasyvk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vorkytaka%2Feasyvk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vorkytaka","download_url":"https://codeload.github.com/Vorkytaka/easyvk-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237769067,"owners_count":19363250,"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":["golang","vk","vk-api","vkontakte"],"created_at":"2024-09-25T21:43:26.817Z","updated_at":"2025-10-23T02:31:37.800Z","avatar_url":"https://github.com/Vorkytaka.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyVK [![GoDoc](https://godoc.org/github.com/vorkytaka/easyvk-go/easyvk?status.svg)](https://godoc.org/github.com/vorkytaka/easyvk-go/easyvk)\nPackage EasyVK provides you simple way to work with VK API.\n\n![Logo](./logo.png)\n\n### Installation:\n#### Install:\n```\n$ go get -u github.com/vorkytaka/easyvk-go/easyvk\n```\n#### Import:\n```go\nimport \"github.com/vorkytaka/easyvk-go/easyvk\"\n```\n\n### How to work:\nInitialize your VK object with your access token.\n```go\nvk := easyvk.WithToken(\"token\")\n```\nOr you can log in by email and password.\n```go\n// put your email, password, client id and scope\n// scope must be a string like \"friends,wall\"\nvk, err := easyvk.WithAuth(\"my@beautiful.mail\", \"pa$$word\", \"9182736\", \"friends,wall,photos\")\nif err != nil {\n\t// doesn't log in\n}\n```\n\nNow you can call method of VK API with your vk variable.\n\n### Examples:\nGet user profile info:\n```go\ninfo, err := vk.Account.GetProfileInfo()\n```\nSet user status:\n```go\n// If you want to update status on your page\n// then set ID to 0\nuserID := 0\nok, err := vk.Status.Set(\"New status\", userID)\n```\nPost photo on wall:\n```go\nid := 0\n\nserver, err := vk.Photos.GetWallUploadServer(uint(id))\nif err != nil {\n\tlog.Fatal(err)\n}\n\n// path to the image\npath := \"D:/x.png\"\nuploaded, err := vk.Upload.PhotoWall(server.UploadURL, path)\nif err != nil {\n\tlog.Fatal(err)\n}\n\nsaved, err := vk.Photos.SaveWallPhoto(0, uint(id), uploaded.Photo, uploaded.Hash, \"\", uploaded.Server, 0, 0)\nif err != nil {\n\tlog.Fatal(err)\n}\n\ntext := \"Caption for the post\"\nphotoID := \"photo\" + fmt.Sprint(saved[0].OwnerID) + \"_\" + fmt.Sprint(saved[0].ID)\n\nparams := easyvk.WallPostParams{}\nparams.OwnerID = id\nparams.Message = \"Test\"\nparams.Attachments = photoID\n\nx, err := vk.Wall.Post(params)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Println(x)\n```\n\n### If you need to call method that not done yet:\n```go\nmethodName := \"account.banUser\"\nparams := map[string]string{\n        \"user_id\": \"1\",\n}\nbyteArray, err := vk.Request(methodName, params)\nif err != nil {\n        \n}\n// Now work with byteArray.\n// Parse it to struct or to interface.\n```\n\n### Naming conventions:\n\n#### API section:\n\nEvery API section must be a structure and have name as it called in API and starts with a capital letter.\n\n*For example:*\n[Account](https://vk.com/dev/account) section must be  ```type Account struct {}```\n\n#### API methods:\n\nEvery API method must be a method that have a received type of his section.\nIt must have name as it called in API and starts with a capital letter.\n\n*For example:*\n[Account.banUser](https://vk.com/dev/account.banUser) method must be ```func (a *Account) BanUser() {}```\n\n#### Parameters:\n\nIf method requests 4 or less parameters, then they must be just a parameters.\n\n*For example:* ```func (a *Account) BanUser(userID uint) {}```\n\nIf method requests 5 or more parameters, then he must get it with a structure.\nThat structure must naming like ```[SectionName][MethodName]Params```.\n\n*For example:* ```type WallPostParams struct {}```\n\n#### Responses:\n\nIf method return only one field, then you must just return that field.\n\n*For example:*\n[Board.addTopic](https://vk.com/dev/board.addTopic) return ID of the created topic,\nso we just return integer.\n\nIf method return only 1 if succeeded, then we need to return boolean.\n\n*For example:*\n[Board.closeTopic](https://vk.com/dev/board.closeTopic) return 1 is succeded, so\nwe check if it's 1 and return true, and false otherwise.\n\nIf method return object with 2 or more fields, then we need to create a structure for that response.\nThat structure must naming like ```[SectionName][MethodName]Response```.\n\n*For example*: ```type AccountGetCountersResponse struct {}```\n\n### List of finished methods:\n* [Account](https://vk.com/dev/account)\n    * [BanUser](https://vk.com/dev/account.banUser)\n    * [GetAppPermissions](https://vk.com/dev/account.getAppPermissions)\n    * [GetBanned](https://vk.com/dev/account.getBanned)\n    * [GetCounters](https://vk.com/dev/account.getCounters)\n    * [GetInfo](https://vk.com/dev/account.getInfo)\n    * [GetProfileInfo](https://vk.com/dev/account.getProfileInfo)\n    * [SetOffline](https://vk.com/dev/account.setOffline)\n    * [SetOnline](https://vk.com/dev/account.setOnline)\n    * [UnbanUser](https://vk.com/dev/account.unbanUser)\n* [Board](https://vk.com/dev/board)\n    * [AddTopic](https://vk.com/dev/board.addTopic)\n    * [CloseTopic](https://vk.com/dev/board.closeTopic)\n    * [DeleteTopic](https://vk.com/dev/board.deleteTopic)\n    * [EditTopic](https://vk.com/dev/board.editTopic)\n* [Fave](https://vk.com/dev/fave)\n    * [GetLinks](https://vk.com/dev/fave.getLinks)\n    * [GetPhotos](https://vk.com/dev/fave.getPhotos)\n    * [GetUsers](https://vk.com/dev/fave.getUsers)\n    * [GetVideos](https://vk.com/dev/fave.getVideos)\n* [Likes](https://vk.com/dev/likes) ✓\n    * [Add](https://vk.com/dev/likes.add)\n    * [Delete](https://vk.com/dev/likes.delete)\n    * [GetList](https://vk.com/dev/likes.getList)\n    * [IsLiked](https://vk.com/dev/likes.isLiked)\n* [Photos](https://vk.com/dev/photos)\n    * [GetWallUploadServer](https://vk.com/dev/photos.getWallUploadServer)\n    * [SaveWallPhoto](https://vk.com/dev/photos.saveWallPhoto)\n* [Status](https://vk.com/dev/status) ✓\n    * [Get](https://vk.com/dev/status.get)\n    * [Set](https://vk.com/dev/status.set)\n* [Wall](https://vk.com/dev/wall)\n    * [Post](https://vk.com/dev/wall.post)\n* Upload\n    * PhotoWall","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorkytaka%2Feasyvk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvorkytaka%2Feasyvk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorkytaka%2Feasyvk-go/lists"}