curl --request POST \
--url https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chainIds": [
123
],
"networks": [
"<string>"
],
"filter": {
"accountAddress": "<string>",
"contractAddress": "<string>",
"accountAddresses": [
"<string>"
],
"contractAddresses": [
"<string>"
],
"transactionHashes": [
"<string>"
],
"metaTransactionIDs": [
"<string>"
],
"fromBlock": 123,
"toBlock": 123,
"tokenID": "<string>",
"omitPrices": true
},
"includeMetadata": true,
"metadataOptions": {
"verifiedOnly": true,
"unverifiedOnly": true,
"includeContracts": [
"<string>"
]
},
"page": {
"page": 123,
"column": "<string>",
"before": {},
"after": {},
"sort": [
{
"column": "<string>"
}
],
"pageSize": 123,
"more": true
}
}
'import requests
url = "https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory"
payload = {
"chainIds": [123],
"networks": ["<string>"],
"filter": {
"accountAddress": "<string>",
"contractAddress": "<string>",
"accountAddresses": ["<string>"],
"contractAddresses": ["<string>"],
"transactionHashes": ["<string>"],
"metaTransactionIDs": ["<string>"],
"fromBlock": 123,
"toBlock": 123,
"tokenID": "<string>",
"omitPrices": True
},
"includeMetadata": True,
"metadataOptions": {
"verifiedOnly": True,
"unverifiedOnly": True,
"includeContracts": ["<string>"]
},
"page": {
"page": 123,
"column": "<string>",
"before": {},
"after": {},
"sort": [{ "column": "<string>" }],
"pageSize": 123,
"more": True
}
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainIds: [123],
networks: ['<string>'],
filter: {
accountAddress: '<string>',
contractAddress: '<string>',
accountAddresses: ['<string>'],
contractAddresses: ['<string>'],
transactionHashes: ['<string>'],
metaTransactionIDs: ['<string>'],
fromBlock: 123,
toBlock: 123,
tokenID: '<string>',
omitPrices: true
},
includeMetadata: true,
metadataOptions: {verifiedOnly: true, unverifiedOnly: true, includeContracts: ['<string>']},
page: {
page: 123,
column: '<string>',
before: {},
after: {},
sort: [{column: '<string>'}],
pageSize: 123,
more: true
}
})
};
fetch('https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory', 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://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory",
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([
'chainIds' => [
123
],
'networks' => [
'<string>'
],
'filter' => [
'accountAddress' => '<string>',
'contractAddress' => '<string>',
'accountAddresses' => [
'<string>'
],
'contractAddresses' => [
'<string>'
],
'transactionHashes' => [
'<string>'
],
'metaTransactionIDs' => [
'<string>'
],
'fromBlock' => 123,
'toBlock' => 123,
'tokenID' => '<string>',
'omitPrices' => true
],
'includeMetadata' => true,
'metadataOptions' => [
'verifiedOnly' => true,
'unverifiedOnly' => true,
'includeContracts' => [
'<string>'
]
],
'page' => [
'page' => 123,
'column' => '<string>',
'before' => [
],
'after' => [
],
'sort' => [
[
'column' => '<string>'
]
],
'pageSize' => 123,
'more' => true
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$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://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory"
payload := strings.NewReader("{\n \"chainIds\": [\n 123\n ],\n \"networks\": [\n \"<string>\"\n ],\n \"filter\": {\n \"accountAddress\": \"<string>\",\n \"contractAddress\": \"<string>\",\n \"accountAddresses\": [\n \"<string>\"\n ],\n \"contractAddresses\": [\n \"<string>\"\n ],\n \"transactionHashes\": [\n \"<string>\"\n ],\n \"metaTransactionIDs\": [\n \"<string>\"\n ],\n \"fromBlock\": 123,\n \"toBlock\": 123,\n \"tokenID\": \"<string>\",\n \"omitPrices\": true\n },\n \"includeMetadata\": true,\n \"metadataOptions\": {\n \"verifiedOnly\": true,\n \"unverifiedOnly\": true,\n \"includeContracts\": [\n \"<string>\"\n ]\n },\n \"page\": {\n \"page\": 123,\n \"column\": \"<string>\",\n \"before\": {},\n \"after\": {},\n \"sort\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"pageSize\": 123,\n \"more\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chainIds\": [\n 123\n ],\n \"networks\": [\n \"<string>\"\n ],\n \"filter\": {\n \"accountAddress\": \"<string>\",\n \"contractAddress\": \"<string>\",\n \"accountAddresses\": [\n \"<string>\"\n ],\n \"contractAddresses\": [\n \"<string>\"\n ],\n \"transactionHashes\": [\n \"<string>\"\n ],\n \"metaTransactionIDs\": [\n \"<string>\"\n ],\n \"fromBlock\": 123,\n \"toBlock\": 123,\n \"tokenID\": \"<string>\",\n \"omitPrices\": true\n },\n \"includeMetadata\": true,\n \"metadataOptions\": {\n \"verifiedOnly\": true,\n \"unverifiedOnly\": true,\n \"includeContracts\": [\n \"<string>\"\n ]\n },\n \"page\": {\n \"page\": 123,\n \"column\": \"<string>\",\n \"before\": {},\n \"after\": {},\n \"sort\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"pageSize\": 123,\n \"more\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainIds\": [\n 123\n ],\n \"networks\": [\n \"<string>\"\n ],\n \"filter\": {\n \"accountAddress\": \"<string>\",\n \"contractAddress\": \"<string>\",\n \"accountAddresses\": [\n \"<string>\"\n ],\n \"contractAddresses\": [\n \"<string>\"\n ],\n \"transactionHashes\": [\n \"<string>\"\n ],\n \"metaTransactionIDs\": [\n \"<string>\"\n ],\n \"fromBlock\": 123,\n \"toBlock\": 123,\n \"tokenID\": \"<string>\",\n \"omitPrices\": true\n },\n \"includeMetadata\": true,\n \"metadataOptions\": {\n \"verifiedOnly\": true,\n \"unverifiedOnly\": true,\n \"includeContracts\": [\n \"<string>\"\n ]\n },\n \"page\": {\n \"page\": 123,\n \"column\": \"<string>\",\n \"before\": {},\n \"after\": {},\n \"sort\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"pageSize\": 123,\n \"more\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"page": {
"page": 123,
"column": "<string>",
"before": {},
"after": {},
"sort": [
{
"column": "<string>",
"order": "DESC"
}
],
"pageSize": 123,
"more": true
},
"transactions": [
{
"chainId": 123,
"results": [
{
"txnHash": "<string>",
"blockNumber": 123,
"blockHash": "<string>",
"chainId": 123,
"timestamp": "<string>",
"metaTxnID": "<string>",
"transfers": [
{
"transferType": "UNKNOWN",
"contractAddress": "<string>",
"contractType": "UNKNOWN",
"from": "<string>",
"to": "<string>",
"amounts": [
"<string>"
],
"logIndex": 123,
"txnIndex": 123,
"tokenIds": [
"<string>"
],
"amountsUSD": [
"<string>"
],
"pricesUSD": [
"<string>"
],
"contractInfo": {
"chainId": 123,
"address": "<string>",
"source": "<string>",
"name": "<string>",
"type": "<string>",
"symbol": "<string>",
"logoURI": "<string>",
"deployed": true,
"bytecodeHash": "<string>",
"extensions": {
"link": "<string>",
"description": "<string>",
"categories": [
"<string>"
],
"bridgeInfo": {},
"indexingInfo": {
"useOnChainBalance": true
},
"ogImage": "<string>",
"ogName": "<string>",
"originChainId": 123,
"originAddress": "<string>",
"blacklist": true,
"verified": true,
"verifiedBy": "<string>",
"featured": true,
"featureIndex": 123
},
"contentHash": 123,
"updatedAt": "<string>",
"status": "NOT_AVAILABLE",
"decimals": 123,
"queuedAt": "<string>"
},
"tokenMetadata": {}
}
]
}
],
"errorReason": "<string>"
}
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Get transaction history
Returns mined transactions for an account across all indexed chains, including token transfers sent and received and transactions sent from the wallet.
curl --request POST \
--url https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chainIds": [
123
],
"networks": [
"<string>"
],
"filter": {
"accountAddress": "<string>",
"contractAddress": "<string>",
"accountAddresses": [
"<string>"
],
"contractAddresses": [
"<string>"
],
"transactionHashes": [
"<string>"
],
"metaTransactionIDs": [
"<string>"
],
"fromBlock": 123,
"toBlock": 123,
"tokenID": "<string>",
"omitPrices": true
},
"includeMetadata": true,
"metadataOptions": {
"verifiedOnly": true,
"unverifiedOnly": true,
"includeContracts": [
"<string>"
]
},
"page": {
"page": 123,
"column": "<string>",
"before": {},
"after": {},
"sort": [
{
"column": "<string>"
}
],
"pageSize": 123,
"more": true
}
}
'import requests
url = "https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory"
payload = {
"chainIds": [123],
"networks": ["<string>"],
"filter": {
"accountAddress": "<string>",
"contractAddress": "<string>",
"accountAddresses": ["<string>"],
"contractAddresses": ["<string>"],
"transactionHashes": ["<string>"],
"metaTransactionIDs": ["<string>"],
"fromBlock": 123,
"toBlock": 123,
"tokenID": "<string>",
"omitPrices": True
},
"includeMetadata": True,
"metadataOptions": {
"verifiedOnly": True,
"unverifiedOnly": True,
"includeContracts": ["<string>"]
},
"page": {
"page": 123,
"column": "<string>",
"before": {},
"after": {},
"sort": [{ "column": "<string>" }],
"pageSize": 123,
"more": True
}
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainIds: [123],
networks: ['<string>'],
filter: {
accountAddress: '<string>',
contractAddress: '<string>',
accountAddresses: ['<string>'],
contractAddresses: ['<string>'],
transactionHashes: ['<string>'],
metaTransactionIDs: ['<string>'],
fromBlock: 123,
toBlock: 123,
tokenID: '<string>',
omitPrices: true
},
includeMetadata: true,
metadataOptions: {verifiedOnly: true, unverifiedOnly: true, includeContracts: ['<string>']},
page: {
page: 123,
column: '<string>',
before: {},
after: {},
sort: [{column: '<string>'}],
pageSize: 123,
more: true
}
})
};
fetch('https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory', 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://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory",
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([
'chainIds' => [
123
],
'networks' => [
'<string>'
],
'filter' => [
'accountAddress' => '<string>',
'contractAddress' => '<string>',
'accountAddresses' => [
'<string>'
],
'contractAddresses' => [
'<string>'
],
'transactionHashes' => [
'<string>'
],
'metaTransactionIDs' => [
'<string>'
],
'fromBlock' => 123,
'toBlock' => 123,
'tokenID' => '<string>',
'omitPrices' => true
],
'includeMetadata' => true,
'metadataOptions' => [
'verifiedOnly' => true,
'unverifiedOnly' => true,
'includeContracts' => [
'<string>'
]
],
'page' => [
'page' => 123,
'column' => '<string>',
'before' => [
],
'after' => [
],
'sort' => [
[
'column' => '<string>'
]
],
'pageSize' => 123,
'more' => true
]
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$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://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory"
payload := strings.NewReader("{\n \"chainIds\": [\n 123\n ],\n \"networks\": [\n \"<string>\"\n ],\n \"filter\": {\n \"accountAddress\": \"<string>\",\n \"contractAddress\": \"<string>\",\n \"accountAddresses\": [\n \"<string>\"\n ],\n \"contractAddresses\": [\n \"<string>\"\n ],\n \"transactionHashes\": [\n \"<string>\"\n ],\n \"metaTransactionIDs\": [\n \"<string>\"\n ],\n \"fromBlock\": 123,\n \"toBlock\": 123,\n \"tokenID\": \"<string>\",\n \"omitPrices\": true\n },\n \"includeMetadata\": true,\n \"metadataOptions\": {\n \"verifiedOnly\": true,\n \"unverifiedOnly\": true,\n \"includeContracts\": [\n \"<string>\"\n ]\n },\n \"page\": {\n \"page\": 123,\n \"column\": \"<string>\",\n \"before\": {},\n \"after\": {},\n \"sort\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"pageSize\": 123,\n \"more\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chainIds\": [\n 123\n ],\n \"networks\": [\n \"<string>\"\n ],\n \"filter\": {\n \"accountAddress\": \"<string>\",\n \"contractAddress\": \"<string>\",\n \"accountAddresses\": [\n \"<string>\"\n ],\n \"contractAddresses\": [\n \"<string>\"\n ],\n \"transactionHashes\": [\n \"<string>\"\n ],\n \"metaTransactionIDs\": [\n \"<string>\"\n ],\n \"fromBlock\": 123,\n \"toBlock\": 123,\n \"tokenID\": \"<string>\",\n \"omitPrices\": true\n },\n \"includeMetadata\": true,\n \"metadataOptions\": {\n \"verifiedOnly\": true,\n \"unverifiedOnly\": true,\n \"includeContracts\": [\n \"<string>\"\n ]\n },\n \"page\": {\n \"page\": 123,\n \"column\": \"<string>\",\n \"before\": {},\n \"after\": {},\n \"sort\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"pageSize\": 123,\n \"more\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.polygon.technology/v1/IndexerGateway/GetTransactionHistory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainIds\": [\n 123\n ],\n \"networks\": [\n \"<string>\"\n ],\n \"filter\": {\n \"accountAddress\": \"<string>\",\n \"contractAddress\": \"<string>\",\n \"accountAddresses\": [\n \"<string>\"\n ],\n \"contractAddresses\": [\n \"<string>\"\n ],\n \"transactionHashes\": [\n \"<string>\"\n ],\n \"metaTransactionIDs\": [\n \"<string>\"\n ],\n \"fromBlock\": 123,\n \"toBlock\": 123,\n \"tokenID\": \"<string>\",\n \"omitPrices\": true\n },\n \"includeMetadata\": true,\n \"metadataOptions\": {\n \"verifiedOnly\": true,\n \"unverifiedOnly\": true,\n \"includeContracts\": [\n \"<string>\"\n ]\n },\n \"page\": {\n \"page\": 123,\n \"column\": \"<string>\",\n \"before\": {},\n \"after\": {},\n \"sort\": [\n {\n \"column\": \"<string>\"\n }\n ],\n \"pageSize\": 123,\n \"more\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"page": {
"page": 123,
"column": "<string>",
"before": {},
"after": {},
"sort": [
{
"column": "<string>",
"order": "DESC"
}
],
"pageSize": 123,
"more": true
},
"transactions": [
{
"chainId": 123,
"results": [
{
"txnHash": "<string>",
"blockNumber": 123,
"blockHash": "<string>",
"chainId": 123,
"timestamp": "<string>",
"metaTxnID": "<string>",
"transfers": [
{
"transferType": "UNKNOWN",
"contractAddress": "<string>",
"contractType": "UNKNOWN",
"from": "<string>",
"to": "<string>",
"amounts": [
"<string>"
],
"logIndex": 123,
"txnIndex": 123,
"tokenIds": [
"<string>"
],
"amountsUSD": [
"<string>"
],
"pricesUSD": [
"<string>"
],
"contractInfo": {
"chainId": 123,
"address": "<string>",
"source": "<string>",
"name": "<string>",
"type": "<string>",
"symbol": "<string>",
"logoURI": "<string>",
"deployed": true,
"bytecodeHash": "<string>",
"extensions": {
"link": "<string>",
"description": "<string>",
"categories": [
"<string>"
],
"bridgeInfo": {},
"indexingInfo": {
"useOnChainBalance": true
},
"ogImage": "<string>",
"ogName": "<string>",
"originChainId": 123,
"originAddress": "<string>",
"blacklist": true,
"verified": true,
"verifiedBy": "<string>",
"featured": true,
"featureIndex": 123
},
"contentHash": 123,
"updatedAt": "<string>",
"status": "NOT_AVAILABLE",
"decimals": 123,
"queuedAt": "<string>"
},
"tokenMetadata": {}
}
]
}
],
"errorReason": "<string>"
}
]
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Authorizations
Body
[]uint64
[]string
Represented as uint8 on the server side
MAINNETS, TESTNETS, ALL Hide child attributes
Hide child attributes
[]string
[]string
[]string
[]string
Hide child attributes
Hide child attributes
Response
OK
Hide child attributes
Hide child attributes
[]GatewayTransaction
Hide child attributes
Hide child attributes
[]Transaction
Hide child attributes
Hide child attributes
[]TxnTransfer
Hide child attributes
Hide child attributes
Represented as uint32 on the server side
UNKNOWN, SEND, RECEIVE Represented as uint8 on the server side
UNKNOWN, NATIVE, ERC20, ERC721, ERC1155, SEQUENCE_WALLET, ERC20_BRIDGE, ERC721_BRIDGE, ERC1155_BRIDGE, SEQ_MARKETPLACE, ERC6909 []string
[]string
[]string
[]string
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
[]string
Represented as uint32 on the server side
NOT_AVAILABLE, REFRESHING, AVAILABLE map<string,TokenMetadata>
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Represented as uint32 on the server side
NOT_AVAILABLE, REFRESHING, AVAILABLE []Asset
Hide child attributes
Hide child attributes
Was this page helpful?