NoLimitNodes
PricingDocsBlogAbout
SupportContact
Log in
Blog/Guides

Solana RPC API Tutorial: How to Connect to a Solana RPC Node

A Solana RPC API lets applications read blockchain data, submit transactions, and query Solana network state without operating their own RPC infrastructure. In this tutorial, you'll learn how to connect to a NoLimitNodes Solana RPC endpoint, authenticate requests with an API key, send your first JSON-RPC request, and subscribe to real-time Solana events over WebSocket.

N
NoLimitNodes Team
Community & Tutorials
Dec 19, 2024updated Jun 10, 20264 min read
On this page +
  • 01Quick Answer
  • 02What You'll Learn
  • 03What Is a Solana RPC API?
  • 04Do You Need to Run Your Own Solana RPC Node?
  • 05Solana RPC API Endpoint
  • 06How to Secure Your Solana API Key
  • 07Solana RPC vs WebSocket
  • 081. Set Up Your Solana RPC API Access
  • 092. Send Your First Solana JSON-RPC Request
  • 103. Connect to the Solana WebSocket API
  • 114. Solana RPC API Best Practices

NoLimitNodes gives you Solana JSON-RPC over HTTP and WebSocket access to the Solana blockchain through a single API key. This guide walks through account setup, your first JSON-RPC request, streaming live events over a socket, and a few habits that keep an integration stable in production.

Quick Answer

To connect to a Solana RPC API, create an RPC project, obtain an API key, send JSON-RPC requests to your provider's HTTP endpoint, and use WebSocket subscriptions when you need real-time updates. With NoLimitNodes, the current RPC endpoint is https://rpc.mainnet.solana.nolimitnodes.com and requests use the x-api-key header.

What You'll Learn

By the end of this tutorial, you'll know how to:

  • Create a NoLimitNodes Solana project.
  • Generate an API key.
  • Connect to a Solana RPC endpoint.
  • Send a JSON-RPC request with cURL.
  • Make Solana RPC requests from JavaScript or Python.
  • Connect to the Solana WebSocket API.
  • Subscribe to real-time logs.
  • Secure your API key.
  • Handle errors and rate limits.
  • Move the integration into production.

What Is a Solana RPC API?

A Solana RPC API is an interface that allows applications to communicate with the Solana blockchain through Remote Procedure Calls. Developers can use Solana JSON-RPC methods to retrieve account data, query blocks and transactions, check network state, and submit signed transactions.

Do You Need to Run Your Own Solana RPC Node?

No. Applications can use a managed Solana RPC provider instead of operating their own RPC infrastructure. Running an RPC node requires hardware, storage, networking, monitoring, upgrades, and ongoing infrastructure management.

Solana RPC Nodes

Solana RPC API Endpoint

Your application connects to Solana through an RPC endpoint. With NoLimitNodes, the current HTTP RPC endpoint is:

https://rpc.mainnet.solana.nolimitnodes.com

Requests are authenticated using an API key supplied through the x-api-key HTTP header. Keep the API key server-side. Do not expose it in browser code, mobile applications, public repositories, or client-side configuration where users can extract it.

How to Secure Your Solana API Key

Do

  • Store it in environment variables.
  • Keep it on the backend.
  • Rotate it if exposed.
  • Restrict access to your deployment environment.
  • Avoid logging it.

Don't

  • Put it in GitHub.
  • Put it in frontend JavaScript.
  • Put it in mobile application source.
  • Hard-code it into public examples.

Solana RPC vs WebSocket

Use caseAPI
Get account dataJSON-RPC
Get SOL balanceJSON-RPC
Get block informationJSON-RPC
Submit transactionJSON-RPC
Get transaction historyJSON-RPC
Receive live account changesWebSocket
Receive program logsWebSocket
Subscribe to signaturesWebSocket

Use Solana JSON-RPC when your application needs to request blockchain state. Use WebSocket subscriptions when your application needs to receive updates continuously without repeatedly polling the RPC endpoint.

1. Set Up Your Solana RPC API Access

Before you can make any requests, you'll need an account and an API key. The whole process takes a couple of minutes:

Go to the NoLimitNodes dashboard.

Generate an API key if you haven't done so already.

You'll receive two links:

  • Solana JSON-RPC API: https://rpc.mainnet.solana.nolimitnodes.com with an x-api-key header
  • WebSocket: wss://ws.mainnet.solana.nolimitnodes.com with an x-api-key header

Treat the key like a password. Don't commit it to public repositories or ship it in client-side code.

2. Send Your First Solana JSON-RPC Request

Request Example:

curl -X POST 'https://rpc.mainnet.solana.nolimitnodes.com' \
 -H 'x-api-key: YOUR_API_KEY' \
 -H 'Content-Type: application/json' \
 -d '{
   "id": 1,
   "jsonrpc": "2.0",
   "method": "getEpochInfo"
}'

Response Example:

