getArNSRecords

getArNSRecords is a method on the ARIO class that retrieves all registered ArNS records of the ARIO process, paginated and sorted by the specified criteria. The cursor used for pagination is the last ArNS name from previous request.

getArNSRecords does not require authentication.

Parameters

ParameterTypeDescriptionOptionalDefault
cursorStringCursor used for paginated resultstrueNone
limitNumberMax number of results to return in a single search. Max is 1000.true100
sortByStringProperty used to sort returned resultstruestartTimestamp
sortOrderStringOrder in which sorted results are returned. valid values are `desc` or `asc`truedesc

Example

getArNSRecords

const { ARIO } = require('@ar.io/sdk');

async function main() {
  const ario = ARIO.init();
  // get the newest 100 names
    const records = await ario.getArNSRecords({
            limit: 100,
            sortBy: 'startTimestamp',
            sortOrder: 'desc',
    });

  console.log(records);
}

main();

Output

{
  "items": [
    {
      "name": "ao",
      "processId": "eNey-H9RB9uCdoJUvPULb35qhZVXZcEXv8xds4aHhkQ",
      "purchasePrice": 75541282285,
      "startTimestamp": 1720720621424,
      "type": "permabuy",
      "undernames": 10
    },
    {
      "name": "ardrive",
      "processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
      "endTimestamp": 1720720819969,
      "startTimestamp": 1720720620813,
      "type": "lease",
      "undernames": 100
    },
    {
      "name": "arweave",
      "processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
      "endTimestamp": 1720720819969,
      "startTimestamp": 1720720620800,
      "type": "lease",
      "undernames": 100
    },
    {
      "name": "ar-io",
      "processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
      "endTimestamp": 1720720819969,
      "startTimestamp": 1720720619000,
      "type": "lease",
      "undernames": 100
    },
    {
      "name": "fwd",
      "processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
      "endTimestamp": 1720720819969,
      "startTimestamp": 1720720220811,
      "type": "lease",
      "undernames": 100
    }
    // ...95 other records
  ],
  "hasMore": true,
  "nextCursor": "fwdresearch",
  "totalItems": 21740,
  "sortBy": "startTimestamp",
  "sortOrder": "desc"
}