PanelHawk

Tài liệu API

API của chúng tôi dùng giao thức panel SMM tiêu chuẩn (Perfect Panel v2), nên một panel đại lý có thể mua từ chúng tôi như từ bất kỳ nhà cung cấp nào khác. Tài liệu kỹ thuật bên dưới bằng tiếng Anh.

Lấy khóa API POST https://panelhawk.com/api/v2

Kết nối

Add PanelHawk as a provider in Perfect Panel or any panel software that speaks API v2: the address below and a key from your account are all it needs. Every request is one POST with a key and an action.

Address
https://panelhawk.com/api/v2
Method and body
POST · application/x-www-form-urlencoded, multipart/form-data or application/json
Authentication
The key parameter in the body. A key sent in the URL is refused, because a URL ends up in access logs; GET requests are answered with an error.
Answers
JSON. Money is US dollars as a string with up to six decimals; rates are per 1,000 units.

Create up to 5 keys in your account, each with its own label, an optional IP allowlist and its own rate limit. We store only a fingerprint of a key, so it is shown once; rotate it if it is lost.

Hành động

action=services

Everything we sell right now, with the price per 1,000 and the quantity range. The list follows our catalogue, which is repriced every six hours; a service that disappears from it can no longer be ordered.

[
  {
    "service": 1204,
    "name": "Instagram Followers — Real, 30-day refill",
    "type": "Default",
    "category": "Instagram Followers",
    "rate": "0.90",
    "min": "100",
    "max": "100000",
    "refill": true,
    "cancel": true
  }
]

action=add

Place an order. It is paid from your balance at once and placed with the supplier within minutes. The answer is our order id.

ParameterMeaning
key, actionYour API key, and the action.
serviceThe service id from action=services.
linkThe link to deliver to, starting with https://. It is checked against the service's platform.
quantityA whole number within the service's min and max.
client_order_id optionalYour own id for this order, up to 64 letters, digits and . _ : -. Sending the same id again returns the order the first request made instead of placing a second one, so a retry after a timeout is safe.
{
  "order": 23501
}

action=status

One order's charge, start count, status and what is left to deliver.

ParameterMeaning
key, actionYour API key, and the action.
orderOne order id.
{
  "charge": "0.27819",
  "start_count": "3572",
  "status": "Partial",
  "remains": "157",
  "currency": "USD"
}

action=status several at once

The same for up to 100 orders, keyed by order id.

ParameterMeaning
key, actionYour API key, and the action.
ordersOrder ids separated by commas, up to 100.
{
  "23501": {
    "charge": "0.27819",
    "start_count": "3572",
    "status": "Partial",
    "remains": "157",
    "currency": "USD"
  },
  "23502": {
    "error": "Incorrect order ID"
  }
}

action=cancel several at once

Cancel up to 100 orders. An order we have not placed yet is cancelled and refunded at once; one already with a supplier is cancelled there if that supplier can, and the undelivered part is refunded when it confirms.

ParameterMeaning
key, actionYour API key, and the action.
ordersOrder ids separated by commas, up to 100.
[
  {
    "order": 23501,
    "cancel": 1
  },
  {
    "order": 23502,
    "cancel": {
      "error": "Order cannot be canceled"
    }
  }
]

action=refill

Ask for a refill on a delivered order whose service has one, at most once every 24 hours. The answer is a refill id.

ParameterMeaning
key, actionYour API key, and the action.
orderOne order id.
{
  "refill": "1"
}

action=refill several at once

The same for up to 100 orders.

ParameterMeaning
key, actionYour API key, and the action.
ordersOrder ids separated by commas, up to 100.
[
  {
    "order": 23501,
    "refill": 1
  },
  {
    "order": 23502,
    "refill": {
      "error": "Refill is not available for this order"
    }
  }
]

action=refill_status

Where a refill stands: Pending, In progress, Completed or Rejected.

ParameterMeaning
key, actionYour API key, and the action.
refillOne refill id.
{
  "status": "Completed"
}

action=refill_status several at once

The same for up to 100 refills.

ParameterMeaning
key, actionYour API key, and the action.
refillsRefill ids separated by commas, up to 100.
[
  {
    "refill": 1,
    "status": "Completed"
  },
  {
    "refill": 2,
    "status": {
      "error": "Refill not found"
    }
  }
]

action=balance

Your balance.

