Get Balance
This endpoint allows you to check your remaining balance for RoSolve services.
Request
Below is a Python example demonstrating how to implement the get_balance
function:
python
from util import Util
from curl_cffi import requests
config = Util.get_config()
SOLVER_KEY = config["solverKey"]
def get_balance(key):
session = requests.Session()
response = session.get(f"https://rosolve.pro/getBalance?key={key}").json()
balance = response["balance"]
return balance
Parameters
key (string): Your RoSolve API key
Response
json
{
"balance": 100,
"key": "Key would be here"
}
Example Usage
python
balance = get_balance(SOLVER_KEY)
print(f"Current balance: {balance}")