Skip to main content

SMSPool.py

Unofficial API wrapper for SMSPool.net. With this wrapper you are able to call all endpoints with functions.
Join the SMSPool.net Discord server.

Table Of Contents


SMSpool.net API Documentation

Checkout the official API documentation here https://www.smspool.net/article/how-to-use-the-smspool-api.

Getting Started

To get started you have to install the smspool npm package

pip install smspool

After that we can import smspool

from smspool import smspool
sms = smspool(apikey="YOUR_API_KEY")

countries = sms.get_countries()
print(countries)

Main Documentation

smspool()

To assign an api key to the client use the client() method.

sms = smspool(apikey="YOUR_API_KEY")

Get your api key here


get_countries()

Returns the list of countries supported by smspool.net

Response:

[
  {
    "ID": "1",
    "name": "United States",
    "region": "Americas"
  },
  {
    "ID": "2",
    "name": "United Kingdom",
    "region": "Europe"
  },
  {
    "ID": "3",
    "name": "Netherlands",
    "region": "Europe"
  },
]

Checkout the official documentation


get_services(country)

Returns the list of services supported by smspool.net in the given country

Response:

[
  {
    "ID": "1",
    "name": "service1"
  },
  {
    "ID": "2",
    "name": "service2"
  },
  {
    "ID": "3",
    "name": "service3"
  },
]

Checkout the official documentation


get_balance()

Returns the balance of the account API Key required!

Response:

{
  "balance": "1.00"
}

Checkout the official documentation


get_order_history()

Returns the order history of the account API Key required!

Checkout the official documentation

get_active_orders()

Returns the active orders of the account
API Key required!

Response:

{
   "timestamp":"2022-05-24 21:20:07",
   "order_code":"ABCDEFGH",
   "phonenumber":"123456789",
   "code":"0",
   "full_code":"0",
   "short_name":"US",
   "service":"Service",
   "status":"pending",
   "expiry":"1653420607"
}

Checkout the official documentation


SMS Documentation

get_service_price(country, service, pool(not required))

Returns the price of the service in the given country API Key required!

country = The country code/ID that you can retrieve from the country endpoint.
service = The service ID/name that you can retrieve from the service endpoint. pool = The pool you'd like to order from is not required, in case it's empty it'll automatically select a suitable pool. Pools can be selected by number or by name (for example Alpha).

Response:

{
   "timestamp":"2022-05-24 21:20:07",
   "order_code":"ABCDEFGH",
   "phonenumber":"123456789",
   "code":"0",
   "full_code":"0",
   "short_name":"US",
   "service":"Service",
   "status":"pending",
   "expiry":"1653420607"
}

Checkout the official documentation


purchase_sms(country, service, pool(not required))

Purchases the service in the given country API Key required!

country = The country code/ID that you can retrieve from the country endpoint.
service = The service ID/name that you can retrieve from the service endpoint.
pool = The pool you'd like to order from is not required, in case it's empty it'll automatically select a suitable pool. Pools can be selected by number or by name (for example Alpha).

Response:

{
   "success":1,
   "number":"123456789",
   "order_id":"ABCDEFG",
   "country":"United States",
   "service":"Service",
   "pool":5,
   "expires_in":599,
   "message":""
}

Checkout the official documentation


check_sms(order_id)

Checks the status of the order API Key required!

order_id = The order_id you received from the Order SMS endpoint.

Response:

{
  "status": 3,
  "sms": "00000",
  "full_sms": "full SMS"
}

Checkout the official documentation


resend_sms(order_id)

Resends the SMS API Key required!

order_id = The order_id you received from the Order SMS endpoint.

Response:

{
  "success":1,
  "message":"Number has been requested again",
  "resend":0
}

Checkout the official documentation


cancel_sms(order_id)

Cancels the SMS API Key required!

order_id = The order_id you received from the Order SMS endpoint.

Response:

{
  "success": 1
}

Checkout the official documentation


archive_sms_orders(order_id)

Archive all SMS orders. API Key required!

order_id = The order_id you received from the Order SMS endpoint.

Response:

{
   "success":1,
   "message":"All your inactive orders have been archived."
}

Checkout the official documentation


Rentals Documentation

get_rentals(type)

Returns the list of rentals

type = 0/1 1 = Extendable
0 = one-time

Response:

{
   "0":{
      "name":"United States",
      "region":"Americas",
      "pricing":"{\"7\":18,\"14\":25,\"30\":30}"
   }
}

Checkout the official documentation


purchase_rental(rental_id, days, service_id)

Purchase the rental.
API Key required!

rental_id = The rental ID was retrieved from the "Retrieve all rentals" endpoint.
days = The number of days you'd like to rent for.
service_id = Specify a service ID to only purchase a line for that service and get 50% off. Only works for US extendable rentals.

Response:

{
   "success":1,
   "message":"",
   "phonenumber":"123456789",
   "days":30,
   "rental_code":"ABCDEFG",
   "expiry":"1653758381"
}

Checkout the official documentation


get_rental_message(rental_code)

Returns the rental message API Key required!

rental_code = The retrieved rental code from the Order rental endpoint.

Response:

{
   "success":1,
   "messages":{
      "0":{
         "ID":6,
         "sender":null,
         "message":"Message 1",
         "timestamp":"11 May 2022 18:39:54"
      },
      "1":{
         "ID":6,
         "sender":null,
         "message":"Message 2",
         "timestamp":"11 May 2022 01:11:35"
      }
   },
   "source":"6"
}

Checkout the official documentation


get_rental_status(rental_code)

Returns the rental status API Key required!

rental_code = The retrieved rental code from the "Order rental" endpoint.

Response:

{
   "success":1,
   "status":{
      "expiry":1654495533,
      "available":1,
      "phonenumber":"123456789",
      "activeFor":90
   }
}

Checkout the official documentation


refund_rental(rental_code)

Refund a rental.
API Key required!

rental_code = The retrieved rental code from the Order rental endpoint.

Response:

{
   "success":1,
   "message":"Your rental has been refunded!"
}

Checkout the official documentation


extend_rental(rental_code, days)

Refund a rental.
API Key required!

rental_code = The retrieved rental code from the Order rental endpoint.
days = The amount of days you'd like to extend it with.

Response:

{
   "success":1,
   "message":"Your rental has been succesfully extended!"
}

Checkout the official documentation

How can I contribute to this project?

Before you start working on a feature or fix open a issue. After that fork the project and change anything you want. I will review the pull request and merge it to the main branch.

Metadata

Release files for smspool 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smspool 0.0.4
File Size Uploaded
smspool-0.0.4.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smspool 0.0.4
File Interpreter ABI Platform
smspool-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / smspool-0.0.4.tar.gz

Download URL smspool-0.0.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8b4b5f2418a5a9c15e9b2a9f701a64d07f5abf21700645e35b8ad428b069cb71
BLAKE2b-256 checksum
How to use checksums
2b41ff6fb8090e0d9ec9e873e62e591794f9b8302066c699d31bb5e17ce67e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.0

Release files / smspool-0.0.4-py3-none-any.whl

Download URL smspool-0.0.4-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f298747ba760b89797cb3165b26096b16cdb2f736b62f7cd2e9f9778b4a06ea
BLAKE2b-256 checksum
How to use checksums
b1518abdea8c29be62ebd3f73fae5d0d71d710b330be375097123604b03107db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page