> For the complete documentation index, see [llms.txt](https://bob-radar.gitbook.io/bob-radar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bob-radar.gitbook.io/bob-radar/fetch-token-information.md).

# Fetch Token Information

```
// 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:

```
//{
  "token": "EXAMPLE_TOKEN",
  "symbol": "EXT",
  "liquidity": "5000 SOL",
  "holders": 1200,
  "market_cap": "2,500,000 USDC",
  "transactions": [
    {
      "tx_hash": "#",
      "from": "wallet_1",
      "to": "wallet_2",
      "amount": 50,
      "timestamp": "2024-02-14T12:34:56Z"
    },
    {
      "tx_hash": "0xdef456",
      "from": "wallet_3",
      "to": "wallet_4",
      "amount": 100,
      "timestamp": "2024-02-14T12:40:12Z"
    }
  ]
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bob-radar.gitbook.io/bob-radar/fetch-token-information.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
