Fetch Token Information

This script retrieves detailed token analytics, including liquidity, holder distribution, and transaction history.

// import requests

# Constants
API_KEY = "your_api_key"
BASE_URL = "https://api.bobradar.io"
TOKEN_ADDRESS = "EXAMPLE_TOKEN_ADDRESS"

# Function to fetch token details
def get_token_info(token_address):
    url = f"{BASE_URL}/api/token/{token_address}"
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }

    try:
        response = requests.get(url, headers=headers)
        response.raise_for_status()  # Raise an error for bad responses (4xx, 5xx)
        token_data = response.json()
        return token_data
    except requests.exceptions.RequestException as e:
        print(f"Error fetching token data: {e}")
        return None

# Fetch and display token data
token_info = get_token_info(TOKEN_ADDRESS)
if token_info:
    print("Token Information:")
    print(token_info)

Response Example:

Last updated