Полная статистика
curl --request GET \
--url https://api.example.com/stats/full \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/stats/full"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/stats/full', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/stats/full",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/stats/full"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/stats/full")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/stats/full")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"overview": {
"users": {
"total": 12345,
"active": 9876,
"blocked": 321,
"balance_kopeks": 1234567,
"balance_rubles": 12345.67
},
"subscriptions": {
"active": 4321,
"expired": 210
},
"support": {
"open_tickets": 42
},
"payments": {
"today_kopeks": 654321,
"today_rubles": 6543.21
}
},
"users": {
"total_users": 12345,
"active_users": 9876,
"blocked_users": 321,
"new_today": 12,
"new_week": 345,
"new_month": 1234
},
"subscriptions": {
"total_subscriptions": 9876,
"active_subscriptions": 8765,
"trial_subscriptions": 321,
"paid_subscriptions": 8444,
"purchased_today": 12,
"purchased_week": 210,
"purchased_month": 765,
"trial_to_paid_conversion": 42.5,
"renewals_count": 123,
"trial_statistics": {
"used_trials": 555,
"active_trials": 210,
"resettable_trials": 42
}
},
"transactions": {
"period": {
"start_date": "2024-06-01T00:00:00Z",
"end_date": "2024-06-30T23:59:59Z"
},
"totals": {
"income_kopeks": 1234567,
"income_rubles": 12345.67,
"expenses_kopeks": 21000,
"expenses_rubles": 210,
"profit_kopeks": 1213567,
"profit_rubles": 12135.67,
"subscription_income_kopeks": 987654,
"subscription_income_rubles": 9876.54
},
"today": {
"transactions_count": 42,
"income_kopeks": 654321,
"income_rubles": 6543.21
},
"by_type": {
"deposit": {
"count": 123,
"amount": 1234567
},
"withdrawal": {
"count": 10,
"amount": 21000
}
},
"by_payment_method": {
"card": {
"count": 100,
"amount": 1000000
}
}
},
"referrals": {
"users_with_referrals": 4321,
"active_referrers": 123,
"total_paid_kopeks": 765432,
"total_paid_rubles": 7654.32,
"today_earnings_kopeks": 12345,
"today_earnings_rubles": 123.45,
"week_earnings_kopeks": 23456,
"week_earnings_rubles": 234.56,
"month_earnings_kopeks": 34567,
"month_earnings_rubles": 345.67,
"top_referrers": [
{
"user_id": 123456789,
"display_name": "@testuser",
"username": "testuser",
"telegram_id": 123456789,
"total_earned_kopeks": 54321,
"referrals_count": 42
}
]
}
}stats
Полная статистика
Получение полной детализированной статистики системы.
GET
/
stats
/
full
Полная статистика
curl --request GET \
--url https://api.example.com/stats/full \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/stats/full"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/stats/full', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/stats/full",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/stats/full"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/stats/full")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/stats/full")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"overview": {
"users": {
"total": 12345,
"active": 9876,
"blocked": 321,
"balance_kopeks": 1234567,
"balance_rubles": 12345.67
},
"subscriptions": {
"active": 4321,
"expired": 210
},
"support": {
"open_tickets": 42
},
"payments": {
"today_kopeks": 654321,
"today_rubles": 6543.21
}
},
"users": {
"total_users": 12345,
"active_users": 9876,
"blocked_users": 321,
"new_today": 12,
"new_week": 345,
"new_month": 1234
},
"subscriptions": {
"total_subscriptions": 9876,
"active_subscriptions": 8765,
"trial_subscriptions": 321,
"paid_subscriptions": 8444,
"purchased_today": 12,
"purchased_week": 210,
"purchased_month": 765,
"trial_to_paid_conversion": 42.5,
"renewals_count": 123,
"trial_statistics": {
"used_trials": 555,
"active_trials": 210,
"resettable_trials": 42
}
},
"transactions": {
"period": {
"start_date": "2024-06-01T00:00:00Z",
"end_date": "2024-06-30T23:59:59Z"
},
"totals": {
"income_kopeks": 1234567,
"income_rubles": 12345.67,
"expenses_kopeks": 21000,
"expenses_rubles": 210,
"profit_kopeks": 1213567,
"profit_rubles": 12135.67,
"subscription_income_kopeks": 987654,
"subscription_income_rubles": 9876.54
},
"today": {
"transactions_count": 42,
"income_kopeks": 654321,
"income_rubles": 6543.21
},
"by_type": {
"deposit": {
"count": 123,
"amount": 1234567
},
"withdrawal": {
"count": 10,
"amount": 21000
}
},
"by_payment_method": {
"card": {
"count": 100,
"amount": 1000000
}
}
},
"referrals": {
"users_with_referrals": 4321,
"active_referrers": 123,
"total_paid_kopeks": 765432,
"total_paid_rubles": 7654.32,
"today_earnings_kopeks": 12345,
"today_earnings_rubles": 123.45,
"week_earnings_kopeks": 23456,
"week_earnings_rubles": 234.56,
"month_earnings_kopeks": 34567,
"month_earnings_rubles": 345.67,
"top_referrers": [
{
"user_id": 123456789,
"display_name": "@testuser",
"username": "testuser",
"telegram_id": 123456789,
"total_earned_kopeks": 54321,
"referrals_count": 42
}
]
}
}Authorizations
Response
200 - application/json
Расширенные показатели пользователей, подписок, платежей и рефералов
The response is of type Response Stats Full Stats Full Get · object.
⌘I
