Get wallet transaction history
https://api.triport.io/v1/polygon/wallet/history/0x0000000000000000000000000000000000001010?limit=2Returns a paginated list of recent transactions for a Polygon address, newest first, with cursor-based paging.
Fetches the transaction history for a single Polygon (PoS) address. Each entry is a
PolyTransactionSummary — a compact view of an on-chain
transaction (hash, block, counterparties, value, gas, and final status). Results are
ordered newest-first.
The endpoint supports two ways to page through a long history. For simple paging,
use limit + offset. For stable, drift-free paging over an actively-growing
history, prefer the cursor form: pass the hash of the last item you saw as the
before query parameter to request the page of transactions that come before it.
Cursor paging avoids the duplicate/skip problems that offset can hit when new
transactions land between requests.
This is a basic-tier operation. Free-tier keys are accepted for authentication but
will receive 403 tier_insufficient.
Parameters
Path parameters
addressstringrequired0x-prefixed, 40 hex chars (Ethereum-compatible format). E.g. 0x0000000000000000000000000000000000001010.Query parametersobjectbeforestringoptionalhash of the last item from the previous page.limitintegeroptional1–1000. Default 50.offsetintegeroptional≥ 0. Default 0. Ignored in favor of before when a cursor is supplied.Response
Response fields
| Field | Type | Description |
|---|---|---|
address | string | The address the history was queried for (echoed back). |
items | array | Page of transaction summaries, newest-first. |
items[].hash | string | Transaction hash. Use as the before cursor for the next page. |
items[].block_number | integer (int64) | Block height the transaction was included in. |
items[].block_hash | string | Hash of the including block. |
items[].block_time | integer (int64) | Block timestamp, UNIX seconds. |
items[].from | string | Sender address. |
items[].to | string | null | Recipient address; null for contract-creation transactions. |
items[].value_wei | string | Native MATIC value transferred, in wei (decimal string, u256-safe). |
items[].gas_used | integer (int64) | Gas consumed by the transaction. |
items[].gas_price_wei | string | Effective gas price, in wei (decimal string). |
items[].status | string | One of success, reverted, pending. |
pagination.limit | integer | Page size applied (1–1000). |
pagination.offset | integer | Offset applied. |
pagination.total | integer | Total rows available. May be absent when too expensive to compute. |
Per-transaction fields hash, block_number, and from are always present; the
remaining fields may be omitted when not applicable.
Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthorized / trial_expired / subscription_expired | Missing or invalid credentials, or the key's trial/subscription has ended. |
403 | tier_insufficient / method_unknown | Key is below the required basic tier, or the method isn't part of the key's product. |
429 | rate_limited | Sustained RPS for the polygon_wallet category exceeded. Honor the Retry-After header. |
All errors use the shared envelope (error, message, request_id). See
errors.md for the full envelope and per-code fields. Rate-limit
responses also carry X-RateLimit-Limit, X-RateLimit-Remaining,
X-RateLimit-Reset, and X-RateLimit-Category headers.
Examples
JavaScript (fetch)
const address = "0x0000000000000000000000000000000000001010";
const url = new URL(`https://api.triport.io/v1/polygon/wallet/history/${address}`);
url.searchParams.set("limit", "50");
const res = await fetch(url, {
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
});
if (!res.ok) throw new Error(`${res.status} ${(await res.json()).error}`);
const page = await res.json();
// Cursor paging: request the next page using the last hash seen.
const last = page.items.at(-1);
if (last) url.searchParams.set("before", last.hash);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const page = await client.polygon.wallet.history({
address: "0x0000000000000000000000000000000000001010",
limit: 50,
});
// Fetch the following page via the tx-hash cursor.
const last = page.items.at(-1);
const next = last
? await client.polygon.wallet.history({
address: "0x0000000000000000000000000000000000001010",
limit: 50,
before: last.hash,
})
: null;Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
address = "0x0000000000000000000000000000000000001010"
page = client.polygon.wallet.history(address=address, limit=50)
# Cursor paging through the full history.
while page.items:
for tx in page.items:
print(tx.hash, tx.status, tx.value_wei)
page = client.polygon.wallet.history(
address=address, limit=50, before=page.items[-1].hash
)Notes
- Cursor vs. offset:
beforeis the recommended pager. Because new transactions are prepended as they confirm, plainoffsetpaging can repeat or skip rows on a live address; cursor paging anchored on a tx hash is stable. - End of history: keep paging until
itemscomes back empty. pagination.totalis best-effort and may be omitted for addresses where a full count is too expensive to compute — don't rely on it for loop termination.- Native value only:
value_weiis the native MATIC transfer amount. For ERC-20 balances use wallet-tokens; for NFTs use wallet-nfts. For the current native balance see wallet-balance.