VAKSMS API for Python 3
About
This library is a wrapper for the https://vak-sms.com/api/vak/ API from enthusiasts. All methods are described and all types are
explicitly defined. Methods that create requests to
https://vak-sms.com/api/vak/
return a pydantic's models for each response. Please write about all problems related to the library
to issues
API is up-to-date as of 01 October 2024.
Features
- It's completely asynchronous
- You can use multiple clients to work with multiple users or shops
- All methods for working with API are implemented
- The library returns strictly typed for responses from APIs
- For each method, docstrings are used
- The library handle {type: error} responses and throws VakSmsBadRequest exception
- Modern, strict code for Python 3.10+
Library Installation
- Install via pip:
pip install aiovaksms
- Download sources -
git clone https://github.com/AioSmsProviders/aiovaksms
Getting Started
Get user balance
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
balances = await client.get_balance()
print(balances)
asyncio.run(main())
Get number count
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
data = await client.get_count_number('cp')
print(data)
asyncio.run(main())
Get country list
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
data = await client.get_country_list()
print(data)
asyncio.run(main())
Get number
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
data = await client.get_number('ya')
print(data.lifetime)
print(data.lives_up_to)
print(data)
asyncio.run(main())
Recieve smscode
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
data = await client.get_sms_code('1725546315697382')
print(data)
asyncio.run(main())
request a new sms
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
data = await client.set_status('1725546315697382', 'send')
print(data)
asyncio.run(main())
get service full name, service info, service icons
this method not in official vaksms documentation
import asyncio
from aiovaksms import VakSms
async def main():
client = VakSms('TOKEN')
client = VakSms('TOKEN', base_url='moresms.net')
data = await client.get_count_number_list()
print(data)
print(data['mr'].name)
asyncio.run(main())
Contact
License
Released under GPL by @lolkofka.