Developer API · v1

Build on Ninja Hacks

Check your plan, generate premium downloads and resell plans from your own scripts, bots and shops, all with one API key.

New to Ninja Hacks? Create a free account to get API access.

REST + JSON
Key-based auth
60 requests / min

Authentication

Create a key in Dashboard → Profile → API keys (sign in first). The key is shown once, so store it safely. Send it with every request in the X-API-Key header. Revoke a key at any time and it stops working right away.

Base URLhttps://ninjahacks.in/api/v1
Header
X-API-Key: nh_your_api_key

Reseller flow

Any approved, active affiliate can resell plans. You set your own price for buyers. Ninja Hacks charges you the regular plan price per order.

  1. 1

    Show plans

    Call GET /plans and list them in your shop at your own price.

  2. 2

    Buyer pays you

    The buyer picks a plan and pays you directly.

  3. 3

    Create the order

    Call POST /affiliate/orders with the plan, the buyer's email and your order reference. The plan price is charged to your balance.

  4. 4

    Send the coupon

    Forward the couponCode or redeemUrl to the buyer. It only works for their email, after they verify it, and the plan activates instantly.

Balance and settlement. Top up your balance with Ninja Hacks ahead of time and each order is paid from it. If your balance is too low, the order and coupon still go through and the missing amount is recorded as owed. It shows in your affiliate dashboard and to our team. When you pay, we add it to your balance and your oldest unpaid orders are settled first.

Errors & limits

Errors return JSON with a readable error and a stable code. Each key can make 60 requests per minute. Downloads also count against your plan's daily bandwidth.

400URL_REQUIRED, INVALID_PLAN, INVALID_EMAIL, INVALID_REFERENCEA field is missing or invalid.
401API_KEY_REQUIRED, API_KEY_INVALIDNo key was sent, or it was revoked.
403EMAIL_REQUIRED, NOT_AFFILIATE, AFFILIATE_INACTIVE, ACCOUNT_DISABLEDYour account cannot use this endpoint yet. Reseller endpoints need an approved, active affiliate account.
404NOT_FOUNDUnknown endpoint, job or order.
409DUPLICATE_URL, DOWNLOAD_IN_PROGRESS, ALREADY_REDEEMED, NOT_CANCELLABLEThe file is still available (the response includes its downloadUrl) or already downloading, or the order can no longer be cancelled.
429RATE_LIMITEDToo many requests. Wait for the Retry-After seconds.

Endpoints

Profile

GET/api/v1/profile

Your account details: email, plan, plan status and today's bandwidth.

Request
curl -X GET "https://ninjahacks.in/api/v1/profile" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{
  "username": "ninja",
  "email": "[email protected]",
  "emailVerified": true,
  "status": "active",
  "plan": {
    "name": "Bronze",
    "status": "active",
    "validUntil": "2026-10-18T00:00:00.000Z",
    "daysRemaining": 10
  },
  "usage": {
    "dailyLimitBytes": 10737418240,
    "usedTodayBytes": 524288000,
    "remainingBytes": 10213130240
  },
  "telegramLinked": true
}

Download a file

POST/api/v1/download

Turn a RapidGator, 1fichier or Nitroflare link into a premium download link. The request returns once the file is ready, so allow a long timeout (several minutes for big files). Needs an active plan and a verified email.

Body (JSON)

url string

Required. The file host link.

Request
curl -X POST "https://ninjahacks.in/api/v1/download" \
  -H "X-API-Key: $NINJA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://rapidgator.net/file/abc123/movie.mkv"}'
Response
{
  "id": "6702f1c0e4b0a1b2c3d4e5f6",
  "downloadUrl": "https://ninjahacks.in/download/Xy7.../movie.mkv",
  "filename": "movie.mkv",
  "size": 1073741824,
  "host": "rapidgator",
  "usage": { "remainingQuotaMB": 9216, "hasValidPlan": true }
}

Download many files

POST/api/v1/download

Send up to 25 links in one request. The request returns right away with one job per link, and the files download in the background. Check progress with Download jobs.

Body (JSON)

urls string[]

Required. Up to 25 file host links. Duplicates and non-http links are skipped.

Request
curl -X POST "https://ninjahacks.in/api/v1/download" \
  -H "X-API-Key: $NINJA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://rapidgator.net/file/abc123/a.mkv","https://1fichier.com/?xyz789"]}'
Response
{
  "accepted": 2,
  "maxPerBatch": 25,
  "jobs": [
    { "id": "j_1", "url": "https://rapidgator.net/file/abc123/a.mkv", "status": "queued" },
    { "id": "j_2", "url": "https://1fichier.com/?xyz789", "status": "queued" }
  ]
}

Download jobs

GET/api/v1/download/jobs

Progress of your batch downloads. Status is queued, resolving, downloading, finalizing, completed or failed. Completed jobs include the downloadUrl. Poll every few seconds.

Request
curl -X GET "https://ninjahacks.in/api/v1/download/jobs" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{
  "jobs": [
    {
      "id": "j_1",
      "status": "downloading",
      "originalName": "a.mkv",
      "size": 1073741824,
      "received": 536870912,
      "progress": 50,
      "etaSeconds": 42,
      "downloadUrl": null,
      "error": null
    }
  ]
}

