# getTransactionsForAddress

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://solana-mainnet.g.alchemy.com/v2/{apiKey}

Returns transaction history for a given address with advanced filtering, bidirectional sorting, and pagination. Combines the functionality of `getSignaturesForAddress` and `getTransaction` into a single call, returning up to 1,000 signatures or up to 100 full transactions per request.

Reference: https://www.alchemy.com/docs/chains/solana/solana-api-endpoints/get-transactions-for-address

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Account address | string | Yes | Base-58 encoded public key of the account to query transaction history for. |
| Configuration | object | No | Optional configuration object containing transaction detail level, sort order, limit, pagination token, commitment, encoding, and filters (slot, blockTime, signature, status, tokenAccounts). |

## Result

**Transaction history** (object): A paginated list of transactions for the address. Each entry includes the slot, transaction index, and either a signature plus metadata (when `transactionDetails` is `signatures`) or the full transaction and meta objects (when `transactionDetails` is `full`). A `paginationToken` is returned when more results are available.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "getTransactionsForAddress",
  "params": [
    "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY",
    {
      "transactionDetails": "signatures",
      "sortOrder": "desc",
      "limit": 100,
      "filters": {
        "status": "succeeded",
        "tokenAccounts": "balanceChanged"
      }
    }
  ],
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://solana-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY",
    {
      "transactionDetails": "signatures",
      "sortOrder": "desc",
      "limit": 100,
      "filters": {
        "status": "succeeded",
        "tokenAccounts": "balanceChanged"
      }
    }
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'getTransactionsForAddress',
    params: [
      '86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY',
      {
        transactionDetails: 'signatures',
        sortOrder: 'desc',
        limit: 100,
        filters: {status: 'succeeded', tokenAccounts: 'balanceChanged'}
      }
    ]
  })
};

