Tomo APIs
Tomo APIs provide various functions for developers to interact with open market information.
getTokenByName
Retrieves detailed information about the token of a given token name.
Request Parameters:
tokenName
(string, required): The name of the token to query.
const tokenDetails = async () => {
return await fetch('https://apis.tomo.inc/sky/api/socialLogin/teleGram/getByName?tokenName=BTC', {
method: 'GET'
}).then(res => res.json());
};
getTokenDetails
Fetches detailed metadata for a token, including its name, symbol, price, and additional information like social links. This is useful for users who want comprehensive data about a particular token.
Request Parameters:
address
(string, query, required): The contract address of the token.chain
(string, query, required): The blockchain on which the token resides (e.g., "eth" for Ethereum).
Example Request:
const queryTokenDetails = async () => {
return await fetch('https://apis.tomo.inc/cloud/v4/memes-overview?address=0x8290333cef9e6d528dd5618fb97a76f268f3edd4&chain=eth', {
method: 'GET'
}).then(res => res.json());
};
getAllTokens
Searches and retrieves all tokens available in the market. The result can be big and take time. Developers can cache it locally for operations like different sorting of all tokens.
const allTokens= async () => {
return await fetch('https://apis.tomo.inc/sky/api/socialLogin/teleGram/wallet/tokens', {
method: 'GET'
}).then(res => res.json());
};
getMainstreamTokens
Fetches detailed information about mainstream tokens like BTC, ETH, SOL, etc.
const getSelectedTokens = async () => {
return await fetch('https://apis.tomo.inc/sky/api/socialLogin/teleGram/wallet/selectedTokens', {
method: 'GET'
}).then(res => res.json());
};
getTrendingTokens
Fetches the trending tokens based on chain activity and user interactions.
const trendingTokens = async () => {
return await fetch('https://apis.tomo.inc/sky/api/socialLogin/teleGram/wallet/trendingTokens', {
method: 'GET'
}).then(res => res.json());
};
searchToken
This API allows users to search for tokens' details in a fuzzy way by providing the keywords in the token name or contract address.
Request Parameters:
content
(string, query, required): Search keywords such as the address of the token or token name.chain
(string, query, optional): The blockchain network on which the token resides (e.g., Ethereum, BSC). If omitted, it will search across all supported chains.
const searchTokens = async () => {
return await fetch('https://apis.tomo.inc/sky/api/socialLogin/teleGram/wallet/tokens/search?content="&chain=eth', {
method: 'GET'
}).then(res => res.json());
};
getOHLCV
Retrieves OHLCV (Open, High, Low, Close, Volume) chart data for a specific token. Used for drawing the K-line of the token.
Request Parameters:
tokenName
(string, path, required): The name of the token for which the OHLCV data is requested.interval
(string, query, required): The time interval for each OHLCV data point. Possible values include:minute
five_minute
fifteen_minute
hour
four_hour
Last updated