The quickest way to start building on Sui with QuickNode is by sending a JSON-RPC or REST/gRPC request to your endpoint. In this quickstart, you’ll create an endpoint, copy its provider URL, and make your first request. Code samples below use cURL and common languages.
Get Your Sui Endpoint
Create a QuickNode account
Sign up here if you haven't already.
Go to your dashboard
Open the Endpoints dashboard from the left sidebar menu to manage all your blockchain endpoints
Create a new endpoint
Click Create an Endpoint in the top-right corner, select Sui as your blockchain, then select your preferred network
Copy your provider URLs
Keep the HTTP URL handy. You'll use it in your requests below.
For a detailed walkthrough of the QuickNode dashboard, check out our guide.
Send Your First Request
Your endpoint is ready. Now, let's make your first call to the Sui blockchain. We’ll use the sui_getChainIdentifier
method, which returns the chain identifier string. Select your preferred language or tool and follow the steps to send your request.
- cURL
- Node.js
- Python
Check cURL installation
Most *nix based systems have cURL support out of the box. Open your terminal and check the cURL version by running the command below:
curl --version
Get Sui chain identifier
Send a JSON-RPC request to retrieve the Sui chain identifier:
curl -X POST YOUR_QUICKNODE_ENDPOINT_URL/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"sui_getChainIdentifier","params":[],"id":1}'
Sample Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "35834a8a"
}
Set up your project
Create a directory and initialize a Node.js project:
mkdir sui-js-quickstart
cd sui-js-quickstart
npm init -y
Create app.js
Use native fetch (Node.js 18+):
const url = 'YOUR_QUICKNODE_ENDPOINT_URL/';
const payload = {
jsonrpc: '2.0',
method: 'sui_getChainIdentifier',
params: [],
id: 1,
};
async function main() {
const res = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
const data = await res.json();
console.log('Chain Identifier:', data.result);
}
main().catch(console.error);
Run
Execute your script:
node app.js
Set up your project
Create a new directory for your Python project:
mkdir sui-python-quickstart
cd sui-python-quickstart
Create and activate a virtual environment
Create a virtual environment to manage dependencies:
python3 -m venv venv
source venv/bin/activate
Install requests
Install the requests library for making HTTP requests:
pip install requests
Create a Python script (app.py)
Create a Python file with the following code:
import requests
import json
endpoint_url = "YOUR_QUICKNODE_ENDPOINT_URL/"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getChainIdentifier",
"params": []
}
response = requests.post(endpoint_url, json=payload)
result = response.json()
print("Chain Identifier:", result.get("result"))
Run the script
Execute your Python script:
python app.py
If you want to continue learning about making API requests, check out our guides and sample apps.
We ❤️ Feedback!
If you have any feedback or questions about this documentation, let us know. We'd love to hear from you!