npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smspool.js

v1.0.10

Published

Wrapper for smspool.net

Downloads

11

Readme

SMSPool.js

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

npm install smspool.js

After that we can import smspool.js

const smspool = require("./index");
smspool.client("<api-key>");

(async function() {
    let result = await smspool.getBalance()
    console.log(result);
}())

Main Documentation

client()

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

smspool.client("<your-api-key>");

Get your api key here


getCountries()

Returns a list of Countries.

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


getServices()

Returns a list of all services.

Response:

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

Checkout the official documentation


getBalance()

Returns the balance of the user.
API Key required!

Response:

{
  "balance": "1.00"
}

Checkout the official documentation


getOrderHistory()

Returns a list of all orders.
API Key required!

Checkout the official documentation

getActiveOrders()

Returns a list of all active orders.
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

getSMSServicePrice(country, service)

Returns the price of a specific service.
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.

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


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

Order a number.
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


checkSMS(orderID)

View sms order details.
API Key required!

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

Response:

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

Checkout the official documentation


resendSMS(orderID)

Resend code to number.
API Key required!

orderID = 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


cancelSMS(orderID)

Cancel an SMS order.
API Key required!

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

Response:

{
  "success": 1
}

Checkout the official documentation


archiveSMSOrders(orderID)

Archive all SMS orders. API Key required!

orderID = 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

getRentals(type)

Archive all SMS orders.

type = true/false
true = Extendable
false = one-time

Response:

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

Checkout the official documentation


purchaseRental(rentalID, days, service_id)

Purchase a rental.
API Key required!

rentalID = 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


getRentalMessage(rental_code)

Retrieve 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


getRentalStatus(rental_code)

Get the status of a rental.
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


refundRental(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


extendRental(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.