Skip to main content

Disk/Traffic API Endpoint

The Disk/Traffic API Endpoint script will provide three API endpoints to your Ultra.cc service. The script provides in total three API endpoints, as shown below.

  • Disk usage stats using quota -s.
  • Traffic stats using app-traffic info.
  • The above combined into one endpoint.

The script will be installed as a Flask application in ~/scripts/Ultra_API and run under a screen session called UltraAPIpoints.

This is an unofficial script that is provided for your convenience. The script is provided as-is and may not be updated or maintained by Ultra.cc. Customers are welcome to use and customize unofficial scripts for their unique needs and requirements. Unofficial support may be offered via Discord only and at the sole discretion of Ultra.cc staff. Use at your own risk.

Installation

Before you can proceed with installing the API Endpoint script, Python needs to be version 3.6 or above.

Upgrade Python

  • Connect to your Ultra.cc slot via SSH, see guide here.
  • Once connected, execute the following command:
bash <(wget -qO- https://scripts.usbx.me/util/Python-Installer/main.sh)
  • Type confirm to proceed with the installation.
  • Next, pick a Python version above 3.6 or type 4 for latest version
  • Press ENTER to confirm.
  • When the installation has finished, execute the following command:
source ~/.profile

With Python updated to version 3.6 or above, you can proceed the installation.

Script Installation

  • Connect to your Ultra.cc slot via SSH, see guide here
  • Once connected, execute the following command:
bash <(wget -qO- https://scripts.usbx.me/util/API-EndPoints/main.sh)
  • Type confirm and press ENTER to confirm
  • Press 1 and ENTER to proceed with the installation
    • or, if you have already installed the script, and it is not responding. Press 3 and ENTER to restart the script.
    • or, if you have already installed the script, and require your authentication token. Press 4 and ENTER.
  • Choose an unused application from the list shown, type its name to borrow its port. Press ENTER to confirm
  • Type confirm and press ENTER to confirm
  • After the installation has been successfully completed, the below output should be shown.
    • In your URL's, username.hostname will be replaced with the username and hostname of your Ultra.cc service.
Script has been installed successfully.
Creating SQLite3 database and table...
Token successfully generated: <YOUR-AUTH-TOKEN>
 Ultra service API End points to get your service stats:
  ■ Complete Stats........:  https://username.hostname.usbx.me/ultra-api/get_stats
  ■ Storage Stats.........:  https://username.hostname.usbx.me/ultra-api/get_quota
  ■ Traffic Stats.........:  https://username.hostname.usbx.me/ultra-api/get_bandwidth
The script has been installed.
  • The above URL's are where your API endpoints can be accessed.

Uninstallation

  • Execute the following command:
bash <(wget -qO- https://scripts.usbx.me/util/API-EndPoints/main.sh)
  • Type confirm and press ENTER to confirm
  • Press 2 and ENTER to proceed the uninstallation
  • Press 1 and ENTER to confirm
  • Done!