NexusEnhanced API
Token Metadata
Get SPL token information including symbols, names, and logos
Token Metadata
Resolve SPL token metadata from multiple sources including Jupiter, X1 Blockchain Token List, and on-chain Metaplex metadata.
GET /v0/token/:mint
Get comprehensive token metadata for a specific mint address.
Request
curl "https://nexus.fortiblox.com/api/v1/v0/token/EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w?api-key=$FORTIBLOX_API_KEY"const API_KEY = process.env.FORTIBLOX_API_KEY;
const BASE_URL = 'https://nexus.fortiblox.com/api/v1/v0';
async function getTokenMetadata(mint) {
const response = await fetch(
`${BASE_URL}/token/${mint}?api-key=${API_KEY}`
);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const data = await response.json();
if (!data.success) {
throw new Error(data.message || data.error);
}
return data.data;
}
// Usage
const usdcMint = 'EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w';
const metadata = await getTokenMetadata(usdcMint);
console.log('Token:', metadata.symbol);
console.log('Name:', metadata.name);
console.log('Decimals:', metadata.decimals);
console.log('Logo:', metadata.logoURI);import os
import requests
API_KEY = os.getenv('FORTIBLOX_API_KEY')
BASE_URL = 'https://nexus.fortiblox.com/api/v1/v0'
def get_token_metadata(mint: str):
"""Get token metadata from Enhanced API"""
response = requests.get(
f'{BASE_URL}/token/{mint}',
params={'api-key': API_KEY}
)
response.raise_for_status()
data = response.json()
if not data['success']:
raise Exception(data.get('message') or data.get('error'))
return data['data']
# Usage
usdc_mint = 'EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w'
metadata = get_token_metadata(usdc_mint)
print(f"Token: {metadata['symbol']}")
print(f"Name: {metadata['name']}")
print(f"Decimals: {metadata['decimals']}")
print(f"Logo: {metadata['logoURI']}")use reqwest;
use serde::Deserialize;
use std::env;
#[derive(Debug, Deserialize)]
struct EnhancedResponse<T> {
success: bool,
data: Option<T>,
message: Option<String>,
error: Option<String>,
cached: Option<bool>,
}
#[derive(Debug, Deserialize)]
struct TokenMetadata {
address: String,
symbol: String,
name: String,
decimals: u8,
#[serde(rename = "logoURI")]
logo_uri: Option<String>,
tags: Option<Vec<String>>,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = env::var("FORTIBLOX_API_KEY")?;
let usdc_mint = "EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w";
let metadata = get_token_metadata(&api_key, usdc_mint).await?;
println!("Token: {}", metadata.symbol);
println!("Name: {}", metadata.name);
println!("Decimals: {}", metadata.decimals);
if let Some(logo) = &metadata.logo_uri {
println!("Logo: {}", logo);
}
Ok(())
}
async fn get_token_metadata(
api_key: &str,
mint: &str
) -> Result<TokenMetadata, Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let url = format!(
"https://nexus.fortiblox.com/api/v1/v0/token/{}?api-key={}",
mint, api_key
);
let response = client.get(&url).send().await?;
let data: EnhancedResponse<TokenMetadata> = response.json().await?;
if !data.success {
let error_msg = data.message
.or(data.error)
.unwrap_or("Unknown error".into());
return Err(error_msg.into());
}
Ok(data.data.unwrap())
}package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type EnhancedResponse struct {
Success bool `json:"success"`
Data TokenMetadata `json:"data,omitempty"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Cached bool `json:"cached,omitempty"`
}
type TokenMetadata struct {
Address string `json:"address"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Decimals uint8 `json:"decimals"`
LogoURI string `json:"logoURI,omitempty"`
Tags []string `json:"tags,omitempty"`
}
func getTokenMetadata(mint string) (*TokenMetadata, error) {
apiKey := os.Getenv("FORTIBLOX_API_KEY")
url := fmt.Sprintf(
"https://nexus.fortiblox.com/api/v1/v0/token/%s?api-key=%s",
mint, apiKey,
)
// Make HTTP GET request
resp, err := http.Get(url)
if err != nil {
return nil, err
}
defer resp.Body.Close()
// Read response body
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
// Parse JSON response
var result EnhancedResponse
if err := json.Unmarshal(body, &result); err != nil {
return nil, err
}
// Check for API errors
if !result.Success {
errMsg := result.Message
if errMsg == "" {
errMsg = result.Error
}
if errMsg == "" {
errMsg = "Unknown error"
}
return nil, fmt.Errorf("API error: %s", errMsg)
}
return &result.Data, nil
}
func main() {
usdcMint := "EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w"
metadata, err := getTokenMetadata(usdcMint)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("Token: %s\n", metadata.Symbol)
fmt.Printf("Name: %s\n", metadata.Name)
fmt.Printf("Decimals: %d\n", metadata.Decimals)
fmt.Printf("Logo: %s\n", metadata.LogoURI)
}Response
{
"success": true,
"data": {
"address": "EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w/logo.png",
"tags": ["stablecoin"],
"extensions": {
"coingeckoId": "usd-coin"
}
},
"cached": true,
"cache_age_seconds": 3456
}GET /v0/tokens/:address
Get all token balances for a wallet address with metadata.
Request
curl "https://nexus.fortiblox.com/api/v1/v0/tokens/9B5XszUGdMaxCZ7uSQhPzdks5ZQSmWxrmzCSvtJ6Ns6g?api-key=$FORTIBLOX_API_KEY"Response
{
"success": true,
"data": {
"address": "9B5XszUGdMaxCZ7uSQhPzdks5ZQSmWxrmzCSvtJ6Ns6g",
"tokens": [
{
"mint": "EPjFWdd5Au17BXwoyS7G5Fj306awm3ibB5mWChip4Z1w",
"symbol": "USDC",
"name": "USD Coin",
"balance": 100000000,
"uiBalance": 100,
"decimals": 6,
"logoURI": "https://..."
}
],
"total_tokens": 5
}
}See Enhanced API Overview for more details.