{
    "jsonrpc": "2.0",
    "result": {
        "absoluteSlot": 307196285,
        "blockHeight": 285572434,
        "epoch": 711,
        "slotIndex": 44285,
        "slotsInEpoch": 432000,
        "transactionCount": 347697747950
    },
    "id": 1
}

That request asks the Solana network for epoch information: the current epoch, the block height, and how many slots the epoch contains. You'll find the full method list and more examples in the official NoLimitNodes documentation.

3. Connect to the Solana WebSocket API

When you need data pushed to you instead of polled, switch to the WebSocket API. Solana WebSocket subscriptions allow applications to receive matching blockchain events through a persistent connection instead of repeatedly polling an HTTP RPC endpoint. Here's how it works.

Socket Connect

To open a connection and listen for events, grab a WebSocket client library such as websockets for Python. A minimal example:

import asyncio
import websockets
import json

async def connect_to_socket():
    async with websockets.connect('wss://ws.mainnet.solana.nolimitnodes.com', additional_headers={'x-api-key': 'YOUR_API_KEY'}) as websocket:
        # Subscribe to logs subscription event
        await websocket.send(json.dumps({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "logsSubscribe",
            "params": [
                {
                    "mentions": [
                        "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" # target account address (pump.fun)
                    ]
                },
                {
                    "commitment": "finalized"
                }
            ]
        }))

        while True:
            message = await websocket.recv()
            print(f"Received message: {message}")

asyncio.run(connect_to_socket())

Socket Response:


Received message: {"jsonrpc":"2.0","result":131089,"id":1}
Received message: {"jsonrpc":"2.0","method":"logsNotification","params":{"result":{"context":{"slot":307199168},"value":{"signature":"4mVmSvqxP3vMsPAnLpwo8sdNXCz9P9E5VfBaejW5XiEv2k8tP1voMJ97jHYAm6TwyNsoT23BHtq2PVNEbrhMvPU5","err":null,"logs":["Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]","Program log: CreateIdempotent","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]","Program log: Instruction: GetAccountDataSize","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1569 of 141295 compute units","Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program 11111111111111111111111111111111 invoke [2]","Program 11111111111111111111111111111111 success","Program log: Initialize the associated token account","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]","Program log: Instruction: InitializeImmutableOwner","Program log: Please upgrade to SPL Token 2022 for immutable owner support","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 134708 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]","Program log: Instruction: InitializeAccount3","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4188 of 130826 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 23345 of 149700 compute units","Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success","Program BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW invoke [1]","Program log: Instruction: PumpBuy","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [2]","Program log: Instruction: Buy","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]","Program log: Instruction: Transfer","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 81002 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program 11111111111111111111111111111111 invoke [3]","Program 11111111111111111111111111111111 success","Program 11111111111111111111111111111111 invoke [3]","Program 11111111111111111111111111111111 success","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [3]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2003 of 68914 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success","Program data: vdt/007mYe7vni0Y3HOmbSJC8omPPDs8SozaJdCIQMmNMUndPgb8b8XzolcAAAAA7aRIYiolAAABOIcGSKDiS7MC+BPzjFpQtnY9LZb/h0OkbdQvlI2BJ9ySC1xnAAAAAF4NyBgIAAAAdaQgEOBJAwBeYaQcAQAAAHUMDsROSwIA","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 43461 of 108647 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success","Program 11111111111111111111111111111111 invoke [2]","Program 11111111111111111111111111111111 success","Program BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW consumed 64332 of 126355 compute units","Program BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW success","Program 11111111111111111111111111111111 invoke [1]","Program 11111111111111111111111111111111 success"]}},"subscription":131089}}
Received message: {"jsonrpc":"2.0","method":"logsNotification","params":{"result":{"context":{"slot":307199168},"value":{"signature":"5ZtAiTZk4fp1gv8UdXoebN6zhkeE1gikQRzdNgbtbKybUvsu3yRAvgzU477BSi5D4CNegC5Gmap26h7cPf2MaeKu","err":null,"logs":["Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [1]","Program log: Instruction: Sell","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]","Program log: Instruction: Transfer","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 13469 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [2]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2003 of 5339 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success","Program data: vdt/007mYe6LLgf/8UglPDo1BzbCIWxaLglw1QU2SvCuHU80QlxS3wHo7GUAAAAAAADz3qcrAAAAT0PtN2jG/xFfX7j9n7Poz6CNQrmv3iG8ELAHwe3PPDmSC1xnAAAAAHIxJbAHAAAATaBBKKJ2AwByhQG0AAAAAE0IL9wQeAIA","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 31918 of 33528 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success"]}},"subscription":131089}}
Received message: {"jsonrpc":"2.0","method":"logsNotification","params":{"result":{"context":{"slot":307199168},"value":{"signature":"37XZJs8ZNK7KmYtTmKm1aYYJ1puCTuuRRdCRxLrPaZ7ETyqz1foqk9jRDq2xvCbQopkWuiEcQAfbgfGjpv4AKJtQ","err":null,"logs":["Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [1]","Program log: Instruction: Sell","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]","Program log: Instruction: Transfer","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 281141 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [2]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2003 of 273011 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success","Program data: vdt/007mYe45jktOv8WjKQPx3/rvsL1pqXMsXHOlBS7RBwg2xV1nj78cgAMAAAAAOPweIecBAAAAsqHJL+d5ddJWK4t9Zp9ndVn69URNKD2ANfrK99W+7pqSC1xnAAAAAB9w7f0GAAAAvRmgs+nOAwAfxMkBAAAAAL2BjWdY0AIA","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 30418 of 299700 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]","Program log: Instruction: CloseAccount","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2916 of 269282 compute units","Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success","Program 11111111111111111111111111111111 invoke [1]","Program 11111111111111111111111111111111 success","Program 11111111111111111111111111111111 invoke [1]","Program 11111111111111111111111111111111 success"]}},"subscription":131089}}

