Skip to main content

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

simple_smshub_api-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file simple_smshub_api-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_smshub_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59a52b774eba1582c594906e85439990829ae3fcc26752473b04850216694c12
MD5 550cc67deb78a293e95eaf2246f55972
BLAKE2b-256 efa12a0aecc2bf8cbf7ec455836dfdb9fddb1aa19b843b726a6a4732c2f21f0a

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