> For the complete documentation index, see [llms.txt](https://docs.coinvera.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coinvera.io/integration/solana/rpc/minimumledgerslot.md).

# minimumLedgerSlot

The `minimumLedgerSlot` RPC method in **CoinVera** returns the **oldest slot** for which the queried RPC node retains ledger data. This is especially useful for determining whether a node can serve **historical queries**, such as old transactions or block information.

***

#### ✅ Common Use Cases

* **Determine Historical Data Availability**\
  Before querying for old transaction or block data, check if the node retains the slot you're interested in.
* **Understand Node Pruning Behavior**\
  Identify how much historical data the node stores—important when working with non-archival nodes that prune older slots.
* **Coordinate Historical Data Indexing**\
  Use this to set bounds for data-fetching services or APIs that sync and process Solana history.

***

#### 🧾 Request Parameters

This method **does not take any parameters**.

```ts
[]
```

***

#### 📦 Response Structure

Returns a single numeric value representing the **lowest slot** retained by the node:

```json
{
  "jsonrpc": "2.0",
  "result": 108938444,
  "id": 1
}
```

* **result**: The earliest slot this node can potentially serve data from.

***

#### 🧪 Example

**Get the Oldest Available Slot from an RPC Node**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "minimumLedgerSlot"
}
```

***

**Code Examples**

{% tabs %}
{% tab title="Nodejs" %}

```javascript
const fetch = require('node-fetch');

async function minimumLedgerSlot(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'minimumLedgerSlot'
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

minimumLedgerSlot(RPC_URL);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def minimum_ledger_slot(rpc_url):
    try:
        response = requests.post(
            rpc_url,
            headers={
                'Content-Type': 'application/json',
            },
            json={
                'jsonrpc': '2.0',
                'id': 1,
                'method': 'minimumLedgerSlot'
            }
        )
        
        data = response.json()
        
        # Print the exact full response
        print('Full RPC Response:')
        print(json.dumps(data, indent=2))
        
        return data
        
    except Exception as error:
        print(f'Error getting health: {error}')
        return None

# Example usage
RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key'
minimum_ledger_slot(RPC_URL)
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "jsonrpc": "2.0",
  "result": 355355858,
  "id": 1
}
```

***

#### 💡 Developer Tips

* **Node-Specific Result**\
  Each RPC node may retain a different portion of the ledger, depending on its configuration and whether it's archival.
* **Value Increases Over Time**\
  The minimum ledger slot can **only increase** as older data is pruned. It never decreases.
* **Not a Guarantee of Continuity**\
  The presence of a minimum slot does **not** mean all slots after it are available—gaps may exist.
* **Use Archival Nodes for Full History**\
  If you need complete historical data from genesis, query an archival node, as standard RPC nodes may not store full ledger history.

***

The `minimumLedgerSlot` method provides a reliable way to verify a node’s historical data retention range, helping you decide whether it's suitable for deep history queries or whether you need to switch to a full archival provider like **CoinVera**.