The script subscribes to the logs subscription event, which pushes a message every time new logs are finalized on the Solana network. The loop then receives and prints each incoming message.

4. Solana RPC API Best Practices

  • Secure your API key: keep it out of public code repositories and client-facing applications.
  • Use the appropriate methods: follow the official documentation for both the Solana JSON-RPC over HTTP and WebSocket APIs so you stay clear of rate limits and get stable performance.
  • Test with a small subset of data: verify your requests and socket subscriptions against a small slice of data first, before pointing real traffic at them.

For further details and examples, visit the official NoLimitNodes documentation.

That's the whole integration: Solana JSON-RPC for queries, WebSockets for live updates, one key for both. From here you can wire NoLimitNodes into your Solana application and spend your time on the product rather than the plumbing.

#solana#rpc#tutorial
N
NoLimitNodes Team
Community & Tutorials

Tutorials, market notes, and product walkthroughs from across the NoLimitNodes team.

On this page
  • 01Quick Answer
  • 02What You'll Learn
  • 03What Is a Solana RPC API?
  • 04Do You Need to Run Your Own Solana RPC Node?
  • 05Solana RPC API Endpoint
  • 06How to Secure Your Solana API Key
  • 07Solana RPC vs WebSocket
  • 081. Set Up Your Solana RPC API Access
  • 092. Send Your First Solana JSON-RPC Request
  • 103. Connect to the Solana WebSocket API
  • 114. Solana RPC API Best Practices
↑ back to top
///Read next
GuidesApr 10, 2025

Solana RPC Node Setup & Best Practices: A Complete Guide with NoLimitNodes

Every Solana application, from a weekend dApp to a service handling thousands of users per second, talks to the chain through the same kind of gateway: an RPC node.

#solana#rpc#tutorial
3 min read
EcosystemJun 4, 2025

How NoLimitNodes Became the Best Solana RPC Provider in 2025

Solana applications live or die on their RPC layer. Once a dApp scales and users expect real-time responsiveness, plain access to the chain isn't enough; you need fast, secure, and scalable RPC infrastructure behind it.

#solana#rpc#rpc provider
3 min read
///Relevant Solana infrastructure
Solana RPC Nodes

Private JSON-RPC endpoints for reads, transactions, and application backends.

Explore Solana RPC Nodes →
Newer →
Pump.Fun WebSocket: Build a Real-Time Crypto Trading Bot with NoLimitNodes Price Data
Run it yourself

Every benchmark in this blog runs against our public endpoints.

Spin up an RPC, WebSocket, or gRPC endpoint in under a minute. Flat pricing, no request caps. Reproduce the numbers for your own workload.

See pricing

Ready to get started?

Choose a plan and start building in under 30 seconds.

Talk to Sales
NoLimitNodes

Solana RPC infrastructure built for performance and scale.

RPC Access
  • Solana HTTP RPC nodes
  • Solana WebSocket nodes
  • Yellowstone gRPC nodes
  • Solana Shredstream
  • UltraSend transaction relay
Infrastructure
  • Compute Platform
  • VPS
  • VDS
  • Bare Metal
  • Geyser Plugin Hosting
Enhanced Streams
  • PumpFun
  • PumpSwap
  • Raydium
  • Orca
  • Meteora
  • System Events
  • Browse all Solana Enhanced Streams →
Program Streams
  • PumpFun
  • PumpSwap
  • Raydium CLMM
  • Orca Whirlpool
  • Meteora DLMM
  • Jupiter Swap
  • Jupiter Perps
  • Kamino Lending
  • Browse all 37 Solana programs →
Trading
  • EZWallet
Analytics
  • Historical Datasets
  • Historical Raw Blocks
Company
  • About
Resources
  • Pricing
  • RPC Rate Limits
  • Custom Development
  • Documentation
  • Blog
  • System Status
  • Support
  • Contact Sales
Compare
  • Yellowstone gRPC vs LaserStream
  • Triton vs Helius
  • Raydium API vs Helius
  • PumpSwap API vs Bitquery
  • QuickNode Streams vs NLN
  • All comparisons →
Legal
  • Terms & Conditions
  • Privacy Policy
© 2026 CLR3 Inc., operating as NoLimitNodes. Registered in Ontario, Canada. All rights reserved.solana mainnet