# Track Wallet Activity

```
// def get_wallet_activity(wallet_address):
    url = f"{BASE_URL}/api/wallet/{wallet_address}"
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }

    try:
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        wallet_data = response.json()
        return wallet_data
    except requests.exceptions.RequestException as e:
        print(f"Error fetching wallet activity: {e}")
        return None

# Example wallet address
WALLET_ADDRESS = "EXAMPLE_WALLET"

# Fetch and display wallet activity
wallet_activity = get_wallet_activity(WALLET_ADDRESS)
if wallet_activity:
    print("Wallet Activity:")
    print(wallet_activity)


```

Response Example:

```
//{
  "wallet": "EXAMPLE_WALLET",
  "balance": "250 SOL",
  "tokens": [
    {"token": "TOKEN_A", "symbol": "TKA", "balance": 100},
    {"token": "TOKEN_B", "symbol": "TKB", "balance": 50}
  ],
  "recent_transactions": [
    {
      "tx_hash": "0x123",
      "type": "buy",
      "token": "TOKEN_A",
      "amount": 20,
      "timestamp": "2024-02-14T13:10:30Z"
    },
    {
      "tx_hash": "0x456",
      "type": "sell",
      "token": "TOKEN_B",
      "amount": 10,
      "timestamp": "2024-02-14T13:15:45Z"
    }
  ]
}

```


---

# Agent Instructions: 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/track-wallet-activity.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.
