Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.1 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.1 KB

smsroute (Python)

Official Python client for the smsroute.cc SMS API — send SMS to 150+ countries. No third-party dependencies (stdlib only).

pip install smsroute
from smsroute import SmsRoute

sms = SmsRoute()  # reads SMSROUTE_API_KEY from the environment

res = sms.send(
    to="+447700900000",     # E.164
    sender="MyBrand",       # alphanumeric sender ID - see country rules below
    text="Your code is 123456",
)
print(res)

API

Method Purpose
send(to, text, sender=None) send one message
status(message_id) delivery status
balance() account balance

Errors raise SmsRouteError with .status and .body. Requests time out after 15s.

Sender IDs differ by country

Alphanumeric sender IDs require pre-registration in many countries and are banned in some. Open dataset of the rules: sms-sender-id-regulations.

Links

MIT licensed.