Get XCH Transactions
This endpoint allows you to fetch the transaction history for a given XCH address with flexible filtering options for different transaction types.
Endpoint
- Mainnet
- Testnet
GET https://api.spacescan.io/address/xch-transaction/{address}
GET https://api-testnet11.spacescan.io/address/xch-transaction/{address}
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
address | string | Yes | - | The XCH address to fetch transactions for |
count | number | No | 100 | Number of transactions to return per type |
include_send | boolean | No | true | Include sent transactions |
include_received | boolean | No | true | Include received transactions |
include_send_dust | boolean | No | false | Include dust sent transactions |
include_received_dust | boolean | No | false | Include dust received transactions |
send_cursor | number | No | null | Pagination cursor for sent transactions |
received_cursor | number | No | null | Pagination cursor for received transactions |
send_dust_cursor | number | No | null | Pagination cursor for dust sent transactions |
received_dust_cursor | number | No | null | Pagination cursor for dust received transactions |
Free API
Use api.spacescan.io
for free tier access. See our API Plans for rate limits and features.
Pro API
Use pro-api.spacescan.io
with your API key in the x-api-key
header. See our API Plans for details.
curl -X GET "https://pro-api.spacescan.io/address/xch-transaction/{address}" \
-H "x-api-key: YOUR_API_KEY"
Live API Test
- Mainnet
- Testnet
Request Examples
- cURL
- Python
- JavaScript
- Mainnet
- Testnet
# Initial request with dust transactions
curl -X GET "https://api.spacescan.io/address/xch-transaction/xch1...?include_send_dust=true&include_received_dust=true"
# Paginated request for specific transaction types
curl -X GET "https://api.spacescan.io/address/xch-transaction/xch1...?send_cursor=100&received_cursor=50"
curl -X GET "https://api-testnet11.spacescan.io/address/xch-transaction/xch1..."
- Mainnet
- Testnet
import requests
address = "xch1..."
url = f"https://api.spacescan.io/address/xch-transaction/{address}"
# Request with parameters
params = {
"include_send_dust": "true",
"include_received_dust": "true",
"count": 50
}
response = requests.get(url, params=params)
data = response.json()
print(data)
import requests
address = "xch1..."
url = f"https://api-testnet11.spacescan.io/address/xch-transaction/{address}"
response = requests.get(url)
data = response.json()
print(data)
- Mainnet
- Testnet
const address = "xch1...";
const url = `https://api.spacescan.io/address/xch-transaction/${address}`;
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const address = "xch1...";
const url = `https://api-testnet11.spacescan.io/address/xch-transaction/${address}`;
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Response
- Mainnet
- Testnet
Failed to load API response. Please try again later.
Failed to load API response. Please try again later.
Response Schema
Field | Type | Description |
---|---|---|
status | string | Success or failure status |
send_transactions.transactions | array | List of sent transactions |
send_transactions.transactions[].coin_id | string | Unique identifier for the coin |
send_transactions.transactions[].time | string | ISO timestamp of the transaction |
send_transactions.transactions[].height | number | Block height of the transaction |
send_transactions.transactions[].amount_xch | number | Amount in XCH |
send_transactions.transactions[].amount_mojo | number | Amount in mojo |
send_transactions.transactions[].to | string | Recipient address |
send_transactions.transactions[].memo | string[] | Optional memo array |
send_transactions.next_cursor | number | Cursor for next page of sent transactions |
send_transactions.total_count | number | Total count (only in initial request) |
received_transactions.transactions | array | List of received transactions |
received_transactions.transactions[].coin_id | string | Unique identifier for the coin |
received_transactions.transactions[].time | string | ISO timestamp of the transaction |
received_transactions.transactions[].height | number | Block height of the transaction |
received_transactions.transactions[].amount_xch | number | Amount in XCH |
received_transactions.transactions[].amount_mojo | number | Amount in mojo |
received_transactions.transactions[].from | string | Sender address |
received_transactions.transactions[].memo | string[] | Optional memo array |
received_transactions.next_cursor | number | Cursor for next page of received transactions |
received_transactions.total_count | number | Total count (only in initial request) |
send_dust_transactions | object | Same structure as send_transactions (only if include_send_dust=true) |
received_dust_transactions | object | Same structure as received_transactions (only if include_received_dust=true) |
Notes
- Each transaction type can be paginated independently
- Dust transactions are excluded by default and must be explicitly requested
- The response will only include the transaction types that were requested