PHPackages                             freedomcore/vk-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. freedomcore/vk-api

ActiveLibrary[API Development](/categories/api)

freedomcore/vk-api
==================

FreedomCore VK API Library

1.0.5(10y ago)015CC-BY-SAPHPPHP &gt;=5.6

Since Apr 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/darki73/FreedomCoreVKAPI)[ Packagist](https://packagist.org/packages/freedomcore/vk-api)[ Docs](https://packages.freedomcore.ru/vk)[ RSS](/packages/freedomcore-vk-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

\[PHP\] FreedomCore VK API
==========================

[](#php-freedomcore-vk-api)

[![Build Status](https://camo.githubusercontent.com/e1a6e592d4b0beafa7453daf80d40f5f1ca5de412d6aa87e84309ad98b79dc12/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461726b6937332f46726565646f6d436f7265564b4150492f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/darki73/FreedomCoreVKAPI/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0761b6923e588906b53137c203ce30ca9c7c0195ec632435284c3386acfd219a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461726b6937332f46726565646f6d436f7265564b4150492f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/darki73/FreedomCoreVKAPI/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/873e2a0a473846d3086837f7435c579cc6766f5c94a32203044b9a7b17e62b0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66726565646f6d636f72652f766b2d6170692e737667)](https://packagist.org/packages/freedomcore/vk-api)[![Total Downloads](https://camo.githubusercontent.com/2ba868b5fb081ce0432c7c9e2d92abe686014a231017e0585402748f71060a66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66726565646f6d636f72652f766b2d6170692e737667)](https://packagist.org/packages/freedomcore/vk-api)[![Downloads Month](https://camo.githubusercontent.com/68a519a42e92e20328c0bd300ddb1bb6e39034f7a78325e11194fb64a6f4eab7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f66726565646f6d636f72652f766b2d6170692e737667)](https://packagist.org/packages/freedomcore/vk-api)[![License](https://camo.githubusercontent.com/c704ca7d2ef893828193803f1201bfe89513788c68f39bcf475593b0b03b0297/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66726565646f6d636f72652f766b2d6170692e737667)](https://github.com/darki73/FreedomCoreVKAPI/blob/master/LICENSE.md)

A PHP VK API Client based on official [VK API Documentation](https://vk.com/dev)

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Instructions](#instructions)
    - [Require this package with Composer](#require-this-package-with-composer)
    - [Configuration](#configuration)
- [Resources](#resources)
    - [VKBase](#vkbase-resource)
    - [VKAccount](#vkaccount-resource)
    - [VKDataStorage](#vkdatastorage-resource)
    - [VKDocuments](#vkdocuments-resource)
    - [VKGroups](#vkgroups-resource)
    - [VKUsers](#vkusers-resource)

Introduction
------------

[](#introduction)

This is a pure PHP implementation of VK API Client library. It can be easy extended by adding additional resource classes to API folder.

Pros:

- Can authorize users with specific scope
- Can check for required scope before executing API call
- Works with: Users, Groups, DataStorage, Account and Documents APIs
- Easy to modify
- Easy to use

---

This code is available on [Github](https://github.com/darki73/FreedomCoreVKAPI). Pull requests are welcome.

### Require this package with Composer

[](#require-this-package-with-composer)

Install this package through [Composer](https://getcomposer.org/). Edit your project's `composer.json` file to require `freedomcore/vk-api`.

Create *composer.json* file

```
{
    "name": "nameofyourproject/nameofyourproject",
    "type": "project",
    "require": {
        "php": ">=5.6.0",
        "freedomcore/vk-api": "*"
    }
}
```

and run `composer update`

**or**

run this command in your command line:

```
composer require freedomcore/vk-api

```

### Configuration

[](#configuration)

1. Create New Object
    a. To work with Library *before* authorization completed ```
    $vkObject = new FreedomCore\VK\VKBase('{APPLICATION_ID}', '{API_SECRET}');

    ```

    b. To work with Library *after* authorization completed ```
    $vkObject = new FreedomCore\VK\VKBase('{APPLICATION_ID}', '{API_SECRET}', '{ACCESS_TOKEN}');

    ```
2. How to authorize user
    a. Generate Authorization Link ```
    $vkObject->getAuthorizationURL('{SCOPE}', '{CALLBACK_URL}');

    ```

    b. Get Access Token By Using Key From Callback ```
    $vkObject->getAccessToken('{CODE}');

    ```

    c. Check, if user authorized ```
    $vkObject->isAuthorized(); // returns true | false

    ```
3. Now you can work with API

Resources
---------

[](#resources)

### VKBase Resource

[](#vkbase-resource)

This is the main Library resource

There are 4 API Methods presented in this Resource:

1. `setAPIVersion({API_VERSION})` - Set API Version Provided By User
2. `getAuthorizationURL({SCOPE}, {CALLBACK_URL}, {RESPONSE_TYPE}, {TEST_MODE})` - Returns Authorization Link With Passed Parameters
3. `getAccessToken({CODE}, {CALLBACK_URL})` - Returns Access Token From Authorization Link
4. `isAuthorized()` - Returns User Authorization Status

### VKAccount Resource

[](#vkaccount-resource)

This Resource allows you to get user related data

***How to use:***

Initialize New *VKAccount* object:

```
$VKAccount = new FreedomCore\VK\API\VKAccount($vkObject);
```

Now you can call methods, e.g.

```
$getCounters = $VKAccount->getCounters();
$getApplicationPermissions = $VKAccount->getAppPermissions({USER_ID});
```

There are 6 API Methods presented in this Resource:

1. `getCounters({USER_FIELDS optional)` - Fetches all counters which are greater than zero (messages, videos, friends, etc)
2. `setNameInMenu({USER_ID}, {APPLICATION_NAME}` - Creates Sidebar Link to application, if user allowed it
3. `setOnline()` - Sets status to Online for 15 minutes
4. `setOffline()` - Sets status to Offline
5. `getActiveOffers({OFFSET optional}, {COUNT optional})` - Returns a list of active ads (offers)
6. `getAppPermissions()` - Gets settings of the current user in this application

### VKDataStorage Resource

[](#vkdatastorage-resource)

*Missing Description*

There are 3 API Methods presented in this Resource:

1. `get({KEY}, {KEYS}, {USER_ID}, {IS_GLOBAL})` - Returns a value of variable with the name set by key parameter
2. `set({KEY}, {VALUE}, {USER_ID}, {IS_GLOBAL})` - Saves a value of variable with the name set by key parameter
3. `getKeys({USER_ID}, {IS_GLOBAL}, {OFFSET optional}, {COUNT optional})` - Returns the names of all variables

### VKDocuments Resource

[](#vkdocuments-resource)

***Attention:*** *This Resourse is incomplete | There are 7 more methods to be added*

This Resource allows you to work with documents which are belong to user/group

***How to use:***

Initialize New *VKDocuments* object:

```
$VKDocuments = new FreedomCore\VK\API\VKDocuments($vkObject);
```

Now you can call methods, e.g.

```
$isMember = $VKDocuments->get(123456, 100); // returns 100 results
$searchForGroups = $VKDocuments->getById('123456_654321'); // gets document by ID
```

There are 3 API Methods presented in this Resource:

1. `get({OWNER_ID}, {COUNT optional}, {OFFSET optional})` - Returns detailed information about user or community documents
2. `getById({DOCUMENT_ID_OR_ARRAY_OF_IDS})` - Returns information about documents by their IDs
3. `getUploadServer({COMMUNITY_ID})` - Returns the server address for document upload

### VKGroups Resource

[](#vkgroups-resource)

***How to use:***

This Resource allows you to manage groups and work with them

Initialize New *VKGroups* object:

```
$VKGroups = new FreedomCore\VK\API\VKGroups($vkObject);
```

Now you can call methods, e.g.

```
$isMember = $VKGroups->isMember(123456, 654321, 1);
$searchForGroups = $VKGroups->search('FreedomCore');
```

There are 19 API Methods presented in this Resource:

1. `isMember({GROUP_ID}, {USER_ID}, {IS_EXTENDED optional})` - Returns information specifying whether a user is a member of a community
2. `getById({GROUP_ID}, {GROUP_FIELDS})` - Returns information about communities by their ID (IDs)
3. `get({USER_ID}, {IS_EXTENDED optional}, {FILTER optional}, {GROUP_FIELDS optional})` - Returns a list of the communities to which a user belongs
4. `getMembers({GROUP_ID}, {USERS_FIELDS optional})` - Returns a list of community members
5. `join({GROUP_ID}, {IS_EVENT optional})` - With this method you can join the group or public page, and also confirm your participation in an event.
6. `leave({GROUP_ID})` - With this method you can leave a group, public page, or event.
7. `search({QUERY}, {GROUP_TYPE optional})` - Searches for communities by substring.
8. `getInvites({IS_EXTENDED optional})` - Returns a list of invitations to join communities and events.
9. `getInvitedUsers({GROUP_ID}, {USERS_FIELDS optional})` - Returns invited users list of a community ***(Requires Moderator Status)***
10. `banUser({GROUP_ID}, {USER_ID}, {REASON optional}, {COMMENT optional}, {BAN_ENDS optional}, {SHOW_COMMENT optional})` - Adds a user to a community blacklist ***(Requires Moderator Status)***
11. `unbanUser({GROUP_ID}, {USER_ID})` - Deletes a user from a community blacklist ***(Requires Moderator Status)***
12. `getBanned({GROUP_ID})` - Returns a list of users on a community blacklist ***(Requires Moderator Status)***
13. `create({TITLE}, {DESCRIPTION}, {TYPE optional}, {SUB_TYPE optional})` - Creates a new community
14. `edit({GROUP_ID}, {TITLE}, {DESCRIPTION}, {SCREEN_NAME}, {ACCESS}, {WEBSITE}, {SUBJECT})` - Edits a community ***(THIS METHOD INCOMPLETE)***
15. `getSettings({GROUP_ID})` - Get Group Settings
16. `getRequests({GROUP_ID}, {FIELDS optional}, {COUNT optional})` - Get Group Access Requests
17. `invite({GROUP_ID}, {USER_ID})` - Invite User To Group ***(Requires Moderator Status)***
18. `removeUser({GROUP_ID}, {USER_ID})` - Remove User From Group ***(Requires Moderator Status)***
19. `approveRequest({GROUP_ID}, {USER_ID})` - Approve User Request To Join Group ***(Requires Moderator Status)***

### VKUsers Resource

[](#vkusers-resource)

This Resource allows you to work with users and their data

***How to use:***

Initialize New *VKUsers* object:

```
$VKUsers= new FreedomCore\VK\API\VKUsers($vkObject);
```

Now you can call methods, e.g.

```
$isMember = $VKUsers->isMember(123456, 654321, 1);
$searchForGroups = $VKUsers->search('FreedomCore');
```

There are 6 API Methods presented in this Resource:

1. `get({USER_IDS array}, {FIELDS optional}, {CASE optional})` - Returns detailed information on users
2. `search({QUERY}, {IS_ONLINE optional}, {FIELDS optional}, {SORT optional}, {COUNT optional})` - Returns a list of users matching the search criteria
3. `isAppUser({USER_ID})` - Returns information whether a user installed the application
4. `getSubscriptions({USER_ID}, {COMBINE optional}, {FIELDS optional}, {COUNT optional})` - Returns a list of IDs of users and communities followed by the user
5. `getFollowers({USER_ID}, {OFFSET optional}, {COUNT optional}, {FIELDS optional}, {CASE optional})` - Returns a list of IDs of followers of the user in question, sorted by date added, most recent first
6. `getNearby({LATITUDE}, {LONGITUDE}, {TIMEOUT optional}, {RADIUS optional}, {FIELDS optional}, {CASE optional})` - Get Nearby Users Based On Current Latitude and Longitude

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3696d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59848fdf0747788942e0c30e483a8eccb4698e0c34db490db565b6a18992442d?d=identicon)[darki73](/maintainers/darki73)

---

Top Contributors

[![darki73](https://avatars.githubusercontent.com/u/1318627?v=4)](https://github.com/darki73 "darki73 (12 commits)")

---

Tags

apilibraryvkvkontakteofficialfreedomcore

### Embed Badge

![Health badge](/badges/freedomcore-vk-api/health.svg)

```
[![Health](https://phpackages.com/badges/freedomcore-vk-api/health.svg)](https://phpackages.com/packages/freedomcore-vk-api)
```

###  Alternatives

[getjump/vk

Library for work with API Vk.com

19948.5k](/packages/getjump-vk)[digitalstars/simplevk

Powerful PHP library/framework for VK API bots, supporting LongPoll &amp; Callback &amp; OAuth

883.9k3](/packages/digitalstars-simplevk)[jumper423/yii2-vk

Расширенная работа с API VK

301.6k](/packages/jumper423-yii2-vk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
