Skip to Content
Rally Private Alpha is live 🚀

Public API

Public endpoints for integrating Rally stats into your website, dashboard, or application. No authentication required.

Base URL

EnvironmentURL
Productionhttps://rally.genlayer.com/api/public
Staginghttps://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/stats

Response:

{ "success": true, "data": { "activeCampaigns": 5, "totalParticipants": 1234, "totalSubmissions": 5678, "totalImpressions": 2500000 } }

Response Fields:

FieldTypeDescription
activeCampaignsnumberCurrently active campaigns (not ended, not deleted)
totalParticipantsnumberUnique users who have submitted across all campaigns
totalSubmissionsnumberTotal tweet submissions across all campaigns
totalImpressionsnumberTotal 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