Retry a job

POST/api/v1/download/jobs/{id}/retry

Queues a failed job again.

Request
curl -X POST "https://ninjahacks.in/api/v1/download/jobs/j_1/retry" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{ "job": { "id": "j_1", "status": "queued" } }

Recent files

GET/api/v1/files

Your 50 most recent downloads with their links, so you can fetch a link again without spending bandwidth.

Request
curl -X GET "https://ninjahacks.in/api/v1/files" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
[
  {
    "id": "6702f1c0e4b0a1b2c3d4e5f6",
    "originalName": "movie.mkv",
    "size": 1073741824,
    "provider": "rapidgator",
    "createdAt": "2026-10-08T09:12:00.000Z",
    "expiresAt": "2026-10-09T09:12:00.000Z",
    "fileAvailable": true,
    "downloadUrl": "https://ninjahacks.in/download/Xy7.../movie.mkv"
  }
]

Plans

GET/api/v1/plans

Plans you can sell, with their regular price in USD. Each reseller order is charged at this price. Show your buyers whatever price you choose.

Request
curl -X GET "https://ninjahacks.in/api/v1/plans" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{
  "currency": "USD",
  "plans": [
    {
      "id": "66f0c2a1b2c3d4e5f6a7b8c9",
      "name": "Bronze",
      "price": 4,
      "validityDays": 15,
      "dailyLimitBytes": 10737418240,
      "description": "Starter plan",
      "features": ["50+ hosts", "Max speed"]
    }
  ]
}

Reseller balance

Resellers
GET/api/v1/affiliate/balance

Your prepaid balance and anything you still owe. A negative balance means orders went through without enough funds, so you need to settle with Ninja Hacks.

Request
curl -X GET "https://ninjahacks.in/api/v1/affiliate/balance" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{
  "currency": "USD",
  "balance": -4,
  "due": 4,
  "unpaidOrders": 1
}

Create an order

Resellers
POST/api/v1/affiliate/orders

Call this after your buyer has paid you. The plan price is charged to your balance and a single-use coupon is issued right away. The coupon gives the plan for free but only works on an account with the buyer's verified email, so we know who the real user is. If your balance is too low, the order still goes through and the missing amount is recorded as owed. Send the same reference again and you get the original order back without being charged twice.

Body (JSON)

planId string

Required. A plan id from /plans.

buyerEmail string

Required. The buyer's email. Only this email can redeem the coupon.

reference string

Recommended. Your own order id, 1–64 characters (letters, numbers, _ . : -). Makes it safe to send the request again.

Request
curl -X POST "https://ninjahacks.in/api/v1/affiliate/orders" \
  -H "X-API-Key: $NINJA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"planId":"66f0c2a1b2c3d4e5f6a7b8c9","buyerEmail":"[email protected]","reference":"shop-1042"}'
Response
{
  "order": {
    "id": "6703a9f2c1d2e3f4a5b6c7d8",
    "reference": "shop-1042",
    "plan": { "name": "Bronze", "validityDays": 15 },
    "price": 4,
    "due": 0,
    "settled": true,
    "buyerEmail": "[email protected]",
    "couponCode": "RS-9F2A7C41D0",
    "redeemUrl": "https://ninjahacks.in/redeem?code=RS-9F2A7C41D0",
    "status": "issued",
    "redeemedBy": null
  },
  "replayed": false,
  "balance": { "currency": "USD", "balance": 16, "due": 0, "unpaidOrders": 0 }
}

List orders

Resellers
GET/api/v1/affiliate/orders

Your orders, newest first, 20 per page. Status is issued, redeemed or cancelled. Once the buyer redeems, redeemedBy shows the account that used it.

Query

page number

Optional. Default 1.

buyerEmail string

Optional. Only orders for this buyer.

Request
curl -X GET "https://ninjahacks.in/api/v1/affiliate/orders?page=1" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{
  "orders": [{ "id": "6703a9f2c1d2e3f4a5b6c7d8", "status": "redeemed", "redeemedBy": { "username": "buyer01" } }],
  "page": 1,
  "pages": 1,
  "total": 1
}

Get an order

Resellers
GET/api/v1/affiliate/orders/{orderId}

One order with its coupon and redemption status.

Request
curl -X GET "https://ninjahacks.in/api/v1/affiliate/orders/6703a9f2c1d2e3f4a5b6c7d8" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{ "order": { "id": "6703a9f2c1d2e3f4a5b6c7d8", "couponCode": "RS-9F2A7C41D0", "status": "issued" } }

Cancel an order

Resellers
DELETE/api/v1/affiliate/orders/{orderId}

Turns off the coupon and puts the price back on your balance. This only works while the coupon is unused; a redeemed order cannot be cancelled. Use it for a wrong buyer email, then create a new order.

Request
curl -X DELETE "https://ninjahacks.in/api/v1/affiliate/orders/6703a9f2c1d2e3f4a5b6c7d8" \
  -H "X-API-Key: $NINJA_API_KEY"
Response
{
  "order": { "id": "6703a9f2c1d2e3f4a5b6c7d8", "status": "cancelled", "couponCode": null },
  "balance": { "currency": "USD", "balance": 20, "due": 0, "unpaidOrders": 0 }
}