Ripple (XRP)
General Information
Get Node Information
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/info \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/info HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/info",
"mxrpod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mxrpod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"info"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/info');
$request->setMxrpod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/info")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,info", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/info")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"height": 56648556,
"best_block_hash": "C59D75A4863E1B1E8407D47F5E5B13D220F1E7C342828CABC05D502339477431",
"txs_count": 728130,
"synced": true
}
}
Info
General information about a blockchain is available by GET-ing the base resource.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/info
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet/testnet) |
The returned object contains a litany of information about the blockchain, including its height, the hash of the latest block and more.
Get Block By Hash
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"mxrpod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mxrpod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"blocks",
"85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd');
$request->setMxrpod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,blocks,85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"height": 56648531,
"parent_hash": "b1560e8ab49682aec25ca8873db92ddfa1d01281f93fd28ece9fac09b285f839",
"next_hash": "4770fda4c1774dfe22f8cd7af5bc1f11ce8d361f4208d2712be5a57091248522",
"transactions": 34,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 6,
"total_fees": {
"value": "0.240358",
"unit": "XRP"
},
"specific": {
"total_coins": {
"value": "99990914810381710",
"unit": "Drops"
}
}
}
}
Info
Block Hash Endpoint gives you detail information for particular block in the blockchain
HTTP Request
GET /v1/bc/xrp/${NETWORK}/blocks/${BLOCK_HASH}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet/testnet) |
BLOCK_HASH | - | Hash of the block in blockchain |
BLOCK_HASH is a string
representing the hash of the block you’re interested in querying, for example:
85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd
The returned object contains information about the block in JSON format, including its height, the fees of the transacted within it, the number of transactions in it, the total coins and more.
Get Block by Height
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/56648531 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/blocks/56648531 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/56648531",
"mxrpod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
const https = require('https');
var options = {
"mxrpod": "GET",
"hostname": "https://api.cryptoapis.io",
"path": "/v1/bc/xrp/mainnet/blocks/56648531",
"headers": {
'Content-Type': 'application/json',
'X-API-Key': 'my-api-key'
}
};
var request = https.request(options, function (response) {
response.on("data", function (data) {
console.log(data);
});
});
request.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/56648531');
$request->setMxrpod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/56648531")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,blocks,56648531", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/56648531")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/56648531"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"height": 56648531,
"parent_hash": "b1560e8ab49682aec25ca8873db92ddfa1d01281f93fd28ece9fac09b285f839",
"next_hash": "4770fda4c1774dfe22f8cd7af5bc1f11ce8d361f4208d2712be5a57091248522",
"transactions": 34,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 17,
"total_fees": {
"value": "0.240358",
"unit": "XRP"
},
"specific": {
"total_coins": {
"value": "99990914810381710",
"unit": "Drops"
}
}
}
}
Info
Block Height Endpoint gives you detailed information for particular block in the blockchain
HTTP Request
GET /v1/bc/xrp/${NETWORK}/blocks/${BLOCK_HEIGHT}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet/testnet) |
BLOCK_HEIGHT | - | Height of the block in blockchain |
BLOCK_HEIGHT is an integer
representing the height of the block you’re interested in querying, for example:
56648531
The returned object contains information about the block in JSON format, including its height, the total amount of fees transacted within it, the number of transactions in it and more.
Get Latest Block
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/latest \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/blocks/latest HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/latest",
"mxrpod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mxrpod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"port": "8021",
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"blocks",
"latest"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/latest');
$request->setMxrpod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/latest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,blocks,latest", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/latest")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/blocks/latest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"hash": "35fce4485d921d76914c56e09d976030d86235f61c0cf235bf92ff2fb9281bf6",
"height": 56648553,
"parent_hash": "9a5351f0e2c8190fd4cd68b0033585653b7e83b92bba5179a46141e6b4ba7235",
"transactions": 43,
"timestamp": 1594108400,
"datetime": "2020-07-07 07:53:20 UTC",
"confirmations": 1,
"total_fees": {
"value": "0.006035",
"unit": "XRP"
},
"specific": {
"total_coins": {
"value": "99990914809884071",
"unit": "Drops"
}
}
}
}
Info
Latest Block Endpoint gives you detailed information for the latest block in the blockchain
HTTP Request
GET /v1/bc/xrp/${NETWORK}/blocks/latest
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet/testnet) |
The returned object contains information about the latest block in JSON format, including its height, the total amount of fees transacted within it, the number of transactions in it and more.
Addresses
Crypto APIs Address API allows you to look up information about public addresses on the blockchain, generate single-use, key pairs with corresponding addresses, based on the coin/chain resource you’ve selected for your endpoints.
If you’re new to blockchains, you can think of public addresses as similar to bank account numbers in a traditional ledger. The biggest differences:
- Anyone can generate a public address themselves (through ecdsa-secp256k1 (default) or ed25519 in Ripple). No single authority is needed to generate new addresses; it’s just public-private key cryptography.
- Public addresses are significantly more lightweight. Consequently, and unlike traditional bank accounts, you can (and should!) generate new addresses for every transaction.
In Ripple an address refers to a specific XRP Ledger account. It is a base-58 encoding of a hash of the account's public key. There are two kinds of addresses in common use:
- Classic Address - A classic address encodes a hash of the account's public key and a checksum. It has no other data. This kind of address always starts with the lowercase letter r.
- X-address - An X-address encodes a hash of the account's public key, a tag, and a checksum. This kind of address starts with the uppercase letter X if it is intended for use on the production XRP Ledger (mainnet). It starts with the uppercase letter T if it is intended for use on a test network such as Testnet or Devnet.
Get Address Details
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo",
"mxrpod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mxrpod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"testnet",
"address",
"rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo');
$request->setMxrpod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,testnet,address,rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/testnet/address/rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "testnet",
"address": "rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo",
"txs_count": 1,
"from": 0,
"to": 1,
"balance": {
"value": "1000",
"unit": "XRP"
},
"sequence": 8917615
}
}
Info
The default Address Endpoint strikes a balance between response time and data on Addresses. It returns information about the balance (in XRP) and transactions of a specific address.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/address/${ADDRESS}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet/testnet) |
ADDRESS | ------- | Address in blockchain |
ADDRESS is a string representing the public address you’re interested in querying, for example:
rE7mEZQTkxWZb73LaAPtwLUSMFn7N7xwzo
The returned object contains information about the address, including its balance in XRP and the number of transactions associated with it. The endpoint omits any detailed transaction information, but if that isn’t required by your application, then it’s the fastest and preferred way to get public address information.
Get Transactions By Address
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"address",
"rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR",
"transactions"
],
"qs": {
"index": 1,
"limit": 3
},
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
querystring = {"index": 1, "limit": 3}
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,address,rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR,transactions", headers=headers, params=querystring))
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR/transactions?index=1&limit=3"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"meta": {
"index": 1,
"limit": 3,
"totalCount": 89393,
"results": 3
},
"payload": [
{
"chain": "mainnet",
"hash": "8f16891aaedc3fc0a1ded9d7a126ed7f1fa201b77191189c42be0e2d56206cab",
"block_height": 56627431,
"block_hash": "802b399933808d7c3ca3526203046e4712a0104cd224769ac7f0e2425869f28e",
"from": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR",
"index": 4,
"timestamp": 1594030061,
"datetime": "2020-07-06 10:07:41 UTC",
"confirmations": 21142,
"status": "tesSUCCESS",
"sequence": 40749550,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "3513.193601923257",
"unit": "CNY"
},
"receive": {
"value": "3140.397066",
"unit": "XRP"
}
}
},
{
"chain": "mainnet",
"hash": "9ac992af5a7ad23c36a0a40f4a0fe593f00f78881a8036e7bca9a7f7241091b5",
"block_height": 56627431,
"block_hash": "802b399933808d7c3ca3526203046e4712a0104cd224769ac7f0e2425869f28e",
"from": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR",
"index": 2,
"timestamp": 1594030061,
"datetime": "2020-07-06 10:07:41 UTC",
"confirmations": 21142,
"status": "tesSUCCESS",
"sequence": 40749548,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "9245.803595811452",
"unit": "CNY"
},
"receive": {
"value": "7700.28033",
"unit": "XRP"
}
}
},
{
"chain": "mainnet",
"hash": "67ded00844ba4c5f0971aec19badfc1100899915e2288ee9557d2c041ab6c38b",
"block_height": 56627431,
"block_hash": "802b399933808d7c3ca3526203046e4712a0104cd224769ac7f0e2425869f28e",
"from": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR",
"index": 3,
"timestamp": 1594030061,
"datetime": "2020-07-06 10:07:41 UTC",
"confirmations": 21142,
"status": "tesSUCCESS",
"sequence": 40749549,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "15063.78888117442",
"unit": "CNY"
},
"receive": {
"value": "12989.272215",
"unit": "XRP"
}
}
}
]
}
Info
The Address Transactions Endpoint returns all information available about a particular address, including an array of complete transactions.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/address/${ADDRESS}/transactions?index=${INDEX}&limit=${LIMIT}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet/testnet) |
ADDRESS | ------- | Address in blockchain |
INDEX | 0 | start from |
LIMIT | ------- | limit up to n transactions |
Meta Response
Variable | Type | Description |
---|---|---|
totalCount | int | Total count of the items in the listing for the given criteria |
index | int | Sequential index number of the items list start position (depends on the skip parameter) for the given criteria |
limit | int | Limit number of the items list (depends on the limit parameter) for the given criteria. |
results | int | Count of the items listed in the current response for the given criteria |
ADDRESS is a string representing the public address you’re interested in querying, for example:
rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR
INDEX is an integer
representing the order of the transaction, for example:
1
LIMIT is an integer
representing limit for transactions, for example:
3
Generate Address
Sample Data
curl -X POST https://api.cryptoapis.io/v1/bc/xrp/mainnet/address \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
-d '{
"tag" : 111
}'
POST /v1/bc/xrp/mainnet/address HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
{
"tag" : 111,
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/address",
"mxrpod": "POST",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
},
"processData": false,
"data": "{\n\t\"tag\" : 111\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mxrpod": "POST",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"address"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ tag: 111 }));
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/address');
$request->setMxrpod(HTTP_METH_POST);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
$request->setBody('{
"tag": 111
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/address")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"tag\" : 111\n}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
payload = "{\n\t\"tag\" : 111\n}"
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("POST", "v1,bc,xrp,mainnet,address", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(mediaType, "{\n\t\"tag\" : 111\n}");
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/address")
.post(null)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/address"
payload := strings.NewReader("{\n\t\"tag\" : 111\n}")
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"x_address": "XVhkDUe28dy22i5whPVaUwH6uYTUqi3mBDBYwsg2CcYsRs8",
"classic_address": "rBo77Ua9BbwbiTLkbDjjg361XN69tgVAvz",
"secret": "sndfbz5Hypjbdr134MQLkTqnDrABw",
"tag": 111
}
}
Info
The Generate Address endpoint allows you to generate XAddress-secret key-pairs along with the deprecated classic address. No information is required with this POST request.
You are advised to use XAddress for Ripple calls
HTTP Request
POST /v1/bc/xrp/${NETWORK}/address
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
NETWORK | string | Yes | Network name (mainnet/testnet) |
classic_address | string | Yes | Classic address |
tag | integer | No | Tag to encode in the XAddress (must be between -9223372036854775808 and 4294967295 inclusive) |
The returned object contains a secret, an XAddress, and a classic address.
Generate X Address with Tag
Sample Data
curl -X POST https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/tag \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
-d '{
"classic_address" : "rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP",
"tag" : 12
}'
POST /v1/bc/xrp/mainnet/address/tag HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
{
"classic_address" : "rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP",
"tag" : 12,
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/tag",
"mxrpod": "POST",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
},
"processData": false,
"data": "{\n\t\"classic_address\" : \"rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP\", \"tag\" : 12\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mxrpod": "POST",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"address",
"tag"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ classic_address: 'rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP', tag: 12 }));
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/tag');
$request->setMxrpod(HTTP_METH_POST);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
$request->setBody('{
"classic_address" : "rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP", "tag": 12
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/tag")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"classic_address\" : \"rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP\", \"tag\" : 12\n}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
payload = "{\n\t\"classic_address\" : \"rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP\", \"tag\" : 12\n}"
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("POST", "v1,bc,xrp,mainnet,address,tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(mediaType, "{\n\t\"classic_address\" : \"rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP\", \"tag\" : 12\n}");
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/tag")
.post(null)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/address/tag"
payload := strings.NewReader("{\n\t\"classic_address\" : \"rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP\", \"tag\" : 12\n}")
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"x_address": "XVsJoE7qxApTpGKW3ZTuEjvaRziQdVw91UMmSUcCx3Vxfko",
"classic_address": "rBM1m86z2bQXpocFj5gPWuF2HTyZ6vXFNP",
"tag": 12
}
}
Info
The Generate Address with Tag endpoint allows you to derive XAddress from a Classic Address (and optionally a tag).
You are advised to use XAddress for Ripple calls
HTTP Request
POST /v1/bc/xrp/${NETWORK}/address/tag
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
NETWORK | string | Yes | Network name (mainnet/testnet) |
classic_address | string | Yes | Classic address |
tag | integer | No | Tag to encode in the XAddress (must be between -9223372036854775808 and 4294967295 inclusive) |
The returned object contains a secret, an XAddress, and a classic address.
Transactions
Get Transaction By Hash
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"xrp",
"bc",
"mainnet",
"txs",
"hash",
"2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,txs,hash,2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/hash/2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"hash": "2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 1,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 112,
"status": "tesSUCCESS",
"sequence": 9108758,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "16414.192024",
"unit": "XRP"
},
"receive": {
"value": "22715.27205884426",
"unit": "CNY"
}
}
}
}
Info
The Transaction Hash Endpoint returns detailed information about a given transaction based on its hash.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/txs/hash/${TX_HASH}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet/testnet) |
TX_HASH | - | Hash of the transaction in blockchain |
TX_HASH is a string
representing the hash of the block you’re interested in querying, for example:
2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae
(mainnet)
The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.
Transactions Index by Index, Limit and Block Number
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"txs",
"block",
"56648531"
],
"qs": {
"index": 0,
"limit": 4
},
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
querystring = {"index": 0, "limit": 4}
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,txs,block,56648531", headers=headers, params=querystring)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531?index=0&limit=4"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"meta": {
"index": 0,
"limit": 4,
"totalCount": 34,
"results": 4
},
"payload": [
{
"chain": "mainnet",
"hash": "2cbc41c7ccb5c5f6f36e1bceebf45495c0c4d219a61185b8097805d227756a61",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 0,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 128,
"status": "tesSUCCESS",
"sequence": 9108757,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "11671.876799",
"unit": "XRP"
},
"receive": {
"value": "15673.92991654571",
"unit": "CNY"
}
}
},
{
"chain": "mainnet",
"hash": "2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 1,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 128,
"status": "tesSUCCESS",
"sequence": 9108758,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "16414.192024",
"unit": "XRP"
},
"receive": {
"value": "22715.27205884426",
"unit": "CNY"
}
}
},
{
"chain": "mainnet",
"hash": "abd2e8fa18fb81b43f37582d1c15579d09e9ab2186a68ac3d49f0871b565702c",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 2,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 128,
"status": "tesSUCCESS",
"sequence": 9108759,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "17882.996069",
"unit": "XRP"
},
"receive": {
"value": "25481.12344021094",
"unit": "CNY"
}
}
},
{
"chain": "mainnet",
"hash": "ad5acff333f8177f19e21b1c1287b939e0a7ee818ff4591722eea965981fba40",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 3,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 128,
"status": "tesSUCCESS",
"sequence": 9108760,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "4565.065034",
"unit": "XRP"
},
"receive": {
"value": "6691.837532737564",
"unit": "CNY"
}
}
}
]
}
Info
The Transaction Index Endpoint by Index, Limit and Block Number returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined . In the example above index is 0 and limit is 4, therefore the response will be an array of 4 transactions starting from index 0. The highest number for the limit is 50.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/txs/block/${BLOCK_NUMBER}?index=${TX_INDEX}&limit=${LIMIT}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (e.g. testnet or mainnet) |
TX_INDEX | ------- | Index - start from |
LIMIT | ------- | Limit - up to |
BLOCK_NUMBER | ------- | Block height |
Meta Response
Variable | Type | Description |
---|---|---|
totalCount | int | Total count of the items in the listing for the given criteria |
index | int | Sequential index number of the items list start position (depends on the skip parameter) for the given criteria |
limit | int | Limit number of the items list (depends on the limit parameter) for the given criteria. |
results | int | Count of the items listed in the current response for the given criteria |
TX_INDEX is a integer
representing the order of the transaction within the block, for example:
0
LIMIT is a integer
representing limit for transactions, for example:
4
BLOCK_NUMBER is a integer
representing the height of the block, for example:
56648531
Get Transaction By Transaction Index and Block Number
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531/1 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/txs/block/56648531/1 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531/1",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"txs",
"56648531",
"1"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531/1');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531/1")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,txs,56648531,1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531/1")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/56648531/1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"hash": "2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 1,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 101,
"status": "tesSUCCESS",
"sequence": 9108758,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "16414.192024",
"unit": "XRP"
},
"receive": {
"value": "22715.27205884426",
"unit": "CNY"
}
}
}
}
Info
The Transaction Index Endpoint by Block Number returns detailed information about a given transaction based on its index and block height.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/txs/block/${BLOCK_NUMBER}/${TX_INDEX}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet/testnet) |
TX_INDEX | - | Index of the transaction in block |
BLOCK_NUMBER | - | Block height |
TX_INDEX is a integer
representing the order of the transaction within the block, for example:
1
BLOCK_NUMBER is a integer
representing the height of the block, for example:
56648531
The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.
Get Transaction by Transaction Index and Block Hash
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"txs",
"block",
"85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"1"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,txs,block,85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd,1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/block/85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd/1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"hash": "2905aec79d33901ceaa51f56bfd78780444a0e0db80b25117a929be72ef48dae",
"block_height": 56648531,
"block_hash": "85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd",
"from": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ",
"index": 1,
"timestamp": 1594108312,
"datetime": "2020-07-07 07:51:52 UTC",
"confirmations": 95,
"status": "tesSUCCESS",
"sequence": 9108758,
"fee": {
"value": "0.000012",
"unit": "XRP"
},
"specific": {
"type": "OfferCreate",
"offer": {
"value": "16414.192024",
"unit": "XRP"
},
"receive": {
"value": "22715.27205884426",
"unit": "CNY"
}
}
}
}
Info
The Transaction Index Endpoint by Block Hash returns detailed information about a given transaction based on its index and block hash.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/txs/block/${BLOCK_HASH}/${TX_INDEX}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet/testnet) |
TX_INDEX | ------- | Index of the transaction in block |
BLOCK_HASH | ------- | Block hash |
TX_INDEX is a integer
representing the order of the transaction within the block, for example:
1
BLOCK_HASH is a string
representing the hash of the block, for example:
85f25f2a372cce8d67064a72a152b24537be3bc5ac4c3054e13194de182b70fd
(mainnet)
The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.
Send Transactions Endpoint
Sample Data
curl -X POST \
https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/send/ \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key' \
-d '{
"hex" : "12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304"
}'
POST /v1/bc/xrp/mainnet/txs/send HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
{
"hex" : "12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304"
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/send",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
},
"processData": false,
"data": "{\n\t\"hex\" : \"12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "POST",
"hostname": "api.cryptoapis.io",
"path": "/v1/bc/xrp/mainnet/txs/send",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ hex: '12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304' }));
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/send');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
$request->setBody('{
"hex" : "12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/send")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"hex\" : \"12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304\"\n}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
payload = "{\n\t\"hex\" : \"12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304\"\n}"
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("POST", "/v1/bc/xrp/mainnet/txs/send", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"hex\" : \"12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304\"\n}");
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/send")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/send"
payload := strings.NewReader("{\n\t\"hex\" : \"12000322800000002400000017201B0086955368400000000000000C732102F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D874473045022100BDE09A1F6670403F341C21A77CF35BA47E45CDE974096E1AA5FC39811D8269E702203D60291B9A27F1DCABA9CF5DED307B4F23223E0B6F156991DB601DFB9C41CE1C770A726970706C652E636F6D81145E7B112523F68D2F5E879DB4EAC51C6698A69304\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"hash": "4D5D90890F8D49519E4151938601EF3D0B30B16CD6A519D9C99102C9FA77F7E0",
"result": "tesSUCCESS",
"message": "The transaction was applied. Only final in a validated ledger",
}
}
Transaction Send Endpoint allows users to broadcast the signed transaction to the XRP Ledger.
HTTP Request
POST /v1/bc/xrp/${NETWORK}/txs/send
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (e.g. mainnet) |
If broadcasting is successful, you’ll receive a JSON with the hash of the transaction.
Transactions Fees
Transactions Fees
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/fee \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/txs/fee HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/fee",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"txs",
"fee"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/fee');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/fee")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,txs,fee", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/fee")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/txs/fee"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"OfferCreate": {
"slow": "0.000012",
"standard": "0.000012",
"fast": "0.000151",
"unit": "XRP"
},
"Payment": {
"slow": "0.000011",
"standard": "0.000012",
"fast": "0.018596",
"unit": "XRP"
},
"OfferCancel": {
"slow": "0.000010",
"standard": "0.000082",
"fast": "0.000845",
"unit": "XRP"
},
"AccountSet": {
"slow": "0.000010",
"standard": "0.000010",
"fast": "0.000010",
"unit": "XRP"
},
"SignerListSet": {
"slow": "0.000012",
"standard": "0.000012",
"fast": "0.000012",
"unit": "XRP"
},
"TrustSet": {
"slow": "0.000012",
"standard": "0.000012",
"fast": "0.000012",
"unit": "XRP"
}
}
}
Info
Transactions Fee Endpoint gives information about the transaction cost for the successful transactions included in the last 1500 blocks.
However, it is only a suggestion and should be used at users' sole discretion.
slow
, standard
and fast
represent the slowest (25th percentile), standard (50th percentile) and fastest (75th percentile) gas price values.
All prices are in XRP.
HTTP Request
GET /v1/bc/xrp/${NETWORK}/txs/fee
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (e.g. testnet or mainnet) |
Webhook Notifications
Webhook Types
We support a number of different event types, and you can filter your notification requests depending on how you structure your Event request object.
Event | Description | |
---|---|---|
NEW_BLOCK | Triggered for every new block. The payload is a Block. | |
ADDRESS | Simplifies listening to confirmations on all transactions for a given address up to a provided threshold. The payload is a TX. If the transaction is not mined and is in the pending queue a webhook will be sent as well | |
TRANSACTION_CONFIRMATIONS | Receive confirmations for a specified address. The payload is a json object that includes the transaction hash, the address, the block number, and the current and max confirmations. |
Using Webhooks
Info
For Webhooks, the JSON Event should be sent using a POST request to the “create webhook endpoint” and include a url property to denote where payloads should be delivered. The TX or Block associated with the Event will be POSTed to the provided url. The POSTed payload will also include X-EventType and X-EventId metadata in the HTTP header specifying the event type and id of the Webhook which triggered the payload.
We retry individual payloads to your url five times; if one fails, we wait exponentially between retries: 1 second, 2s, 4s, 8s, 16s. In order to protect against stale callback urls, your Event will be deleted if it reaches 50 aggregate callback_errors from failed payloads.
A Webhook request expects a response with status code 200 (OK) or it will retry the request.
We have added a uniqueness trait to the webhook notifications to prevent unwanted duplication as follows:
- NEW_BLOCK - network
- ADDRESS - network + address + confirmations
- TRANSACTION_CONFIRMATIONS - network + address + confirmations
Create a Webhook
Using a partially filled out Event, you can create a Webhook using this resource. Check the Event object description and types of events to understand the available options.
Sample Data
curl -X POST https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
-d '{
"event" : "ADDRESS",
"url" : "http://example.com",
"confirmations": 3,
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg"
}'
POST /v1/bc/xrp/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
{
"event" : "ADDRESS",
"url" : "http://example.com",
"confirmations": 3,
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg"
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
},
"processData": false,
"data": "{ \n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://example.com\", \n\t\"confirmations\": 3, \n\t\"address\": \"rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "POST",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"hooks"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ event: 'ADDRESS',
url: 'http://example.com',
confirmations: 3,
address: 'rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg' }));
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
$request->setBody('{
"event" : "ADDRESS",
"url" : "http://example.com",
"confirmations": 3,
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{ \n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://example.com\",\n\t\"confirmations\": 3, \n\t\"address\": \"rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg\"\n}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
payload = "{ \n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://example.com\",\n\t\"confirmations\": 3, \n\t\"address\": \"rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg\"\n}"
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("POST", "v1,bc,xrp,mainnet,hooks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://example.com\",\n\t\"confirmations\": 3, \n\t\"address\": \"rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg\"\n}");
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks"
payload := strings.NewReader("{ \n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://example.com\",\n\t\"confirmations\": 3, \n\t\"address\": \"rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HTTP Request
POST /v1/bc/xrp/${NETWORK}/hooks
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (e.g. mainnet) |
Example: Event type NEW_BLOCK:
Requested data:
{
"event": "NEW_BLOCK",
"url": "http://example.com"
}
{
"event": "NEW_BLOCK",
"url": "http://example.com",
"allowDuplicate": true
}
Response:
{
"payload": {
"webhookId": "1dad485b-9794-487c-b6eb-879bdc210dde",
"uuid": "1dad485b-9794-487c-b6eb-879bdc210dde",
"active": true,
"url": "http://example.com",
"event": "NEW_BLOCK",
"created": "2020-07-07 08:34:11 UTC"
}
}
Callback Response Example
{
"webhookId": "1dad485b-9794-487c-b6eb-879bdc210dde",
"type": "NEW_BLOCK",
"blockHash": "03b21194d5218e41c5bfbd8a5bed12cf52872e22027aef2c062fcf271ba65df4",
"blockHeight": 56474204,
"currency": "XRP",
"network": "mainnet"
}
Example: Event type ADDRESS:
Requested data:
{
"event": "ADDRESS",
"url": "http://example.com",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"confirmations": 3
}
{
"event": "ADDRESS",
"url": "http://example.com",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"confirmations": 3,
"allowDuplicate": true
}
Confirmations can be any number between 1 and 100. Set to 1 means that webhooks will be sent immediately after the block that includes transactions with the specified address is mined. However, since there is the possibility of blockchain block re-write, we suggest that users set the confirmations at least to 6 (webhooks will be sent 6 blocks after the targeted block).
Response:
{
"payload": {
"webhookId": "a518116e-2a4c-46ce-ac09-d8207b3cbc01",
"uuid": "a518116e-2a4c-46ce-ac09-d8207b3cbc01",
"active": true,
"url": "http://example.com",
"confirmations": 3,
"event": "ADDRESS",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"created": "2020-07-07 08:36:13 UTC"
}
}
Callback Response Example
` { "webhookId": "a518116e-2a4c-46ce-ac09-d8207b3cbc01", "address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg", "type": "ADDRESS", "blockHeight": 56461674, "currency": "XRP", "network": "mainnet", "txHash": "fecf0498ad77f6c65f6241cfa6231f587b299872d474a24cd5f4fa4f8a86f998", "confirmations": 3, "status": "tesSUCCESS" }
`
Example: Event type TRANSACTION_CONFIRMATIONS:
Requested data:
{
"event": "TRANSACTION_CONFIRMATIONS",
"url": "http://example.com",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"confirmations": 3
}
{
"event": "TRANSACTION_CONFIRMATIONS",
"url": "http://example.com",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"confirmations": 3
"allowDuplicate": true
}
Confirmations can be any number between 1 and 100. Set to 1 means that webhooks will be sent immediately after the block that includes transactions with the specified address is mined. However, since there is the possibility of blockchain block re-write, we suggest that users set the confirmations at least to 6.
Response:
{
"payload": {
"webhookId": "0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462",
"uuid": "0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462",
"active": true,
"url": "http://example.com",
"confirmations": 3,
"event": "TRANSACTION_CONFIRMATIONS",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"created": "2020-07-07 08:41:24 UTC"
}
}
Callback Response Example
{
"webhookId": "0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"type": "TRANSACTION_CONFIRMATIONS",
"maxConfirmations": 3,
"blockHeight": 56461623,
"currentConfirmations": 1,
"currency": "XRP",
"network": "mainnet",
"txHash": "86444cf0633d0e439b783d74ceafad3ec80536d01b3817289e52e588f711ed08",
"status": "tesSUCCESS"
}
{
"webhookId": "0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"type": "TRANSACTION_CONFIRMATIONS",
"maxConfirmations": 3,
"blockHeight": 56461624,
"currentConfirmations": 2,
"currency": "XRP",
"network": "mainnet",
"txHash": "ea9eeb2ae35efa5ee9cdadd51933c64739aa0bf3cf898f9f04ccf2212b13ada3",
"status": "tesSUCCESS"
}
{
"webhookId": "0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"type": "TRANSACTION_CONFIRMATIONS",
"maxConfirmations": 3,
"blockHeight": 56461625,
"currentConfirmations": 3,
"currency": "XRP",
"network": "mainnet",
"txHash": "86444cf0633d0e439b783d74ceafad3ec80536d01b3817289e52e588f711ed08",
"status": "tesSUCCESS"
}
Get My Webhooks
List Webhook Endpoint provides a list with the webhooks for a given user id.
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/xrp/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks",
"meosod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"meosod": "GET",
"hostname": [
"api",
"cryptoapis",
"io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"hooks"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
s
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks');
$request->setMeosod(HTTP_Meos_GET);
$request->seoseaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("api,cryptoapis,io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,xrp,mainnet,hooks", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks"
req, _ := http.NewRequest("GET", urs
req.Header.Add("Content-Type", "apps
req.Header.Add("X-API-Key", "my-apis
res, _ := http.DefaultClient.Do(reqs
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)s
fmt.Println(res)
fmt.Println(string(body))
}
Response body
{
"meta": {
"index": 0,
"limit": 50,
"totalCount": 1,
"results": 1
},
"payload": [
{
"webhookId": "a518116e-2a4c-46ce-ac09-d8207b3cbc01",
"uuid": "a518116e-2a4c-46ce-ac09-d8207b3cbc01",
"active": true,
"url": "http://example.com",
"confirmations": 3,
"event": "ADDRESS",
"address": "rHbtcv6GanWzbm4NMQGuj19BjL27YBiQNg",
"created": "2020-07-07 08:36:13 UTC"
}
]
}
HTTP Request
GET /v1/bc/xrp/${NETWORK}/hooks
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet/testnet) |
Meta Response
Variable | Type | Description |
---|---|---|
totalCount | int | Total count of the items in the listing for the given criteria |
index | int | Sequential index number of the items list start position (depends on the skip parameter) for the given criteria |
limit | int | Limit number of the items list (depends on the limit parameter) for the given criteria. |
results | int | Count of the items listed in the current response for the given criteria |
Delete a Webhook
Sample Data
curl -X DELETE https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
DELETE /v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462",
"meosod": "DELETE",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"meosod": "DELETE",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"hooks",
"0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462');
$request->setMeosod(HTTP_Meos_DELETE);
$request->seoseaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("DELETE", "v1,bc,xrp,mainnet,hooks,0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462")
.delete(null)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response body
{
"payload": {
"message": "Webhook with id: 0ea83a1a-6e04-4bcc-ab5e-b0fc488d1462 was successfully deleted!"
}
}
If you want to delete a webhook just specify the id
of the webhook (the one that was returned in the JSON when creating the webhook) in the url request.
HTTP Request
DELETE /v1/bc/xrp/${NETWORK}/hooks/${WEBHOOK_UUID}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet/testnet) |
WEBHOOK_UUID | ------- | Webhook uuid |
Delete All My Webhooks
Sample Data
curl -X DELETE https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/all \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
DELETE /v1/bc/xrp/mainnet/hooks/all HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/all",
"meosod": "DELETE",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"meosod": "DELETE",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"xrp",
"mainnet",
"hooks",
"all"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/all');
$request->setMeosod(HTTP_Meos_DELETE);
$request->seoseaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/all")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("DELETE", "v1,bc,xrp,mainnet,hooks,all", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/all")
.delete(null)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/xrp/mainnet/hooks/all"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response body
{
"meta": {
"totalCount": 1,
"results": 1
},
"payload": {
"message": "All Webhooks were successfully deleted!"
}
}
TotalCount and results indicate how many Webhooks were deleted.
HTTP Request
DELETE /v1/bc/xrp/${NETWORK}/hooks/all
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet/testnet) |
This endpoint deletes all Webhooks for the specified network.