fetch('https://solana-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://solana-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransactionsForAddress",
    "params": [
        "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY",
        {
            "transactionDetails": "signatures",
            "sortOrder": "desc",
            "limit": 100,
            "filters": {
                "status": "succeeded",
                "tokenAccounts": "balanceChanged"
            }
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://solana-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getTransactionsForAddress\",\n  \"params\": [\n    \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\",\n    {\n      \"transactionDetails\": \"signatures\",\n      \"sortOrder\": \"desc\",\n      \"limit\": 100,\n      \"filters\": {\n        \"status\": \"succeeded\",\n        \"tokenAccounts\": \"balanceChanged\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	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))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://solana-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getTransactionsForAddress\",\n  \"params\": [\n    \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\",\n    {\n      \"transactionDetails\": \"signatures\",\n      \"sortOrder\": \"desc\",\n      \"limit\": 100,\n      \"filters\": {\n        \"status\": \"succeeded\",\n        \"tokenAccounts\": \"balanceChanged\"\n      }\n    }\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://solana-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getTransactionsForAddress\",\n  \"params\": [\n    \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\",\n    {\n      \"transactionDetails\": \"signatures\",\n      \"sortOrder\": \"desc\",\n      \"limit\": 100,\n      \"filters\": {\n        \"status\": \"succeeded\",\n        \"tokenAccounts\": \"balanceChanged\"\n      }\n    }\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: getTransactionsForAddress
description: Returns transaction history for a given address with advanced filtering, bidirectional sorting, and pagination. Combines the functionality of `getSignaturesForAddress` and `getTransaction` into a single call, returning up to 1,000 signatures or up to 100 full transactions per request.
params:
  - name: Account address
    required: true
    description: Base-58 encoded public key of the account to query transaction history for.
    schema:
      title: Pubkey
      type: string
      description: Base-58 encoded public key.
  - name: Configuration
    required: false
    description: Optional configuration object containing transaction detail level, sort order, limit, pagination token, commitment, encoding, and filters (slot, blockTime, signature, status, tokenAccounts).
    schema:
      title: GetTransactionsForAddress Configuration
      type: object
      description: Optional configuration object containing additional settings for the query.
      properties:
        transactionDetails:
          type: string
          description: Level of transaction detail to return. `signatures` returns basic signature info (faster). `full` returns complete transaction data, removing the need for follow-up `getTransaction` calls (requires `limit` <= 100).
          enum:
            - signatures
            - full
          default: signatures
        sortOrder:
          type: string
          description: Sort order for results. `desc` returns newest first (default). `asc` returns oldest first (chronological order).
          enum:
            - asc
            - desc
          default: desc
        limit:
          type: integer
          description: Maximum number of transactions to return. Up to 1,000 when `transactionDetails` is `signatures`, or up to 100 when `transactionDetails` is `full`.
          default: 1000
        paginationToken:
          type: string
          description: 'Pagination token from a previous response (format: `"slot:position"`).'
        commitment:
          title: Commitment Level
          type: string
          description: Commitment level. Only `finalized` or `confirmed` are supported; `processed` is not supported.
          enum:
            - processed
            - confirmed
            - finalized
          default: finalized
        minContextSlot:
          title: Minimum Context Slot
          type: integer
          description: The minimum slot that the request can be evaluated at.
        encoding:
          type: string
          description: Encoding format for transaction data (only applies when `transactionDetails` is `full`).
          enum:
            - json
            - jsonParsed
            - base64
            - base58
        maxSupportedTransactionVersion:
          type: integer
          description: The maximum transaction version to return. If omitted, only legacy transactions are returned. Set to `0` to include all versioned transactions.
        filters:
          title: GetTransactionsForAddress Filters
          type: object
          description: Advanced filtering options for narrowing down results.
          properties:
            slot:
              type: object
              description: 'Filter by slot number using comparison operators: `gte`, `gt`, `lte`, `lt`.'
              properties:
                gte:
                  type: integer
                  description: Include slots greater than or equal to this value.
                gt:
                  type: integer
                  description: Include slots strictly greater than this value.
                lte:
                  type: integer
                  description: Include slots less than or equal to this value.
                lt:
                  type: integer
                  description: Include slots strictly less than this value.
            blockTime:
              type: object
              description: 'Filter by Unix timestamp using comparison operators: `gte`, `gt`, `lte`, `lt`, `eq`.'
              properties:
                gte:
                  type: integer
                  description: Include block times greater than or equal to this Unix timestamp.
                gt:
                  type: integer
                  description: Include block times strictly greater than this Unix timestamp.
                lte:
                  type: integer
                  description: Include block times less than or equal to this Unix timestamp.
                lt:
                  type: integer
                  description: Include block times strictly less than this Unix timestamp.
                eq:
                  type: integer
                  description: Include block times exactly equal to this Unix timestamp.
            signature:
              type: object
              description: 'Filter by transaction signature using comparison operators: `gte`, `gt`, `lte`, `lt`.'
              properties:
                gte:
                  type: string
                  description: Include signatures greater than or equal to this base-58 encoded value.
                gt:
                  type: string
                  description: Include signatures strictly greater than this base-58 encoded value.
                lte:
                  type: string
                  description: Include signatures less than or equal to this base-58 encoded value.
                lt:
                  type: string
                  description: Include signatures strictly less than this base-58 encoded value.
            status:
              type: string
              description: Filter by transaction success/failure status.
              enum:
                - succeeded
                - failed
                - any
              default: any
            tokenAccounts:
              type: string
              description: Filter transactions for related token accounts. `none` returns only transactions that reference the provided address. `balanceChanged` also returns transactions that modify the balance of a token account owned by the provided address. `all` returns transactions that reference the provided address or any token account owned by it.
              enum:
                - none
                - balanceChanged
                - all
              default: none
examples:
  - name: getTransactionsForAddress example
    params:
      - name: Account address
        value: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
      - name: Configuration
        value:
          transactionDetails: signatures
          sortOrder: desc
          limit: 100
          filters:
            status: succeeded
            tokenAccounts: balanceChanged
result:
  name: Transaction history
  description: A paginated list of transactions for the address. Each entry includes the slot, transaction index, and either a signature plus metadata (when `transactionDetails` is `signatures`) or the full transaction and meta objects (when `transactionDetails` is `full`). A `paginationToken` is returned when more results are available.
  schema:
    title: GetTransactionsForAddress Result
    type: object
    description: Paginated transaction history for the queried address.
    properties:
      data:
        type: array
        description: Array of transaction entries matching the query.
        items:
          title: GetTransactionsForAddress Entry
          type: object
          description: A single transaction entry returned by `getTransactionsForAddress`.
          properties:
            signature:
              type: string
              description: The transaction signature as a base-58 encoded string. Only present when `transactionDetails` is `signatures`.
            slot:
              type: integer
              description: The slot that contains the block with the transaction.
            transactionIndex:
              type: integer
              description: The zero-based index of the transaction within its block.
            blockTime:
              type: integer
              nullable: true
              description: The estimated production time of the transaction as a Unix timestamp, null if not available.
            err:
              type: object
              nullable: true
              description: Error if the transaction failed, null if it succeeded. Only present when `transactionDetails` is `signatures`.
            memo:
              type: string
              nullable: true
              description: The memo associated with the transaction, null if no memo is present. Only present when `transactionDetails` is `signatures`.
            confirmationStatus:
              type: string
              nullable: true
              description: The transaction's cluster confirmation status. Only present when `transactionDetails` is `signatures`.
            version:
              oneOf:
                - type: string
                - type: number
              nullable: true
              description: Transaction version. Only present when `transactionDetails` is `full`.
            transaction:
              type: object
              description: Full transaction data. Only present when `transactionDetails` is `full`.
            meta:
              type: object
              nullable: true
              description: Transaction status metadata. Only present when `transactionDetails` is `full`.
      paginationToken:
        type: string
        nullable: true
        description: 'Token for fetching the next page (format: `"slot:position"`), or null if no more results.'
```
