SearchForTransactions() Unexpected Behaviour

Hello All,

I am trying to locate a transaction, an old one.
The code piece is
st := idxClient.SearchForTransactions().MinRound(8400000) txnResps, err := st.Do(context.Background())

However, I don’t get expected output. I get the following.

GET https://testnet-algorand.api.purestake.io/idx2/v2/transactions?min-round=8400000
NextToken: hy-AAAAAAAAFAAAA
CurrentRound: 8592864
TxnLen: 1000

Nonetheless, a GET on the raw API works. It outputs a huge blob of data starting from round 8400000.

Is some function internally truncating the output to the last 1000 blocks? I tried limit but looks like it has a 10,000 max limit.
Pagination won’t work since the current round is the latest round. Please help.

Sorry, I cannot guide you third-party API providers. Algorand provide the Indexer which allows searching the entire blockchain history.

If you are searching for an old transaction why are you specifying a min round? Also do you have the txid?

This search is just saying give me transactions, starting at 840000, in chunks of 1000. Using ‘next’ and the provided ‘NextToken’ will then bring you the next 1000.

If you want specific transactions there are a number of other search parameters you can leverage:

parameters:
  - name: "sig-type"
    in: "query"
    required: false
    type: "string"
  - name: "address"
    in: "query"
    required: false
    type: "string"
  - name: "note-prefix"
    in: "query"
    required: false
    type: "string"
  - name: "round"
    in: "query"
    required: false
    type: "string"
  - name: "txid"
    in: "query"
    required: false
    type: "string"
  - name: "tx-type"
    in: "query"
    required: false
    type: "string"
  - name: "currency-greater-than"
    in: "query"
    required: false
    type: "string"
  - name: "address-role"
    in: "query"
    required: false
    type: "string"
  - name: "limit"
    in: "query"
    required: false
    type: "string"
  - name: "min-round"
    in: "query"
    required: false
    type: "string"
  - name: "asset-id"
    in: "query"
    required: false
    type: "string"
  - name: "exclude-close-to"
    in: "query"
    required: false
    type: "string"
  - name: "max-round"
    in: "query"
    required: false
    type: "string"
  - name: "rekey-to"
    in: "query"
    required: false
    type: "string"
  - name: "before-time"
    in: "query"
    required: false
    type: "string"
  - name: "currency-less-than"
    in: "query"
    required: false
    type: "string"
  - name: "after-time"
    in: "query"
    required: false
    type: "string"
  - name: "next"
    in: "query"
    required: false
    type: "string"

@JasonW I used min-round else the endpoint times out . I have the transaction ID, I’m experimenting with the SDK :slight_smile: . Will it be faster for the indexer to retrieve data if I supply account address along with txn ID than supplying just the txn ID?

@Tim I used pagination like that - with NextToken. I don’t know what went wrong. Anyways, let me retry, I might have done something stupid.