{"id":20577739,"url":"https://github.com/elias506/vk-sdk","last_synced_at":"2025-04-14T19:02:28.212Z","repository":{"id":56854811,"uuid":"525186464","full_name":"elias506/vk-sdk","owner":"elias506","description":"Software development kit for VK API","archived":false,"fork":false,"pushed_at":"2022-09-24T13:11:22.000Z","size":308,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T07:22:33.589Z","etag":null,"topics":["api","go","golang","vk","vk-sdk"],"latest_commit_sha":null,"homepage":"","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/elias506.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-16T01:01:20.000Z","updated_at":"2024-07-09T13:56:23.000Z","dependencies_parsed_at":"2022-09-26T20:31:29.481Z","dependency_job_id":null,"html_url":"https://github.com/elias506/vk-sdk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias506%2Fvk-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias506%2Fvk-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias506%2Fvk-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias506%2Fvk-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elias506","download_url":"https://codeload.github.com/elias506/vk-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943380,"owners_count":21186956,"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","vk","vk-sdk"],"created_at":"2024-11-16T06:08:20.674Z","updated_at":"2025-04-14T19:02:28.160Z","avatar_url":"https://github.com/elias506.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VK-SDK\n[![Go Report Card](https://goreportcard.com/badge/github.com/elias506/vk-sdk)](https://goreportcard.com/report/github.com/elias506/vk-sdk)\n![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/elias506/vk-sdk?display_name=tag\u0026include_prereleases)\n![Lines of code](https://img.shields.io/tokei/lines/github/elias506/vk-sdk)\n[![Contributors](https://img.shields.io/github/contributors/elias506/vk-sdk)](https://img.shields.io/github/contributors-anon/elias506/vk-sdk)\n[![Go Reference](https://pkg.go.dev/badge/github.com/elias506/vk-sdk.svg)](https://pkg.go.dev/github.com/elias506/vk-sdk)\n[![License](https://img.shields.io/github/license/elias506/vk-sdk)](https://img.shields.io/github/license/elias506/vk-sdk)\n\nPackage vk-sdk provides a **full generated** development kit to work \nwith [VKontakte API](https://dev.vk.com/method). The lack of reflection and using \n[easyjson](https://github.com/mailru/easyjson) for objects represents a powerful performance.\n**All** methods, error codes, objects and responses with provided descriptions are included.\n\nCode was generated by using [fork](github.com/elias506/vk-api-schema) from official \n[vk-api-schema](https://github.com/VKCOM/vk-api-schema). In other words, the package\nis easy to maintain and can be comfortably used by consumers because of its comprehensive documentation.\n\n### Contributing\nWe are welcome to new participants of the project. Feel free to create a \n[bug](https://github.com/elias506/vk-sdk/issues/new?assignees=elias506\u0026labels=bug\u0026template=bug_report.md\u0026title=) \nor [enhancement](https://github.com/elias506/vk-sdk/issues/new?assignees=elias506\u0026labels=enhancement\u0026template=feature_request.md\u0026title=) \nissue and new [pull request](https://github.com/elias506/vk-sdk/pulls).\n\n## Get started\n### Install:\n```sh\ngo get github.com/elias506/vk-sdk\n```\n\n## Examples\nLook for full in `vk-sdk/example/example.go`:\n\n**Get friends in online:**\n```go\n// Get new client instants with provided token\nvk := vk_sdk.NewVK(http.DefaultClient, \"\u003cyour_token\u003e\")\n\n// Get your online friend IDs\nreq := vk_sdk.Friends_GetOnline_Request{}\n\nresp, apiErr, err := vk.Friends_GetOnline(context.Background(), req, vk_sdk.TestMode())\n\nif err != nil || apiErr != nil {\n    log.Fatal()\n}\n\nfmt.Println(\"Online friends IDs:\", resp.Response) \n```\n\n**Use Implicit/AuthCode flows to auth:**\n```go\n// Build auth request\nauthReq := vk_sdk.ImplicitFlowUserRequest{\n    ClientID:    \"\u003cyour_id\u003e\", \n    //RedirectURI: \"\",\n    //Display:     nil,\n    //Scope:       nil,\n    //State:       nil,\n    //Revoke:      false,\n}\n\n// get redirect url for user\nredirectURL := vk_sdk.GetAuthRedirectURL(authReq)\n\n// wait user redirect... \n\n// get token from redirect url \ntoken, oAuthErr, err := vk_sdk.GetImplicitFlowUserToken(\u003cuser_url\u003e)\n\nif err != nil || oAuthErr != nil {\n    log.Fatal()\n}\n```\n\n## Features\n- `LimitClient` is `http.Client` implementation to do requests \nwith provided frequency \n- Generated error codes with description, possible solution and links to subcodes.\nFor example:\n```go\n// Error_Request Invalid request.\n// May contain one of the listed subcodes: [ UserReachedLinkedAccountsLimit, ServiceUuidLinkWithAnotherUser ].\n// Solution: Check the request syntax (https://vk.com/dev/api_requests) and used parameters list (it can be found on a method description page).\n//  IsGlobal: true\nError_Request ErrorCode = 8\n```\n- Generated access permissions with specification.\nFor example:\n````go\n// UserPermissionWall Access to standard and advanced methods for the wall.\n// Note that this access permission is unavailable for sites (it is ignored at attempt of authorization).\nUserPermissionWall AccessPermission = 1 \u003c\u003c 13\n````\n- Method descriptions contains \nSchema specification, token types, additional error code links, and `dev.vk.com` method link.\nFor example:\n```go\n// Docs_Delete Deletes a user or community document.\n// May execute with listed access token types:\n//    [ user ]\n// When executing method, may return one of global or with listed codes API errors:\n//    [ Error_ParamDocDeleteAccess, Error_ParamDocId ]\n//\n// https://dev.vk.com/method/docs.delete\nfunc (vk *VK) Docs_Delete(ctx context.Context, req Docs_Delete_Request, options ...Option) (resp Base_Ok_Response, apiErr ApiError, err error) {\n\tvalues := make(url.Values, 4+len(options))\n\tif err = req.fillIn(values); err != nil {\n\t\treturn\n\t}\n\tsetOptions(values, options)\n\tapiErr, err = vk.doReq(\"docs.delete\", ctx, values, \u0026resp)\n\treturn\n}\n```\n- Every method contains implies presence context for internal client\nand additional method option like response language, on/off application test mode\nand captcha parameters.\n- Enums generate extended name/value from vk-api-shcema.\nFor example:\n```go\n// Ads_AdCostType Cost type\ntype Ads_AdCostType int\n\nconst (\n    Ads_AdCostType_PerClicks               Ads_AdCostType = 0\n    Ads_AdCostType_PerImpressions          Ads_AdCostType = 1\n    Ads_AdCostType_PerActions              Ads_AdCostType = 2\n    Ads_AdCostType_PerImpressionsOptimized Ads_AdCostType = 3\n)\n```\nHere constant named `PerClicks` contains int value `0` and so on.\n- Using [easyjson](https://github.com/mailru/easyjson) to work with api requests/responses \n- There is up-to-date generated `vk-api` version\n\n## Main idea\n`vk-sdk` aims to be user-friendly due to the completeness of the generated code \nand descriptions, and at the same time to show good executed speed. \nThis package reduces the amount of appeals to official API documentation for validating your request/response structure.\nJust use right method. Right here.\n\nIn addition, code generation allows SDK developers to focus on improving \nuser experience and performance rather than fixing bugs and write large commits. \nAny code change can be submitted and updated in all places just within a few seconds.\n\n## Benchmarks\n`go-vk-api/vk` use simple fields mapping without composition by method and execute with from-the-box speed.\nIn turn `SevereCloud/vksdk` use `reflect` package to add input data to request.\n\n| lib                         | req/resp size | count       |  ns/op |    B/op | allocs/op |\n|:----------------------------|:--------------|-------------|-------:|--------:|----------:|\n| vk-sdk                      | medium        | 220738      |   5435 |    9064 |        60 |\n| SevereCloud/vksdk           | medium        | 127970      |   9342 |   16165 |       117 |\n| go-vk-api/vk                | medium        | 220962      |   5543 |    8787 |        64 |\n| vk-sdk                      | small         | 406672      |   2981 |    3424 |        44 |\n| SevereCloud/vksdk           | small         | 271036      |   4420 |    5126 |        65 |\n| go-vk-api/vk                | small         | 467112      |   2506 |    3129 |        41 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias506%2Fvk-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felias506%2Fvk-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias506%2Fvk-sdk/lists"}