Skip to main content

ego.tg — SMS Aggregation SDK. One API, every SMS provider.

Project description

egotg

Official Python SDK for ego.tg — SMS aggregation platform. One API, every SMS provider.

Install

pip install egotg

Quick Start

import egotg

client = egotg.Client("your_api_key")

# Get cheapest WhatsApp number
number = client.get_number(service="wa", country="auto")
print(f"Use this number: +{number.phone}")

# Wait for verification code
code = number.wait_for_code(timeout=120)
print(f"Got code: {code}")

# Done
number.complete()

API

Client

client = egotg.Client("your_api_key")
client = egotg.Client("your_api_key", base_url="https://ego.tg/api")

Account

balance = client.balance()  # Returns float (USD)

Services & Pricing

services = client.services()       # [{"code": "tg", "name": "Telegram"}, ...]
countries = client.countries()     # {"22": {"id": "22", "eng": "India"}, ...}
prices = client.prices("tg")      # Sorted by price ascending
prices = client.prices("wa", country="22")  # Filter by country

Buy Numbers

# Auto-select cheapest country
number = client.get_number(service="tg", country="auto")

# Specific country
number = client.get_number(service="wa", country="22")

print(number.phone)    # "628123456789"
print(number.service)  # "wa"
print(number.status)   # "waiting"

Wait for Code

code = number.wait_for_code(timeout=120, interval=5)
# Polls every 5s for up to 120s, returns the code string
# Raises TimeoutError if no code received

Complete / Cancel

number.complete()           # Mark as used
refund = number.cancel()    # Cancel and get refund

Error Handling

from egotg import InsufficientBalance, NoNumbers, EgoError

try:
    number = client.get_number(service="tg")
except InsufficientBalance:
    print("Top up at https://ego.tg/payments")
except NoNumbers:
    print("Try a different service or country")
except EgoError as e:
    print(f"API error: {e}")

Supported Services

190+ countries, 500+ services including:

Code Service
tg Telegram
wa WhatsApp
ig Instagram
go Google
tw Twitter/X
fb Facebook
mt Steam
nf Netflix
am Amazon

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

egotg-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

egotg-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file egotg-0.1.0.tar.gz.

File metadata

  • Download URL: egotg-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for egotg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ea6197b1259cacc9c042d19ed2156761d403dfb8f4810fdf28c11999108c88c
MD5 e68a9c703f5f95693bf4c4a43c4a83e4
BLAKE2b-256 08b84dfb892e5bf3fdfb4f41ed8967d74fa0ea2414ddba591df42215f35ff96b

See more details on using hashes here.

File details

Details for the file egotg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: egotg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for egotg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3accba903d571ba1aa2202d4a9e2673182ea4ce8713b3cac1fe859f797afc0fa
MD5 a92f21d4042ea9922b502f3f64a17004
BLAKE2b-256 2a5a849db63580d84cd250000a2b3459b64ec33a868e947579608e850ce3b231

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page