import requests
url = "https://api.xsolve.me/balance"
headers = {
"X-Api-Key": "<x-api-key>"
}
response = requests.get(url, headers=headers)
print(response.json()) curl --request GET \
--url https://api.xsolve.me/balance \
--header 'X-Api-Key: <x-api-key>' const url = 'https://api.xsolve.me/balance';
const headers = {
'X-Api-Key': '<x-api-key>'
};
fetch(url, {
method: 'GET',
headers: headers
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error)); package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.xsolve.me/balance"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("X-Api-Key", "<x-api-key>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
} import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("https://api.xsolve.me/balance");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("X-Api-Key", "<x-api-key>");
try (BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), "utf-8"))) {
StringBuilder response = new StringBuilder();
String responseLine = null;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
} use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let res = client.get("https://api.xsolve.me/balance")
.header("X-Api-Key", "<x-api-key>")
.send()
.await?
.json::<HashMap<String, serde_json::Value>>()
.await?;
println!("{:#?}", res);
Ok(())
} Headers
Service API Key
Compatibility balance endpoint
If you are migrating from CapSolver or Solverify-style clients, you can also call POST /getBalance with clientKey.
curl --request POST \
--url https://api.xsolve.me/getBalance \
--header 'Content-Type: application/json' \
--data '{
"clientKey": "<x-api-key>"
}'
{
"errorId": 0,
"balance": 10.5,
"requests": 131250
}
Response
{
"balance": "12522",
"threads": "150",
"active_threads": "0",
"success": true
} {
"message": "An error occurred",
"success": false
} {
"message": "An error occurred",
"success": false
}