JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.data.operations.exportTransactions({
type: "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING",
firstDate: "2023-05-01",
lastDate: "2023-05-02",
options: {
includeChains: [
"p-chain",
],
},
});
console.log(result);
}
run();curl --request POST \
--url https://glacier-api.avax.network/v1/operations/transactions:export \
--header 'Content-Type: application/json' \
--header 'x-glacier-api-key: <api-key>' \
--data '
{
"type": "TRANSACTION_EXPORT_EVM",
"options": {
"addresses": [
"<string>"
],
"includeChains": [
"<string>"
]
},
"firstDate": "<string>",
"lastDate": "<string>",
"startDate": "<string>",
"endDate": "<string>"
}
'import requests
url = "https://glacier-api.avax.network/v1/operations/transactions:export"
payload = {
"type": "TRANSACTION_EXPORT_EVM",
"options": {
"addresses": ["<string>"],
"includeChains": ["<string>"]
},
"firstDate": "<string>",
"lastDate": "<string>",
"startDate": "<string>",
"endDate": "<string>"
}
headers = {
"x-glacier-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/operations/transactions:export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'TRANSACTION_EXPORT_EVM',
'options' => [
'addresses' => [
'<string>'
],
'includeChains' => [
'<string>'
]
],
'firstDate' => '<string>',
'lastDate' => '<string>',
'startDate' => '<string>',
'endDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-glacier-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://glacier-api.avax.network/v1/operations/transactions:export"
payload := strings.NewReader("{\n \"type\": \"TRANSACTION_EXPORT_EVM\",\n \"options\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"includeChains\": [\n \"<string>\"\n ]\n },\n \"firstDate\": \"<string>\",\n \"lastDate\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-glacier-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://glacier-api.avax.network/v1/operations/transactions:export")
.header("x-glacier-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"TRANSACTION_EXPORT_EVM\",\n \"options\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"includeChains\": [\n \"<string>\"\n ]\n },\n \"firstDate\": \"<string>\",\n \"lastDate\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/operations/transactions:export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-glacier-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"TRANSACTION_EXPORT_EVM\",\n \"options\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"includeChains\": [\n \"<string>\"\n ]\n },\n \"firstDate\": \"<string>\",\n \"lastDate\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"operationId": "<string>",
"createdAtTimestamp": 123,
"updatedAtTimestamp": 123,
"message": "<string>",
"metadata": {
"downloadUrl": "<string>",
"nextDate": "<string>"
}
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}Operations
Create transaction export operation
Trigger a transaction export operation with given parameters.
The transaction export operation runs asynchronously in the background. The status of the job can be retrieved from the /v1/operations/:operationId endpoint using the operationId returned from this endpoint.
POST
/
v1
/
operations
/
transactions:export
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche();
async function run() {
const result = await avalanche.data.operations.exportTransactions({
type: "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING",
firstDate: "2023-05-01",
lastDate: "2023-05-02",
options: {
includeChains: [
"p-chain",
],
},
});
console.log(result);
}
run();curl --request POST \
--url https://glacier-api.avax.network/v1/operations/transactions:export \
--header 'Content-Type: application/json' \
--header 'x-glacier-api-key: <api-key>' \
--data '
{
"type": "TRANSACTION_EXPORT_EVM",
"options": {
"addresses": [
"<string>"
],
"includeChains": [
"<string>"
]
},
"firstDate": "<string>",
"lastDate": "<string>",
"startDate": "<string>",
"endDate": "<string>"
}
'import requests
url = "https://glacier-api.avax.network/v1/operations/transactions:export"
payload = {
"type": "TRANSACTION_EXPORT_EVM",
"options": {
"addresses": ["<string>"],
"includeChains": ["<string>"]
},
"firstDate": "<string>",
"lastDate": "<string>",
"startDate": "<string>",
"endDate": "<string>"
}
headers = {
"x-glacier-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/operations/transactions:export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'TRANSACTION_EXPORT_EVM',
'options' => [
'addresses' => [
'<string>'
],
'includeChains' => [
'<string>'
]
],
'firstDate' => '<string>',
'lastDate' => '<string>',
'startDate' => '<string>',
'endDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-glacier-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://glacier-api.avax.network/v1/operations/transactions:export"
payload := strings.NewReader("{\n \"type\": \"TRANSACTION_EXPORT_EVM\",\n \"options\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"includeChains\": [\n \"<string>\"\n ]\n },\n \"firstDate\": \"<string>\",\n \"lastDate\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-glacier-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://glacier-api.avax.network/v1/operations/transactions:export")
.header("x-glacier-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"TRANSACTION_EXPORT_EVM\",\n \"options\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"includeChains\": [\n \"<string>\"\n ]\n },\n \"firstDate\": \"<string>\",\n \"lastDate\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/operations/transactions:export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-glacier-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"TRANSACTION_EXPORT_EVM\",\n \"options\": {\n \"addresses\": [\n \"<string>\"\n ],\n \"includeChains\": [\n \"<string>\"\n ]\n },\n \"firstDate\": \"<string>\",\n \"lastDate\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"operationId": "<string>",
"createdAtTimestamp": 123,
"updatedAtTimestamp": 123,
"message": "<string>",
"metadata": {
"downloadUrl": "<string>",
"nextDate": "<string>"
}
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}Authorizations
Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
Body
application/json
Response
Successful response
Available options:
TRANSACTION_EXPORT_PRIMARY_NETWORK, TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING, TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE, TRANSACTION_EXPORT_EVM Available options:
RUNNING, COMPLETED, COMPLETED_WITH_WARNING, FAILED Show child attributes
Show child attributes
Was this page helpful?
⌘I