API docs

Reference for all endpoints, authentication, and request/response formats.

Overview

Base URL: https://apihosting.sbs (or your API host, e.g. https://api.apihosting.sbs). All responses are JSON. Protected endpoints require an API key.

Endpoint summary

MethodPathAuth
GET/health
POST/html-pusherAPI key
GET/hosted/:id
POST/upload-imageAPI key
GET/image/:id
GET/uploadsAPI key
POST/create-ltc-addressAPI key
GET/walletsAPI key
GET/wallets/:idAPI key
POST/send-ltcAPI key
GET/check-address-balance?address=API key
GET/check-txid?txId=API key
GET/check-ltc-priceAPI key

Authentication

Send your API key in one of these ways:

Protected endpoints return 401 if the key is missing or 403 if it's invalid.

Endpoints

Health

GET /health

No auth. Returns service status and uptime.

{
  "status": "ok",
  "timestamp": "2025-02-18T12:00:00.000Z",
  "uptime": 3600
}

HTML pusher

POST /html-pusher API key

Submit HTML and get a public URL where it is hosted. The URL is https://apihosting.sbs/hosted/<id> where <id> is a 16-character string. Viewing the URL does not require an API key. Optional expiresAt removes the page after that time (ISO 8601 date).

Request body:

{
  "html": "<!DOCTYPE html><html><body>Hello</body></html>",
  "expiresAt": "2026-12-31T23:59:59.000Z"
}

expiresAt is optional. html is required (max 512KB).

Response (201):

{
  "id": "a1b2c3d4e5f67890",
  "url": "https://apihosting.sbs/hosted/a1b2c3d4e5f67890"
}

Viewing hosted HTML:

GET /hosted/:id

No auth. Returns the stored HTML as text/html. Returns 404 if the id does not exist or has expired.

Image upload

POST /upload-image API key

Upload an image (base64). Stored and served at https://apihosting.sbs/image/<id>. Max size 4MB (decoded).

Request body:

{
  "image": "base64string",
  "contentType": "image/png"
}

Or send a data URL: "image": "data:image/png;base64,...". contentType is optional if using a data URL.

Response (201):

{
  "id": "a1b2c3d4e5f67890",
  "url": "https://apihosting.sbs/image/a1b2c3d4e5f67890"
}

GET /image/:id

No auth. Returns the image with the stored Content-Type. 404 if not found.

My uploads

GET /uploads API key

Returns all images and hosted HTML pages created with your API key (with url and createdAt). Use this to list what you've uploaded for the dashboard.

Response (200):

{
  "images": [
    { "id": "...", "type": "image", "contentType": "image/png", "createdAt": "...", "url": "https://apihosting.sbs/image/..." }
  ],
  "hostedHtml": [
    { "id": "...", "type": "html", "createdAt": "...", "url": "https://apihosting.sbs/hosted/..." }
  ]
}

Create LTC address

POST /create-ltc-address API key

Creates a new Litecoin wallet and derives the first address. Credentials are stored in our database for your API key; the response includes an id you can use to fetch them later. Store the mnemonic securely.

Response (200):

{
  "id": "a1b2c3d4e5f6a1b2c3d4e5f6",
  "mnemonic": "word1 word2 ...",
  "xpub": "...",
  "index": 0,
  "address": "ltc1..."
}

Wallets (stored data)

GET /wallets API key

Returns all wallets created with your API key (mnemonic, xpub, index, address, createdAt). Optional query ?address=ltc1... returns only the wallet with that address.

Response (200):

{
  "wallets": [
    {
      "id": "a1b2c3d4e5f6a1b2c3d4e5f6",
      "mnemonic": "...",
      "xpub": "...",
      "index": 0,
      "address": "ltc1...",
      "createdAt": "2026-02-18T12:00:00.000Z"
    }
  ]
}

GET /wallets/:id API key

Returns a single wallet by id (24-character hex from create-ltc-address or the wallets list). Returns 404 if the id does not exist or belongs to another key.

Response (200):

{
  "id": "a1b2c3d4e5f6a1b2c3d4e5f6",
  "mnemonic": "...",
  "xpub": "...",
  "index": 0,
  "address": "ltc1...",
  "createdAt": "2026-02-18T12:00:00.000Z"
}

Send LTC

POST /send-ltc API key

Broadcast a transaction from one address to one or more recipients.

Request body:

{
  "fromAddress": "ltc1...",
  "to": [
    { "address": "ltc1...", "value": 0.001 },
    { "address": "ltc1...", "value": 0.002 }
  ]
}

value is in LTC. Response shape is from the underlying provider (e.g. transaction hash/details).

Check address balance

GET /check-address-balance?address=ltc1... API key

Returns balance for the given address. Response shape is from the underlying provider (e.g. incoming, outgoing, balance).

Check transaction

GET /check-txid?txId=... API key

Returns transaction details for the given transaction ID.

LTC price (USD)

GET /check-ltc-price API key

Returns current LTC/USD price. Response shape is from the underlying provider (e.g. basePair, price).

Errors

Errors return JSON with an error message. Common status codes:

CodeMeaning
400Bad request (missing or invalid parameters)
401Missing API key
403Invalid API key
404Unknown path, wallet not found, or hosted page not found/expired
429Rate limited; response may include retryAfterMs
500Server or upstream error

Rate limits

Requests are rate-limited per IP (e.g. 20 requests per minute). Exceeding the limit returns 429 and a cooldown period.