{
  "balance": "100.84292",
  "currency": "USD"
}

Trạng thái đơn

Status words are the ones every panel uses. charge is what the order cost after any refund; remains is what was not delivered.

statusMeaning
PendingPaid and waiting to be placed with a supplier.
ProcessingPlaced with a supplier, not started yet.
In progressBeing delivered.
CompletedDelivered.
PartialPartly delivered; the undelivered share is back on your balance.
CanceledNot delivered; the money is back on your balance.

Lỗi

An error is an object with one error string, answered with HTTP 200 as every panel does. The one exception is the rate limit, which is HTTP 429 with a Retry-After header. Nothing is charged for a request that answers with an error.

{"error": "Invalid API key"}
errorMeaning
Incorrect requestThe action is unknown or the body could not be read.
Send a POST requestThe request was not a POST.
Invalid API keyThe key is wrong, rotated or revoked.
This API key cannot be used from this IP addressThe key has an IP allowlist and this address is not on it.
Too many requestsOver the request limit for this key (HTTP 429).
Incorrect service IDNo service with that id.
Service is temporarily unavailableThe service exists but cannot be ordered right now; it is back when its price is confirmed again.
Incorrect linkThe link is not one this service's platform can be delivered to.
Incorrect quantityThe quantity is not a whole number.
Quantity less than minimal 100Below the service's minimum, which the message names.
Quantity more than maximal 100000Above the service's maximum, which the message names.
Not enough funds on balanceThe balance does not cover the order. Nothing was charged.
Too many orders, try again laterOver the per-account order limit.
Drip-feed is not availableruns and interval were sent; drip-feed is not offered.
Incorrect client_order_idclient_order_id has characters outside letters, digits and . _ : - or is longer than 64.
Incorrect order IDNo order with that id on this account.
Up to 100 IDs per requestMore than 100 ids in one request.
Order cannot be canceledThe order is delivered, already finished, or with a supplier that cannot cancel it.
Refill is not available for this orderThe order is not delivered, or its service has no refill, or the refill period has ended.
Refill was requested less than 24 hours agoA refill was asked for in the last 24 hours.
Refill was not accepted, try again laterThe supplier did not accept the refill. Try again later.
Refill not foundNo refill with that id on this account.
Internal error, try again laterSomething failed on our side. Nothing was charged; try again.

Giới hạn và quy tắc

  • 120 requests a minute per key.
  • action=services: 6 a minute per key. The list is rebuilt at most every 5 minutes, so asking more often returns the same list.
  • Orders: 60 a minute and 600 an hour per account, the same as in the shop.
  • Requests with a wrong key: 60 per 60 seconds from one address, then HTTP 429.
  • Up to 100 ids in one status, cancel, refill or refill_status request. In cancel, refill and refill_status each id counts as one request towards the per-minute limit; a list that does not fit in what is left is refused whole with HTTP 429.

Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the oldest request in the window expires).

Retries

Send client_order_id with every add. If the connection drops before the answer arrives, send the same request again: the answer is the order the first one made, and it is charged once.

Money

An order is paid from your balance when it is accepted. A cancelled order is refunded in full, a partial one for the share that was not delivered, and every movement is on your account page. Top up from your account; the API cannot add funds.

Ví dụ

curl

curl -s -X POST https://panelhawk.com/api/v2 \
  -d key=YOUR_KEY \
  -d action=add \
  -d service=1204 \
  -d link=https://instagram.com/yourname \
  -d quantity=1000 \
  -d client_order_id=shop-77

Python

import requests

API = "https://panelhawk.com/api/v2"
KEY = "YOUR_KEY"

def call(action, **fields):
    reply = requests.post(API, data={"key": KEY, "action": action, **fields}, timeout=30)
    return reply.json()

print(call("balance"))
order = call("add", service=1204, link="https://instagram.com/yourname",
             quantity=1000, client_order_id="shop-77")
print(call("status", order=order["order"]))

PHP

<?php
function panelhawk(array $fields) {
    $ch = curl_init("https://panelhawk.com/api/v2");
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => http_build_query(["key" => "YOUR_KEY"] + $fields),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 30,
    ]);
    $body = curl_exec($ch);
    curl_close($ch);
    return json_decode($body, true);
}

print_r(panelhawk(["action" => "balance"]));
print_r(panelhawk(["action" => "status", "orders" => "23501,23502"]));

Lấy khóa API