> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neyrs.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Portfolio

> Retrieve wallet balances and portfolio value

### Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token. Format: `Bearer neyrs_live_abc123def456`
</ParamField>

### Query Parameters

<ParamField query="walletAddress" type="string" required>
  Solana wallet address
</ParamField>

### Response

<ResponseField name="walletAddress" type="string">
  Wallet address
</ResponseField>

<ResponseField name="totalValue" type="number">
  Total portfolio value in USD
</ResponseField>

<ResponseField name="tokens" type="array">
  Array of token holdings

  Each token contains:

  * `mint` (string): Token mint address
  * `symbol` (string): Token symbol
  * `balance` (number): Token balance
  * `decimals` (number): Token decimals
  * `usdValue` (number): USD value
  * `price` (number): Current price per token
</ResponseField>

<ResponseField name="lastUpdated" type="string">
  ISO 8601 timestamp of last update
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.neyrs.cloud/v1/portfolio?walletAddress=7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU' \
    --header 'Authorization: Bearer neyrs_live_abc123def456'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.neyrs.cloud/v1/portfolio?walletAddress=7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
    {
      headers: {
        'Authorization': `Bearer ${process.env.NEYRS_API_KEY}`
      }
    }
  );
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.neyrs.cloud/v1/portfolio',
      params={
          'walletAddress': '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU'
      },
      headers={
          'Authorization': f'Bearer {api_key}'
      }
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "totalValue": 7389.81,
    "tokens": [
      {
        "mint": "So11111111111111111111111111111111111111112",
        "symbol": "SOL",
        "balance": 12.45,
        "decimals": 9,
        "usdValue": 1867.50,
        "price": 150.00
      },
      {
        "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "symbol": "USDC",
        "balance": 5432.10,
        "decimals": 6,
        "usdValue": 5432.10,
        "price": 1.00
      }
    ],
    "lastUpdated": "2024-03-08T14:30:00Z"
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "error": {
      "code": "validation_error",
      "message": "Invalid wallet address format"
    }
  }
  ```
</ResponseExample>
