Small Docker bot that repeatedly calls the Grizzly SMS getNumber endpoint until
it gets a phone number. When a number is acquired, the bot sends one notification
to an ntfy topic.
The bot starts several worker threads. Each worker calls the Grizzly SMS API with the configured service, country, max price, and optional provider IDs.
When Grizzly returns:
ACCESS_NUMBER:<activation_id>:<phone_number>
the bot logs the number and sends a notification to ntfy.
If Grizzly returns NO_NUMBERS, the bot keeps polling. If Grizzly returns an HTTP
error, the bot pauses briefly before sending more requests.
- Docker with Docker Compose
- A Grizzly SMS API key
- An ntfy topic URL
ntfy is a simple notification app. This bot uses it to send a push notification when Grizzly SMS returns a phone number.
cp .env.example .envEdit .env with your own values:
GRIZZLY_API_KEY=your_grizzly_api_key
SERVICE=wx
COUNTRY=62
MAX_PRICE=2
PROVIDER_IDS=311
NTFY_URL=https://ntfy.sh/your-topic
THREADS=10
MAX_REQUESTS_PER_SECOND=5
REQUEST_TIMEOUT_SECONDS=10
STATUS_EVERY_REQUESTS=100
LOG_LEVEL=INFOBy default, this example targets Apple with SERVICE=wx and Turkey with
COUNTRY=62. You can verify service and country codes in the Grizzly SMS
API documentation, the
Apple service page, and the
price/country table.
Start the bot:
docker compose up -d --buildWatch logs:
docker compose logs -f --tail=100Stop the bot:
docker compose down| Variable | Required | Description |
|---|---|---|
GRIZZLY_API_KEY |
yes | Your Grizzly SMS API key. |
SERVICE |
yes | Grizzly service code. The example wx is Apple. See the API docs and Apple page. |
COUNTRY |
yes | Grizzly country code. The example 62 is Turkey. See the API docs and price/country table. |
MAX_PRICE |
yes | Maximum price accepted by Grizzly SMS. |
PROVIDER_IDS |
no | Comma-separated provider IDs. Leave empty to omit providerIds. |
NTFY_URL |
yes | ntfy topic URL used for notifications. |
THREADS |
yes | Number of worker threads. |
MAX_REQUESTS_PER_SECOND |
yes | Global request start limit shared by all workers. |
REQUEST_TIMEOUT_SECONDS |
yes | HTTP timeout for Grizzly and ntfy requests. |
STATUS_EVERY_REQUESTS |
no | Log a progress message every N requests. Defaults to 100. |
LOG_LEVEL |
no | Python logging level, for example INFO or DEBUG. |
GRIZZLY_API_URL |
no | Override the Grizzly API endpoint. Mostly useful for debugging. |
At LOG_LEVEL=INFO, the bot logs startup, ntfy connectivity, progress, errors,
and acquired numbers.
Example:
startup service=wx country=62 maxPrice=2 providerIds=311 workers=10 limit=5.0/s
ntfy test: OK
still polling requests=100 no_numbers=100 acquired=0
still polling requests=200 no_numbers=200 acquired=0
number acquired worker=4 activation=123456 number=33612345678
notification sent activation=123456
PROVIDER_IDS is optional.
Use a provider:
PROVIDER_IDS=311Use multiple providers:
PROVIDER_IDS=311,312Do not send providerIds at all:
PROVIDER_IDS=Start with conservative values:
THREADS=5
MAX_REQUESTS_PER_SECOND=2Increase them slowly if your machine, network, and Grizzly SMS account can handle
it. If you receive HTTP errors, lower THREADS or MAX_REQUESTS_PER_SECOND.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
set -a
source .env
set +a
python bot.py