API Reference
REST API for WePredict. Base URL: https://wepredict.org/api
Overview
WePredict REST API reference for developers.
Base URL
https://wepredict.org/apiAuthentication
Include a JWT bearer token on all authenticated requests. Tokens are obtained from/auth/login or/auth/register. Tokens expire after 7 days.
Authorization: Bearer <token>Rate Limits
| Scope | Limit |
|---|---|
| /auth/* | 20 requests / 15 minutes per IP |
| All other /api/* routes | 300 requests / 15 minutes per IP |
Error Format
All errors return a JSON object with an error field.
{ "error": "description of the error" }Status Codes
| Code | Meaning |
|---|---|
| 200 / 201 | Success |
| 400 | Validation error or bad request |
| 401 | Missing or invalid token |
| 403 | Insufficient permissions |
| 404 | Resource not found |
| 429 | Rate limit exceeded |
| 500 | Server error |