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

# HTTP RPC API

> Interact with Solana nodes using JSON-RPC 2.0

## Overview

OrbitFlare RPC nodes accept HTTP requests using the JSON-RPC 2.0 specification. This API allows you to interact with the Solana blockchain for querying data and submitting transactions.

## Request Format

To make a JSON-RPC request, send an HTTP POST request with the following specifications:

* Endpoint: `https://fra.rpc.orbitflare.com?api_key=YOUR_LICENSE_KEY`
* Header: `Content-Type: application/json`
* Body: JSON object with these fields:

| Field     | Type          | Description                |
| --------- | ------------- | -------------------------- |
| `jsonrpc` | string        | Must be "2.0"              |
| `id`      | string/number | Unique request identifier  |
| `method`  | string        | The RPC method name        |
| `params`  | array         | Array of method parameters |

### Example Request

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR_LICENSE_KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBalance",
  "params": [
    "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
  ]
}'
```

### Response Format

Responses will be JSON objects containing:

| Field     | Type          | Description                   |
| --------- | ------------- | ----------------------------- |
| `jsonrpc` | string        | Always "2.0"                  |
| `id`      | string/number | Matches request identifier    |
| `result`  | varies        | The method's result data      |
| `error`   | object        | Error details (if applicable) |

## Commitment

Many methods accept a `commitment` parameter to specify how confirmed the data should be:

* `processed`: Latest block (fastest, not confirmed)
* `confirmed`: Confirmed by supermajority (balance between speed and finality)
* `finalized`: Finalized by supermajority (slowest, fully confirmed)

Example with commitment:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR_LICENSE_KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBalance",
  "params": [
    "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
    {"commitment": "finalized"}
  ]
}'
```

## Batch Requests

You can send multiple requests in a single HTTP call by providing an array of request objects:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR_LICENSE_KEY -X POST -H "Content-Type: application/json" -d '[
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBalance",
    "params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]
  },
  {
    "jsonrpc": "2.0",
    "id": 2,
    "method": "getBlockHeight",
    "params": []
  }
]'
```

## Common Types

| Type      | Description                         |
| --------- | ----------------------------------- |
| Pubkey    | Base-58 encoded public key string   |
| Hash      | Base-58 encoded SHA-256 hash string |
| Signature | Base-58 encoded Ed25519 signature   |
| Slot      | Integer block height/slot number    |

## Health Check

You can check node health with a GET request:

```bash theme={null}
curl "https://fra.rpc.orbitflare.com/health?api_key=YOUR_LICENSE_KEY"
```

Possible responses:

* `ok`: Node is healthy and up-to-date
* `behind { slots: number }`: Node is behind by N slots
* `error`: Node is unhealthy

## Available Methods

<CardGroup>
  <Card title="Account & Program" icon="user">
    * getAccountInfo
    * getMultipleAccounts
    * getProgramAccounts
    * getMinimumBalanceForRentExemption
  </Card>

  <Card title="Blocks & Slots" icon="cube">
    * getBlock
    * getBlocks
    * getBlockHeight
    * getSlot
    * getSlotLeader
  </Card>

  <Card title="Transactions" icon="arrow-right-arrow-left">
    * getTransaction
    * getSignatureStatuses
    * getSignaturesForAddress
    * sendTransaction
    * simulateTransaction
  </Card>

  <Card title="Tokens" icon="coins">
    * getTokenAccountBalance
    * getTokenAccountsByDelegate
    * getTokenAccountsByOwner
    * getTokenSupply
  </Card>
</CardGroup>

## Rate Limits

Rate limits vary by subscription tier. See the [Authentication & Limits](/authentication#rate-limits-by-plan) page for the exact RPS and TPS values per plan.

## Best Practices

1. **Use Appropriate Commitment Levels**
   * Use `processed` for UI updates
   * Use `confirmed` for most operations
   * Use `finalized` for critical operations

2. **Optimize Requests**
   * Use batch requests when possible
   * Implement proper caching
   * Choose appropriate polling intervals

3. **Handle Errors**
   * Implement proper error handling
   * Use exponential backoff for retries
   * Monitor request failures

## See Also

<CardGroup cols={3}>
  <Card title="Authentication & Limits" icon="key" href="/authentication">
    API key setup, endpoint formats, rate limits, and connection limits.
  </Card>

  <Card title="Error Codes" icon="triangle-exclamation" href="/rpc/error-codes">
    HTTP status codes, JSON-RPC errors, and how to handle them.
  </Card>

  <Card title="WebSocket API" icon="plug" href="/rpc/websocket">
    Real-time subscriptions for accounts, slots, logs, and more.
  </Card>
</CardGroup>

## Support

For technical support or questions about our RPC service:

* Join our [Discord community](https://discord.gg/orbitflare)
* Check our [status page](https://status.orbitflare.com)
* Contact our support team
