4. Statistics Module
4.1 Report Interception Count
Increase interception statistics (requires token authentication).
Endpoint: POST /stats/a
Request Headers:
Text
Content-Type: application/json
Request Body:
JSON
{
"token": "aBcD1234EfGh5678IjKlMnOpQrSt"
}
Request Example:
cURL:
Bash
curl -X POST https://api.ndpreforged.com/stats/a \
-H "Content-Type: application/json" \
-d '{
"token": "aBcD1234EfGh5678IjKlMnOpQrSt"
}'
Python:
Python
import requests
response = requests.post(
"https://api.ndpreforged.com/stats/a",
json={
"token": "aBcD1234EfGh5678IjKlMnOpQrSt"
}
)
print(response.json())
Response Example:
Success (200 OK):
JSON
{
"total": 42,
"message": "Recorded"
}
Error Responses:
| Status Code | Error Message | Description |
|---|---|---|
| 401 | Invalid or missing token | Token format invalid or missing |
| 401 | Token not found | Token does not exist |
| 500 | Server error | Server internal error |
4.2 Get Interception Statistics
Get NDPR total interception count.
Endpoint: GET /stats/s
Request Example:
Bash
curl https://api.ndpreforged.com/stats/s
Python Request Example:
Python
import requests
response = requests.get("https://api.ndpreforged.com/stats/s")
print(response.json())
Success Response (200):
JSON
{
"total": 42
}
Error Response (500):
JSON
{
"error": "Server error"
}