Public API
Public endpoints for integrating Rally stats into your website, dashboard, or application. No authentication required.
Base URL
| Environment | URL |
|---|---|
| Production | https://rally.genlayer.com/api/public |
| Staging | https://rally-staging.vercel.app/api/public |
Endpoints
GET /stats
Platform-wide statistics for public display.
Authentication: None required
Example Request:
curl https://rally.genlayer.com/api/public/statsResponse:
{
"success": true,
"data": {
"activeCampaigns": 5,
"totalParticipants": 1234,
"totalSubmissions": 5678,
"totalImpressions": 2500000
}
}Response Fields:
| Field | Type | Description |
|---|---|---|
activeCampaigns | number | Currently active campaigns (not ended, not deleted) |
totalParticipants | number | Unique users who have submitted across all campaigns |
totalSubmissions | number | Total tweet submissions across all campaigns |
totalImpressions | number | Total Twitter/X impressions across all campaign periods |
Usage Examples
JavaScript/TypeScript
async function getRallyStats() {
const response = await fetch('https://rally.genlayer.com/api/public/stats');
const { data } = await response.json();
console.log(`${data.totalImpressions.toLocaleString()} impressions generated`);
console.log(`${data.totalParticipants.toLocaleString()} participants`);
return data;
}React Component
function RallyStats() {
const [stats, setStats] = useState(null);
useEffect(() => {
fetch('https://rally.genlayer.com/api/public/stats')
.then(res => res.json())
.then(({ data }) => setStats(data));
}, []);
if (!stats) return <div>Loading...</div>;
return (
<div>
<p>{stats.totalImpressions.toLocaleString()} impressions</p>
<p>{stats.totalParticipants.toLocaleString()} participants</p>
<p>{stats.activeCampaigns} active campaigns</p>
</div>
);
}Rate Limiting
Standard rate limits apply. For high-traffic integrations, consider caching responses on your end.
Data Freshness
Statistics are updated when campaign metrics are aggregated, typically every few hours. The data represents cumulative totals across all Rally campaigns.
Last updated on