Unofficial API for smshub.org
Project description
from main import api_key
SMSHub API
Usage showcase:
from SMSHubAPI import SMSHubAPI
api_key = "YOUR_API_KEY"
api = SMSHubAPI(
api_key, # required
retries=5, # optional[default] (retries count for requests)
delay=1, # optional[default] (delay between retries)
raise_for_status=False, # optional[default] (if True raise Exceptions else return PendingResponse with exception)
proxy=None # optional[default] (proxy must look like for requests lib)
)
phone = api.get_number(
"SERVICE_NAME", # required
operator=None, # optional[default] operator name
country=None, # optional[default] country ID
max_price=None, # optional[default] max price for phone number
currency=None # optional[default] currency for max_price
)
... # do something for send sms
rsp = api.sms_sent() # optional
if not rsp:
api.sms_cancel()
code = api.wait_for_sms(
interval=1, # interval for requests to get sms
timeout=60 # timeout of waiting for sms
)
if not code:
api.sms_cancel()
... # do something with sms
api.sms_finish() # use this if all right or after api.sms_retry()
# api.sms_retry() # use next if you need to get new sms (free)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_smshub_api-1.1.0.tar.gz.
File metadata
- Download URL: simple_smshub_api-1.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c901635b37a5531d00225616385a94b2fa2da97e1421ea1b2829eb074c337a0
|
|
| MD5 |
4d6bdb589b056567cf84af714b1afdff
|
|
| BLAKE2b-256 |
1f6885ba86c9c4ad4b2db0952481b26212c9cdd713f559a38b958aea8c210b8e
|
File details
Details for the file simple_smshub_api-1.1.0-py3-none-any.whl.
File metadata
- Download URL: simple_smshub_api-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8bf506e29b833d660abc46580187272a2ad848d2db9999b536ad18d81f1d003
|
|
| MD5 |
c9cb17c7dbf4354e95c2790bbb8891b3
|
|
| BLAKE2b-256 |
0e128ec5b3761f70e4b4c7b996a16827dcc382667fa906e9af76f85c372c3894
|