getArNSRecords

getArNSRecords is a method on the ARIO class that retrieves all ArNS records with optional pagination and filtering support.

getArNSRecords does not require authentication.

Parameters

← Swipe to see more →
ParameterTypeDescriptionOptionalDefault
cursorstring

The ArNS name to use as the starting point for the next page of results

trueNone
limitnumber

The maximum number of records to return (max: 1000)

true100
sortBystringThe property to sort results bytruestartTimestamp
sortOrderstringThe sort direction ('desc' or 'asc')truedesc
← Swipe to see more →

Examples

getArNSRecords

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

async function main() {
  const ario = ARIO.init();
  const records = await ario.getArNSRecords({
    limit: 50,
    sortBy: 'endTimestamp',
    sortOrder: 'desc'
  });

  console.log(records);
}

main();

Output

{
  "items": [
    {
      "name": "ardrive",
      "processId": "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM",
      "startTimestamp": 1707307200000,
      "endTimestamp": 1739307200000,
      "type": "lease",
      "undernameLimit": 10
    },
    {
      "name": "permaweb",
      "processId": "xWQ7UmbP0ZHDY7OLCxJsuPiLWYQo5bhHGnp-kgP8N2A",
      "type": "permabuy",
      "undernameLimit": 50
    }
  ],
  "hasMore": true,
  "nextCursor": "permaweb",
  "totalItems": 4567,
  "sortBy": "endTimestamp",
  "sortOrder": "desc"
}