Latest Transactions SIWC

Continuing the discussion from Latest transactions:

Hello, @Marajjanu! We appreciate your enthusiasm in using our Coinbase Cloud services and we’d be glad to assist you with your concern. We understand that you want to know how to pull the latest 5-10 transactions from the transactions endpoint, with regard to this, we want to recommend utilizing the pagination. The transactions endpoint returns 25 results because all Sign in with Coinbase GET endpoints which return an object list support cursor based pagination, with pagination information inside a pagination object has a default limit of 25 results per request, but up to 100 are permitted. Since you want to pull only the latest 5-10 transactions in your request, you can specify the limit argument by 10. The result list is in descending order by default (newest item first) but it can be reversed by supplying order=asc instead.You can check this for fetching the first 5-10 transactions for reference:

{
  "pagination": {
    "ending_before": null,
    "starting_after": null,
    "limit": 10,
    "order": "desc",
    "previous_uri": null,
    "next_uri": "/v2/accounts?&limit=25&starting_after=5d5aed5f-b7c0-5585-a3dd-a7ed9ef0e414"
  },
  "data": [
    ...
  ]
}

You may look for more in-depth information about this topic through this link.

We hope this helps. Please feel free to reply back to this thread if you need further assistance.

1 Like