Stats API
How to use the Stats APIs
PAAL AI Stats API Documentation
Introduction
This API documentation outlines the endpoints available for managing and retrieving statistical data in the PAAL AI application. These endpoints allow for the modification and retrieval of various statistics such as active users, total users, members, and prompts.
Base URL
The base URL for all endpoints is: https://paal-ecosystem-backend.onrender.com
Authentication
Some endpoints require authentication using a bearer token in the request header.
Save Stats Data
Save or modify statistical data.
URL:
/stats/save
Method:
POST
Authentication: Required (Bearer Token)
Request Body:
active
(integer, optional): Number of active users.users
(integer, optional): Total number of registered users.members
(integer, optional): Total number of members.prompt
(integer, optional): Total number of prompts.
Example Request:
Example Response (Success):
Example Response (Error):
Retrieve Stats Data
Retrieve statistical data.
URL:
/stats
Method:
GET
Authentication: Not Required
Example Request:
Example Response (Success):
Example Response (Empty):
Error Responses
In case of errors, the API returns JSON responses with appropriate error messages.
Example Error Response:
Get Token Market Chart Data
Endpoint: GET /stats/:chain/:address/chart
Authorization: Requires Bearer Token
Description
This endpoint retrieves historical market data, including price, trading volume, and market capitalization, for a given token contract on a specific blockchain.
Path Parameters
chain
number
The blockchain network ID (800 for solana).
address
string
The token contract address.
Query Parameters
duration
string
7d
The time range for the data. Accepted values: 1yr
, 6mon
, 3mon
, 1mon
, 30d
, 7d
, 24h
, 6h
, 1h
, 30m
, 5m
, 1m
.
filter
string
d
Data granularity. Accepted values: d
(daily), mon
(monthly), w
(weekly), h
(hourly), m
(minute).
start
number (timestamp)
optional
Custom start time (Unix timestamp in seconds).
end
number (timestamp)
optional
Custom end time (Unix timestamp in seconds).
Response
A JSON object with three main arrays: prices
, volume
, and marketCap
. Each contains date-value pairs.
Error Responses
403
{ "status": "error", "msg": "Missing parameters" }
403
{ "status": "error", "msg": "Something went wrong" }
500
{ "status": "error", "msg": "Internal server error" }
This documentation provides details on how to manage and retrieve statistical data using the PAAL AI Stats API. For any further assistance or clarification, please refer to the API documentation or contact support.
Last updated