Skip to main content

A small API Wrapper for smspool.net

Project description

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.

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

smspool-0.0.4.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

smspool-0.0.4-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

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