General information

This API accepts GET request

Response parameters are in JSON format

API main endpoint: https://dwebkjkovsjobzrb45dz6prnlifnapiyp2dba33vcmcsaikr2re4d5qd.onion/api

API main endpoint: https://onionlandhosting.com/api

The easiest way to access the API is with a personal access token (PAT) generated from OnionLand Hosting portal. This token should only allow the level of access needed by the application.

To create one:

  • 1. Log in to OnionLand Hosting and go to the API page.
  • 2. Click "Generate New Token" button.
  • 3. Set these options:
    Token Name: Enter a name for the token that makes it easy to identify and understand its intended use.
    Expiration: Select an expiration timeline. You can't change this after you create the token.
    Scopes: Set the level of access. You can't change this after you create the token.
  • 4. Click "Generate Token". A dialog box displays your new personal access token. Save this in a safe place, such as a password manager. After leaving the page, you can't view the token string again.

Make authenticated HTTP requests to the API by including the access_token in this header with each request:

Authorization: Bearer abc123def456hij789klm

To access more APIs other than those specified below, log into your account and open a ticket with the feedback department.

Get Customer Balance

To retrieve the balances on a customer's account, send a GET request to
/account/balance

Request sample

curl -X GET \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    "https://onionlandhosting.com/api/account/balance"

Response sample

{
    "data": {
        "account_balance": "42.40",
        "estimated_spent_monthly": "11.95",
        "estimated_due_date": "2024-12-20",
        "generated_at": "2024-09-05 12:38:09"
    },
    "reason": null
}

List payments

To retrieve a list of Payments made on this customer's account, send a GET request to
/account/payments

Request sample

curl -X GET \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    "https://onionlandhosting.com/api/account/payments"

Response sample

{
    "data": [
        {
            "date": "<!--date-->",
            "asset": "BTC",
            "amount": "0.00080000",
            "usd": "45.75",
            "address": "<!--address-->",
            "txid": "<!--txid-->"
        },
        <!--list of payments-->
    ],
    "reason": null
}

List payment methods

To retrieve a list of Payment Methods for this customer's account, send a GET request to
/account/payment-methods

Request sample

curl -X GET \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    "https://onionlandhosting.com/api/account/payment-methods"

Response sample

{
    "data": [
        {
            "symbol": "BTC",
            "rate": "56561.08",
            "address": "<!--address-->"
        },
        {
            "symbol": "BTC",
            "rate": "56561.08",
            "address": "<!--address-->"
        },
        {
            "symbol": "ETH",
            "rate": "2385.61",
            "address": "<!--address-->"
        },
        {
            "symbol": "USDT",
            "rate": "1.00",
            "address": "<!--address-->"
        },
        {
            "symbol": "USDC",
            "rate": "1.00",
            "address": "<!--address-->"
        },
        {
            "symbol": "DAI",
            "rate": "1.00",
            "address": "<!--address-->"
        }
    ],
    "reason": null
}

List invoices

To retrieve a list of Invoices for this customer's account, send a GET request to
/account/invoices

Request sample

curl -X GET \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    "https://onionlandhosting.com/api/account/invoices"

Response sample

{
    "data": [
        {
            "invoice_period": "2024-09",
            "amount": "1.62"
        },
        {
            "invoice_period": "2024-08",
            "amount": "14.94"
        },
        <!--list of invoices-->
    ],
    "reason": null
}

List Onion Services

To retrieve a list of Onion Services for this customer's account, send a GET request to
/instances

Request sample

curl -X GET \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    "https://onionlandhosting.com/api/instances"

Response sample

{
    "data": [
        {
            "id": "<!--id-->",
            "name": "<!--address-->",
            "status": "running",
            "created_at": "2019-12-19 01:27:16",
            "features": [
                "onion_aliases"
            ],
            "disk": {
                "current_usage": "4.881",
                "max_usage": "10"
            },
            "onion_aliases": [
                "<!--address-->",
                "<!--address-->"
            ],
            "www_aliases": [],
            "backups": []
        }
    ],
    "reason": null
}

Other API Endpoints

To access more APIs, log into your account and open a ticket with the feedback department.

If you need technical support regarding APIs, log into your account and open a ticket with the technical department.