API Documentation

FanCup REST API v1.0

Base URL

https://api.fancup.pro/v1

All API requests should be made to this base URL. For development, use: http://localhost:3000/api

Authentication

Most endpoints require authentication using a Bearer token in the Authorization header:

Authorization: Bearer YOUR_JWT_TOKEN

Get your token by logging in through /auth/login endpoint.

Authentication Endpoints

POST /auth/register

Register a new user account.

Request Body:

{
  "username": "string",
  "email": "string",
  "password": "string"
}

Response:

{
  "token": "jwt_token",
  "user": { ... }
}

POST /auth/login

Login with email and password.

Request Body:

{
  "email": "string",
  "password": "string"
}

GET /auth/me

Get current authenticated user's profile. Requires authentication.

User Endpoints

GET /users/profile

Get user profile. Requires authentication.

PUT /users/profile

Update user profile.

Request Body:

{
  "username": "string (optional)",
  "bio": "string (optional)",
  "avatarUrl": "string (optional)",
  ...
}

POST /users/wallets

Add a new wallet address.

Request Body:

{
  "name": "string",
  "address": "string",
  "isPrimary": boolean
}

PUT /users/seed-phrase

Update user seed phrase (encrypted). Requires authentication.

POST /users/badges

Claim a badge. Requires authentication.

Request Body:

{
  "badgeId": "badge-seed-phrase"
}

Note: Some badges (like badge-seed-phrase) automatically award SOL rewards.

Creator Key Endpoints

GET /creator-keys

List all creator keys with pagination.

Query Parameters:

  • page - Page number (default: 1)
  • limit - Items per page (default: 20)
  • sort - Sort by: volume, price, followers

GET /creator-keys/:id

Get details of a specific creator key.

POST /creator-keys

Launch a new creator key. Requires authentication.

Badge Endpoints

GET /badges

List all available badges.

GET /badges/:id

Get badge details including rarity, reward, and requirements.

Response Codes

  • 200 - Success
  • 201 - Created
  • 400 - Bad Request
  • 401 - Unauthorized
  • 404 - Not Found
  • 500 - Server Error

Rate Limiting

API requests are rate-limited to 100 requests per minute per IP address. Authentication increases this to 1000 requests per minute.

WebSocket Support

Real-time updates (trades, badges, etc.) are available via WebSocket:

wss://api.fancup.pro/v1/ws

SDKs & Libraries

Official SDKs are available for:

  • JavaScript/TypeScript (npm: @fancup/sdk)
  • Python (pip: fancup-sdk)
  • Rust (crates.io: fancup-sdk)

Need Help?

For API support, examples, or to report issues:

Email: api@fancup.pro