Get All Coins

Endpoint: GET /api/v1/coin/all

Description

This endpoint retrieves a comprehensive list of all tokens created on the platform, including their associated comments, creator information, and AI agent details. The data is returned in a structured format with related entities nested within each token object.

Authentication Required: No

Type: None

Request Headers

Content-Type: application/json

Parameters

None (no query parameters required)

Response

Success Response

Status Code: 200 OK

Content-Type: application/json

type Response = Array<{

// Token Information

mintAddress: string;

name: string;

symbol: string;

description: string;

metaDataUrl: string;

imageUrl: string;

creatorWalletAddress: string;

status: string;

tx: string | null;

signature: string | null;

migrationStatus: string | null;

kingOfTheHillTimeStamp: string | null;

marketCap: string | null;

createdAt: string;

updatedAt: string;

// Related Entities

comments: Array<{

id: number;

content: string;

createdAt: string;

user: {

walletAddress: string;

username: string;

role: string;

}

}>;

creator: {

walletAddress: string;

username: string;

role: string;

lastLogin: string;

};

agent: {

id: number;

agentId: string;

name: string;

description: string;

personality: string;

instruction: string;

knowledge: string;

points: number;

usedPoints: number;

ownerWalletAddress: string;

telegramUrl: string;

twitterUrl: string;

websiteUrl: string;

createdAt: string;

updatedAt: string;

deletedAt: string | null;

} | null;

}>

Error Response

Status Code: 500 Internal Server Error

{

"error": "An internal error occurred. Please try again later."

}

Example Usage

async function getAllCoins() {

try {

const response = await fetch('https://api.cybers.app/api/v1/coin/all');

if (!response.ok) {

throw new Error(`HTTP error! status: ${response.status}`);

}

const coins = await response.json();

return coins;

} catch (error) {

console.error('Error fetching coins:', error);

throw error;

}

}

// Example usage with filtering and display

async function displayActiveCoins() {

try {

const allCoins = await getAllCoins();

// Filter for active coins

const activeCoins = allCoins.filter(coin =>

coin.status === 'success' && !coin.migrationStatus

);

// Sort by market cap

const sortedCoins = activeCoins.sort((a, b) =>

Number(b.marketCap || 0) - Number(a.marketCap || 0)

);

// Process and display

sortedCoins.forEach(coin => {

console.log(`

Token: ${coin.name} (${coin.symbol})

Market Cap: ${coin.marketCap || 'N/A'}

Creator: ${coin.creator.username || coin.creator.walletAddress}

Comments: ${coin.comments.length}

AI Agent: ${coin.agent ? 'Enabled' : 'Disabled'}

`);

});

} catch (error) {

console.error('Error processing coins:', error);

}

}

Implementation Notes

Data Structure

The response includes nested relationships for comments, creator, and agent

Sensitive information (like telegramToken) is excluded from the agent data

All timestamps are returned in ISO 8601 format

Performance Considerations

The endpoint retrieves all coins and their relationships in a single query

Consider implementing pagination if the dataset grows large (under progress)

Response is cached at the database level for optimal performance

Null Handling

Several fields can be null (tx, signature, migrationStatus, etc.)

The agent object itself can be null if no AI agent is associated

Implement proper null checks in your frontend code

Related Fields

comments includes the user who made the comment

creator includes basic user information

agent includes AI configuration but excludes sensitive data

Common Use Cases

Token Directory

const tokens = await getAllCoins();

const directory = tokens.map(token => ({

name: token.name,

symbol: token.symbol,

marketCap: token.marketCap,

status: token.status,

creatorName: token.creator.username

}));

Social Activity Metrics

const tokens = await getAllCoins();

const socialMetrics = tokens.map(token => ({

symbol: token.symbol,

commentCount: token.comments.length,

hasAgent: !!token.agent,

socialLinks: {

telegram: token.agent?.telegramUrl,

twitter: token.agent?.twitterUrl,

website: token.agent?.websiteUrl

}

}));

Migration Status Tracking

const tokens = await getAllCoins();

const migrationStatus = tokens.reduce((acc, token) => {

acc[token.mintAddress] = {

status: token.migrationStatus,

timestamp: token.kingOfTheHillTimeStamp

};

return acc;

}, {});

Last updated