Balance
Get balance of mint & wallet
GET
/balance
Method is used to retrieve the balance for a given token for user
Headers
Parameters
Body
Response
{
"balance": 2911465.77172,
"balanceRaw": "2911465771720"
}
{
"error": true,
"message": "Token not found"
}
{
"error": true,
"message": "Wallet not found"
}
Examples
curl --location 'https://rpc.api-pump.fun/balance?token=your_token&wallet=your_wallet_address' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_api_key'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://rpc.api-pump.fun/balance?token=your_token&wallet=your_wallet_address"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", "your_api_key")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'rpc.api-pump.fun',
'path': '/balance?token=your_token&wallet=your_wallet_address',
'headers': {
'Content-Type': 'application/json',
'x-api-key': 'your_api_key'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
import requests
import json
url = "https://rpc.api-pump.fun/balance?token=your_token&wallet=your_wallet_address"
payload = {}
headers = {
'Content-Type': 'application/json',
'x-api-key': 'your_api_key'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Last updated