Get transactions by account
curl --request GET \
--url https://api.chainbase.online/v1/account/txs \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.chainbase.online/v1/account/txs"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.chainbase.online/v1/account/txs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chainbase.online/v1/account/txs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.chainbase.online/v1/account/txs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.chainbase.online/v1/account/txs")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainbase.online/v1/account/txs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "ok",
"data": [
{
"type": 123,
"status": 123,
"block_number": 123,
"block_timestamp": "2023-11-07T05:31:56Z",
"transaction_hash": "<string>",
"transaction_index": 123,
"from_address": "<string>",
"to_address": "<string>",
"value": "<string>",
"input": "<string>",
"nonce": 123,
"contract_address": "<string>",
"gas": 123,
"gas_price": 123,
"gas_used": 123,
"effective_gas_price": 123,
"cumulative_gas_used": 123,
"max_fee_per_gas": 123,
"max_priority_fee_per_gas": 123,
"tx_fee": 123,
"saving_fee": 123,
"burnt_fee": 123
}
],
"next_page": 123,
"count": 123
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Basic API
Get transactions by account
Returns the transactions from the address.
GET
/
v1
/
account
/
txs
Get transactions by account
curl --request GET \
--url https://api.chainbase.online/v1/account/txs \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.chainbase.online/v1/account/txs"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.chainbase.online/v1/account/txs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chainbase.online/v1/account/txs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.chainbase.online/v1/account/txs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.chainbase.online/v1/account/txs")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainbase.online/v1/account/txs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "ok",
"data": [
{
"type": 123,
"status": 123,
"block_number": 123,
"block_timestamp": "2023-11-07T05:31:56Z",
"transaction_hash": "<string>",
"transaction_index": 123,
"from_address": "<string>",
"to_address": "<string>",
"value": "<string>",
"input": "<string>",
"nonce": 123,
"contract_address": "<string>",
"gas": 123,
"gas_price": 123,
"gas_used": 123,
"effective_gas_price": 123,
"cumulative_gas_used": 123,
"max_fee_per_gas": 123,
"max_priority_fee_per_gas": 123,
"tx_fee": 123,
"saving_fee": 123,
"burnt_fee": 123
}
],
"next_page": 123,
"count": 123
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Headers
Example:
"demo"
Query Parameters
chain network id, see list of details
A hex string referencing a wallet address
Pattern:
^0[xX]{1}[a-fA-F0-9]{40}$Inclusive from block number (hex string or int)
Inclusive to block number (hex string, int, or 'latest')
Inclusive from block number (hex string or int)
Inclusive end timestamp
The page offset
Required range:
x >= 1The desired page size limit. Less or equal than 100
Required range:
1 <= x <= 100⌘I