API Documentation

Public RESTful API for accessing TokenForum data. No authentication required. All endpoints support JSON responses by default, and CSV export via the ?format=csv query parameter.

Projects

GET/api/v1/projects

Returns a list of all projects with basic information.

Query Parameters

ParameterTypeDescription
formatstringResponse format: "json" (default) or "csv"
searchstringSearch by name, description, or ticker
chainstringFilter by blockchain (e.g., "Ethereum", "Solana")
categorystringFilter by category (e.g., "DeFi", "NFT")

Example Response

{
  "success": true,
  "data": [
    {
      "id": "abc123",
      "name": "Example Token",
      "slug": "example-token",
      "ticker": "EXT",
      "chain": "Ethereum",
      "category": "DeFi",
      "website": "https://example.com",
      "description": "An example project",
      "createdAt": "2024-01-15T10:00:00.000Z"
    }
  ]
}

CSV format returns the same fields as columns with proper escaping.

Project Tokenomics

GET/api/v1/projects/:slug/tokenomics

Returns full tokenomics data for a specific project, including funding rounds, chain deployments, token migrations, rebasing config, and unlock events.

URL Parameters

ParameterTypeDescription
slugstringProject slug identifier

Query Parameters

ParameterTypeDescription
formatstringResponse format: "json" (default) or "csv"

Example Response

{
  "success": true,
  "data": {
    "id": "tok123",
    "projectId": "abc123",
    "totalSupply": "1000000000",
    "circulatingSupply": "500000000",
    "allocationTeam": 20,
    "allocationInvestor": 15,
    "allocationCommunity": 30,
    "allocationEcosystem": 25,
    "allocationTreasury": 10,
    "vestingSchedule": "[...]",
    "inflationRate": 2.5,
    "burnMechanism": "Buy-back and burn",
    "fundingRounds": [...],
    "chainDeployments": [...],
    "tokenMigrations": [...],
    "rebasingConfig": null,
    "unlockEvents": [...]
  }
}

CSV format flattens the main tokenomics fields into columns. Nested arrays are JSON-stringified.

Returns 404 if the project or its tokenomics data is not found.

Discussions

GET/api/v1/discussions

Returns paginated discussions. Supports filtering by project, category, and tag.

Query Parameters

ParameterTypeDescription
formatstringResponse format: "json" (default) or "csv"
pagenumberPage number (default: 1)
limitnumberItems per page (default: 20, max: 100)
projectSlugstringFilter by project slug
categorystringFilter by discussion category
tagstringFilter by tag slug

Example Response

{
  "success": true,
  "data": [
    {
      "id": "disc123",
      "title": "Token allocation concerns",
      "content": "Discussion content...",
      "category": "TOKENOMICS_ANALYSIS",
      "createdAt": "2024-01-20T08:30:00.000Z",
      "author": "John Doe",
      "projectName": "Example Token",
      "projectSlug": "example-token",
      "commentCount": 5,
      "voteCount": 12
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 42
  }
}

Anonymous discussions show "Anonymous" as the author name.

Statistics

GET/api/v1/stats

Returns aggregate platform statistics including totals, top projects, category breakdown, and recent discussions.

Query Parameters

None

Example Response

{
  "success": true,
  "data": {
    "totalProjects": 25,
    "totalDiscussions": 150,
    "totalComments": 430,
    "totalVotes": 890,
    "totalUsers": 50,
    "topProjectsByDiscussions": [
      { "id": "p1", "name": "Project A", "slug": "project-a", "discussionCount": 20 }
    ],
    "categoryBreakdown": [
      { "category": "TOKENOMICS_ANALYSIS", "count": 45 },
      { "category": "GENERAL", "count": 30 }
    ],
    "recentDiscussions": [
      { "id": "d1", "title": "Latest discussion", "category": "GENERAL", "createdAt": "...", "project": { "name": "...", "slug": "..." } }
    ]
  }
}

Notes

Authentication: All /api/v1/ endpoints are public and require no authentication.

Rate Limiting: All /api/v1/ endpoints are limited to 60 requests per minute per IP. Mutation endpoints (POST, PUT, DELETE) across all /api/ routes are limited to 30 requests per minute per IP. Exceeding these limits returns a 429 status code.

CSV Format: When using ?format=csv, the response includes a Content-Disposition header for file download. Values containing commas, quotes, or newlines are properly escaped. Nested objects are serialized as JSON strings within the CSV cell.

Error Responses: All errors return {"success": false, "error": "message"} with an appropriate HTTP status code.