Learn how to access XRP API.
Step 1: To access XRP, use the following native access endpoint:
- Network: XRP Mainnet
- Request Type: POST
https://svc.blockdaemon.com/xrp/mainnet/native
Step 2: You should authorize your request. Learn more: Authentication Guide
Step 3: Specify an XRP method in the request body:
{
"jsonrpc": "2.0",
"id": 1,
"method": "YOUR_METHOD",
"params": []
}
Example Request
Here is a cURL example for using ledger_current to get the unique identifier of the current in-progress ledger in XRP Mainnet:
curl -X POST \
https://svc.blockdaemon.com/xrp/mainnet/native \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "ledger_current", "params": []}'
The following is a typical response you will get:
{
"result": {
"ledger_current_index": 73876024,
"status": "success"
}
}
👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.