واجهة API للموزعين
اطلب وتابع رصيدك واستلم طلباتك من لوحتك أو بوتك أو أي سكربت. نقطة اتصال واحدة، وأربعة أوامر، وردود بصيغة JSON.
https://ogsub.net/api/v2
- المصادقة
keyداخل جسم الطلب - الصيغةحقول نموذج أو JSON، والرد JSON
- حد الطلبات60 طلباً في الدقيقة لكل مفتاح
- المبالغنصوص بالـ
EGPبرقمين عشريين
البداية
- سجّل الدخول وافتح «مفاتيح API» وأنشئ مفتاحاً. يظهر المفتاح مرة واحدة فقط، فانسخه إلى خادمك فوراً.
- يمكنك قصر المفتاح على عناوين IP الخاصة بخادمك (حتى 20 عنواناً)، وأي طلب من عنوان آخر يُرفض.
- أرسل طلبات
POSTإلى نقطة الاتصال ومعهاkeyوaction. يمكن تفعيل 5 مفاتيح كحد أقصى، وإلغاء أي منها في أي وقت.
صيغة الطلب
- جسم الطلب: حقول نموذج (
application/x-www-form-urlencoded) أو JSON معContent-Type: application/json. - أرسل المفتاح داخل جسم الطلب وليس في الرابط. لا حاجة إلى cookies أو رمز CSRF.
- الردود بصيغة JSON وباللغة الإنجليزية. المبالغ نصوص برقمين عشريين بالجنيه المصري (
EGP) أياً كانت العملة المعروضة في الموقع. - الطلبات تُدفع من رصيد محفظتك، فاشحن رصيدك من الموقع قبل الطلب.
متوافقة مع عملاء Perfect Panel API v2 بنفس أسماء المعاملات (key وaction وservice وlink وquantity وorder وorders). الفروق: كل طلب وحدة واحدة (quantity = 1)، وrate هو سعر الطلب الواحد وليس لكل 1000، ولا يوجد refill أو cancel.
قائمة الخدمات
POSTaction=servicesكل ما هو معروض للبيع بسعره الحالي. اجلبها قبل الطلب لأن الأسعار والتوفر يتغيران. فقط key وaction.
مثال
curl -X POST https://ogsub.net/api/v2 \
-d key=ogk_your_api_key \
-d action=services<?php
$ch = curl_init('https://ogsub.net/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'ogk_your_api_key',
'action' => 'services',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$response = json_decode(curl_exec($ch), true);
print_r($response);import requests
response = requests.post(
"https://ogsub.net/api/v2",
data={
"key": "ogk_your_api_key",
"action": "services",
},
timeout=30,
)
print(response.json())// Node.js 18+ (built-in fetch), as an ES module
const response = await fetch("https://ogsub.net/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "ogk_your_api_key",
action: "services",
}),
});
console.log(await response.json());[
{
"service": 12,
"name": "ChatGPT Plus 1 Month",
"type": "Default",
"category": "ChatGPT",
"rate": "350.00",
"min": 1,
"max": 1,
"input": "email",
"available": true,
"refill": false,
"cancel": false
}
]حقول الرد
| الحقل | الوصف |
|---|---|
service | رقم الخدمة الذي ترسله مع add. |
name | اسم الخدمة (بالإنجليزية). |
category | البراند أو القسم (بالإنجليزية). |
rate | سعر الطلب الواحد بالجنيه. |
min max | دائماً 1: كل طلب وحدة واحدة. |
input | ما يجب إرساله في link عند الطلب: none أو email أو text. |
available | تكون false أثناء إيقاف الخدمة مؤقتاً أو نفادها. |
type refill cancel | قيم ثابتة (Default وfalse وfalse) للتوافق مع Perfect Panel. |
الرصيد
POSTaction=balanceرصيد محفظتك الحالي. فقط key وaction.
مثال
curl -X POST https://ogsub.net/api/v2 \
-d key=ogk_your_api_key \
-d action=balance<?php
$ch = curl_init('https://ogsub.net/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'ogk_your_api_key',
'action' => 'balance',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$response = json_decode(curl_exec($ch), true);
print_r($response);import requests
response = requests.post(
"https://ogsub.net/api/v2",
data={
"key": "ogk_your_api_key",
"action": "balance",
},
timeout=30,
)
print(response.json())// Node.js 18+ (built-in fetch), as an ES module
const response = await fetch("https://ogsub.net/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "ogk_your_api_key",
action: "balance",
}),
});
console.log(await response.json());{
"balance": "1250.00",
"currency": "EGP"
}حقول الرد
| الحقل | الوصف |
|---|---|
balance | الرصيد بالجنيه. |
currency | دائماً EGP. |
إنشاء طلب
POSTaction=addينشئ طلباً واحداً ويخصم سعره من رصيدك فوراً.
المعاملات
| المعامل | إلزامي | الوصف |
|---|---|---|
service | نعم | رقم الخدمة من services. |
link | حسب الخدمة | ما تحتاجه الخدمة حسب input: مع email أرسل بريد الحساب المطلوب تفعيله، ومع text البيانات المطلوبة (من 2 إلى 255 حرفاً)، ومع none لا ترسله. |
quantity | لا | لا ترسله أو أرسل 1. |
Idempotency-Key | مستحسن رأس HTTP | نص فريد لكل طلب حتى 64 حرفاً (مثل UUID). إرسال القيمة نفسها مرة أخرى يعيد الطلب نفسه بدلاً من إنشاء طلب ثانٍ وخصم ثانٍ. |
مثال
curl -X POST https://ogsub.net/api/v2 \
-H "Idempotency-Key: 3f9c2a7e-order-1042" \
-d key=ogk_your_api_key \
-d action=add \
-d service=12 \
--data-urlencode [email protected]<?php
$ch = curl_init('https://ogsub.net/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'ogk_your_api_key',
'action' => 'add',
'service' => 12,
'link' => '[email protected]',
]),
CURLOPT_HTTPHEADER => ['Idempotency-Key: 3f9c2a7e-order-1042'],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$response = json_decode(curl_exec($ch), true);
print_r($response);import requests
response = requests.post(
"https://ogsub.net/api/v2",
data={
"key": "ogk_your_api_key",
"action": "add",
"service": 12,
"link": "[email protected]",
},
headers={"Idempotency-Key": "3f9c2a7e-order-1042"},
timeout=30,
)
print(response.json())// Node.js 18+ (built-in fetch), as an ES module
const response = await fetch("https://ogsub.net/api/v2", {
method: "POST",
headers: { "Idempotency-Key": "3f9c2a7e-order-1042" },
body: new URLSearchParams({
key: "ogk_your_api_key",
action: "add",
service: "12",
link: "[email protected]",
}),
});
console.log(await response.json());{
"order": "OG4K7Q2XNM",
"charge": "350.00",
"currency": "EGP"
}حقول الرد
| الحقل | الوصف |
|---|---|
order | رقم الطلب. احتفظ به لمتابعة الحالة. |
charge | المبلغ المخصوم من رصيدك. |
currency | دائماً EGP. |
لا تُطبَّق الكوبونات على طلبات API.
حالة الطلب
POSTaction=statusطلب واحد عبر order أو حتى 100 طلب عبر orders. لا تظهر إلا طلباتك أنت.
المعاملات
| المعامل | إلزامي | الوصف |
|---|---|---|
order | نعم | رقم طلب واحد. |
orders | لا | حتى 100 رقم طلب مفصولة بفواصل (بدلاً من order). |
مثال
curl -X POST https://ogsub.net/api/v2 \
-d key=ogk_your_api_key \
-d action=status \
-d order=OG4K7Q2XNM<?php
$ch = curl_init('https://ogsub.net/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'ogk_your_api_key',
'action' => 'status',
'order' => 'OG4K7Q2XNM',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$response = json_decode(curl_exec($ch), true);
print_r($response);import requests
response = requests.post(
"https://ogsub.net/api/v2",
data={
"key": "ogk_your_api_key",
"action": "status",
"order": "OG4K7Q2XNM",
},
timeout=30,
)
print(response.json())// Node.js 18+ (built-in fetch), as an ES module
const response = await fetch("https://ogsub.net/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "ogk_your_api_key",
action: "status",
order: "OG4K7Q2XNM",
}),
});
console.log(await response.json());{
"status": "Completed",
"charge": "350.00",
"currency": "EGP",
"created": "2026-10-24 18:05:11Z",
"delivery": "Activated on [email protected]"
}حقول الرد
| الحقل | الوصف |
|---|---|
status | راجع جدول الحالات بالأسفل. |
charge | المبلغ المخصوم من رصيدك. |
created | وقت إنشاء الطلب بتوقيت UTC (YYYY-MM-DD HH:MM:SSZ). |
delivery | يظهر فقط مع Completed: ما تم تسليمه (غالباً بيانات دخول). تعامل معه كسرّ. |
عدة طلبات مرة واحدة
مع orders يُعاد كل رقم مع نتيجته، والأرقام غير الموجودة تأخذ {"error": "Incorrect order ID"} دون أن يفشل الاستدعاء كله.
curl -X POST https://ogsub.net/api/v2 \
-d key=ogk_your_api_key \
-d action=status \
-d orders=OG4K7Q2XNM,OG9P3D5WLA<?php
$ch = curl_init('https://ogsub.net/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'ogk_your_api_key',
'action' => 'status',
'orders' => 'OG4K7Q2XNM,OG9P3D5WLA',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$response = json_decode(curl_exec($ch), true);
print_r($response);import requests
response = requests.post(
"https://ogsub.net/api/v2",
data={
"key": "ogk_your_api_key",
"action": "status",
"orders": "OG4K7Q2XNM,OG9P3D5WLA",
},
timeout=30,
)
print(response.json())// Node.js 18+ (built-in fetch), as an ES module
const response = await fetch("https://ogsub.net/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "ogk_your_api_key",
action: "status",
orders: "OG4K7Q2XNM,OG9P3D5WLA",
}),
});
console.log(await response.json());{
"OG4K7Q2XNM": {
"status": "Completed",
"charge": "350.00",
"currency": "EGP",
"created": "2026-10-24 18:05:11Z",
"delivery": "Activated on [email protected]"
},
"OG9P3D5WLA": {
"error": "Incorrect order ID"
}
}حالات الطلب
| الحالة | المعنى |
|---|---|
| Pending | مدفوع وفي انتظار التنفيذ. |
| In progress | جارٍ تجهيزه. |
| Completed | تم التسليم، والتفاصيل في delivery. |
| Canceled | لم يُسلَّم، وعاد المبلغ كاملاً إلى رصيدك. |
الخدمات ذات التسليم التلقائي تكتمل عادةً خلال دقائق، والباقي ينفذه الفريق. تابع status للطلبات التي تنتظرها.
الأخطاء
عند الفشل يكون رمز HTTP خارج نطاق 2xx ومعه رسالة في error. افحص رمز الحالة أولاً.
| رمز HTTP | المعنى | أمثلة للرسائل |
|---|---|---|
| 400 | الطلب ناقص أو غير صحيح. | Unknown actionInvalid serviceQuantity must be 1Missing orderIncorrect order ID |
| 401 | المفتاح غير مقبول. | Invalid API keyIP address not allowed for this keyAccount disabled |
| 403 | عنوان IP الخاص بك محظور من المتجر. | |
| 405 | الطلب ليس POST. | |
| 422 | لا يمكن تنفيذ الطلب الآن. | Insufficient balance.This service is sold out for now.This service is temporarily unavailable.Enter a valid account email.Enter the required order details.Ordering is paused right now. Please check back soon. |
| 429 | طلبات كثيرة. أبطئ وأعد المحاولة لاحقاً. | Too many requests |
| 500 | خطأ في الخادم. أعد المحاولة لاحقاً، وإن تكرر فأرسل قيمة ref إلى الدعم. | Server error |
HTTP/1.1 422 Unprocessable Entity
{
"error": "Insufficient balance."
}الحدود وإعادة المحاولة
- 60 طلباً في الدقيقة لكل مفتاح و120 في الدقيقة لكل عنوان IP، وما زاد يُرد عليه بـ
429. - إذا انقطع الاتصال أو انتهت مهلة استدعاء
addفأعد إرساله بنفسIdempotency-Key: ستحصل على الطلب الذي أُنشئ بالفعل دون خصم ثانٍ. وبدون هذا الرأس يُعد كل استدعاء طلباً جديداً. - تابع حتى 100 طلب في استدعاء
statusواحد بدلاً من استدعاء لكل طلب، وانتظر من 30 إلى 60 ثانية بين كل متابعة.
حماية المفتاح
- المفتاح يصرف من رصيدك. استخدمه على خادمك فقط، وليس في تطبيق أو صفحة ويب أو مستودع عام.
- اقصر المفتاح على عناوين IP الخاصة بخادمك متى أمكن.
- إذا تسرّب فألغه من صفحة مفاتيح API وأنشئ غيره، والمفتاح القديم يتوقف فوراً.
deliveryيحتوي ما اشتريته (غالباً بيانات دخول)، فاحفظه بعناية كلمة المرور.
مثال كامل لعميل API
يختار أول خدمة متاحة، ثم يطلبها، ثم ينتظر التسليم. نفس الخطوات متاحة بثلاث لغات، اختر لغتك من التبويبات.
<?php
const API = 'https://ogsub.net/api/v2';
const KEY = 'ogk_your_api_key'; // keep it on the server, e.g. in an environment variable
function og_api(array $params, array $headers = []): array
{
$ch = curl_init(API);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query(['key' => KEY] + $params),
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$data = is_string($body) ? json_decode($body, true) : null;
if ($code !== 200 || !is_array($data) || isset($data['error'])) {
throw new RuntimeException('API ' . $code . ': ' . ($data['error'] ?? 'no answer'));
}
return $data;
}
// 1. Pick the first available service
$services = og_api(['action' => 'services']);
$service = current(array_filter($services, fn (array $s): bool => $s['available']));
if (!$service) {
exit("Nothing available right now\n");
}
// "link" carries what the service's input asks for: nothing, the account email, or the details
$link = ['none' => '', 'email' => '[email protected]', 'text' => 'the details the service asks for'][$service['input']];
// 2. Order it. On a timeout, send the same Idempotency-Key again: never a second charge.
$idem = bin2hex(random_bytes(16));
$order = og_api(['action' => 'add', 'service' => $service['service'], 'link' => $link], ['Idempotency-Key: ' . $idem]);
// 3. Wait for the delivery
do {
sleep(30);
$status = og_api(['action' => 'status', 'order' => $order['order']]);
} while (in_array($status['status'], ['Pending', 'In progress'], true));
echo $status['status'] === 'Completed' ? $status['delivery'] : "Canceled: the charge is back in your balance\n";import os
import secrets
import time
import requests # pip install requests
API = "https://ogsub.net/api/v2"
KEY = os.environ.get("OG_API_KEY", "ogk_your_api_key") # keep it on the server
def og_api(params, headers=None):
r = requests.post(API, data={"key": KEY, **params}, headers=headers or {}, timeout=30)
try:
data = r.json()
except ValueError:
data = None
if r.status_code != 200 or data is None or (isinstance(data, dict) and "error" in data):
message = data.get("error", "no answer") if isinstance(data, dict) else "no answer"
raise RuntimeError(f"API {r.status_code}: {message}")
return data
# 1. Pick the first available service
services = og_api({"action": "services"})
service = next((s for s in services if s["available"]), None)
if service is None:
raise SystemExit("Nothing available right now")
# "link" carries what the service's input asks for: nothing, the account email, or the details
link = {"none": "", "email": "[email protected]", "text": "the details the service asks for"}[service["input"]]
# 2. Order it. On a timeout, send the same Idempotency-Key again: never a second charge.
idem = secrets.token_hex(16)
order = og_api({"action": "add", "service": service["service"], "link": link}, {"Idempotency-Key": idem})
# 3. Wait for the delivery
while True:
time.sleep(30)
status = og_api({"action": "status", "order": order["order"]})
if status["status"] not in ("Pending", "In progress"):
break
print(status["delivery"] if status["status"] == "Completed" else "Canceled: the charge is back in your balance")// Node.js 18+ (built-in fetch). Save as client.mjs and run: node client.mjs
import { randomUUID } from "node:crypto";
const API = "https://ogsub.net/api/v2";
const KEY = process.env.OG_API_KEY ?? "ogk_your_api_key"; // keep it on the server
async function ogApi(params, headers = {}) {
const res = await fetch(API, {
method: "POST",
headers,
body: new URLSearchParams({ key: KEY, ...params }),
signal: AbortSignal.timeout(30_000),
});
const data = await res.json().catch(() => null);
if (!res.ok || data === null || data.error) {
throw new Error(`API ${res.status}: ${data?.error ?? "no answer"}`);
}
return data;
}
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// 1. Pick the first available service
const services = await ogApi({ action: "services" });
const service = services.find((s) => s.available);
if (!service) {
console.log("Nothing available right now");
process.exit(0);
}
// "link" carries what the service's input asks for: nothing, the account email, or the details
const link = { none: "", email: "[email protected]", text: "the details the service asks for" }[service.input];
// 2. Order it. On a timeout, send the same Idempotency-Key again: never a second charge.
const order = await ogApi({ action: "add", service: String(service.service), link }, { "Idempotency-Key": randomUUID() });
// 3. Wait for the delivery
let status;
do {
await sleep(30_000);
status = await ogApi({ action: "status", order: order.order });
} while (["Pending", "In progress"].includes(status.status));
console.log(status.status === "Completed" ? status.delivery : "Canceled: the charge is back in your balance");