Simplevk Php
Powerful PHP library/framework for VK API bots, supporting LongPoll & Callback & OAuth2
Last verified:
What is Simplevk Php?
Simplevk Php SimpleVK (SimpleVK-PHP) is a PHP library/framework designed for rapid development of bots for VK (VKontakte), the Russian social media platform. It implements most VK API methods as convenient functions, requiring minimal code to create bots. The library features a built-in bot constructor and ready-made modules that allow developers to write less code and launch projects faster.
Simplevk Php pricing
Pricing model: Freemium
SimpleVK is a free open-source library. It is available via Composer (composer require digitalstars/simplevk) or by downloading the latest release manually from GitHub. There are no paid tiers, subscription plans, or premium features. The library is completely free to use, and developers can also contribute via Pull Requests or support the project through Yandex.Money (410014638432302) or debit card (2202201272652211).
Simplevk Php pros
- Minimal code required to create bots
- Most VK API methods implemented as convenient functions
- Built-in bot constructor included
- Ready-made modules for common tasks
- Supports Callback API for webhook-based events
- Supports User Long Poll API
- Supports Bots Long Poll API
- Execute API support for batch requests
- VKCoin API integration
- Can create bots on user accounts
- Works with voice messages and documents
- Button/keyboard creation with sendButton()
- Composer installation available
- Automatic event deduplication
- Secret key validation for security
- Debug mode available
- Supports login/password or token authentication
- Easy variable initialization with initVars()
Simplevk Php cons
- Requires PHP 7.0 or higher
- Needs mbstring and curl modules
- Does not work on some free hosting (e.g., 000webhost)
- Free hosting must allow custom PHP headers
- Apache requires additional php.ini configuration
- Requires server restart after configuration changes
- Not ideal for high-load bots (NodeJS recommended instead)
- No native audio working support yet
- No stories API support yet
- Documentation could be more convenient
Frequently asked questions about Simplevk Php
What is SimpleVK?
SimpleVK is a PHP library for fast development of bots for VK (VKontakte). It implements most VK API methods as convenient functions, requiring minimal code to create bots. It includes a built-in bot constructor and ready-made modules for message broadcasting, command processing, and button creation.
What are the system requirements for SimpleVK?
SimpleVK requires PHP 7.0 or higher, along with the mbstring and curl PHP modules. For Debian/Ubuntu, install with: sudo apt-get install php7.0 php7.0-mbstring php7.0-curl. For Windows 10, mbstring is already installed, and you need to install PHP and curl separately.
How do I install SimpleVK?
You can install SimpleVK using Composer with the command: composer require digitalstars/simplevk. Alternatively, download the latest release manually and connect autoload.php. After installation, include require_once 'vendor/autoload.php' or require_once 'simplevk-master/autoload.php' depending on your setup.
What API methods does SimpleVK support?
SimpleVK supports Callback API, User Long Poll API, Bots Long Poll API, Execute API, and VKCoin API. Most VK API methods are implemented as convenient functions. The library also supports creating bots on user accounts and working with voice messages and documents.
How do I create a callback bot with SimpleVK?
Create a callback bot using: $vk = vk_api::create(VK_KEY, VERSION)->setConfirm(CONFIRM_STR); Then initialize variables with $vk->initVars() and handle events. The library automatically handles HTTP responses and includes secret key validation with setSecret() and event deduplication.
How do I create a LongPoll bot?
For a LongPoll bot: $vk = vk_api::create(VK_KEY, '5.101'); $vk = new LongPoll($vk); $vk->listen(function($data)use($vk){ $vk->on('message_new', function($data)use($vk){ $vk->reply($message); }); }); This works for both user accounts (with login/password) and community tokens.
Can I use SimpleVK on free hosting?
SimpleVK can only function stably on hosting with nginx or Apache web servers that allow sending custom headers from PHP. Free hosting like 000webhost uses a custom web server and will not work normally. The hosting must not block custom headers, otherwise VK may not receive responses in time.
How do I create buttons with SimpleVK?
Create buttons using: $info_btn = $vk->buttonText('Информация', 'blue', ['command' => 'info']); Then send with keyboard: $vk->sendButton($id, 'Видишь кнопку? Нажми на нее!', [[$info_btn]]); Buttons can have different colors (blue, green, red, grey) and payload commands for handling clicks.
What is Execute in SimpleVK?
Execute is used when a callback script makes many API calls during execution and you need to save requests to avoid exceeding limits. It's ideal for high-load bots. Use: $vk = new Execute($vk); The best combination for high-load bots is LongPoll + Execute, though NodeJS is recommended for very high loads due to better async handling.
How do I verify my server is ready for SimpleVK?
Create and run a diagnostic script: require_once _DIR_.'/vendor/digitalstars/simplevk/autoload.php'; \DigitalStars\SimpleVK\Diagnostics::run(); For LongPoll bots, run diagnostics via console. For callback bots, run via browser. The diagnostic checks if PHP, mbstring, curl, and openssl extensions are properly configured.