> For the complete documentation index, see [llms.txt](https://developers.docs.bantufoundation.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.docs.bantufoundation.org/api/introduction/pagination/index.md).

# Index

To make it possible to explore the millions of records for resources like transactions and operations, Horizon paginates the data it returns for collection-based endpoints.

Each individual transaction, operation, ledger, etc. is returned as a record, and a group of records is called a collection. Records are returned as an array under the `_embedded` attribute.

To move between pages of a collection of records, use the links in the `next` and `prev` attributes nested under the top-level `_links` attribute.

&#x20;

* ATTRIBUTE DATA TYPE

  DESCRIPTION
* \_linksarray

  Provides links for navigating to other pages.Hide child attributes

  * \_links.selfarray

    An `href` key with a link to the response itself as the value.
  * \_links.nextarray

    An `href` key with a link to the next page for this endpoint as the value.
  * \_links.prevarray

    An `href` key with a link to the next page for this endpoint as the value.
* \_embeddedarray

  An `href` key with a link to the next page for this endpoint as the value.Hide child attributes

  * \_embedded.recordsarray

    Returns an array of records.

```javascript
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");

server
  .transactions()
  .call()
  .then(function (resp) {
    // page 1
    console.log(resp);
    return resp.next();
  })
  .then(function (resp) {
    // page 2
    console.log(resp);
  })
  .catch(function (err) {
    console.error(err);
  });
```

```javascript
{
  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=&limit=5&order=asc"
    },
    "next": {
      "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=113928152169844741&limit=5&order=asc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=113928152169844737&limit=5&order=desc"
    }
  },
  "_embedded": {
    "records": [
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844737"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844737/effects"
          }
        },
        "id": "113928152169844737",
        "paging_token": "113928152169844737",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229445
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844738"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844738/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844738"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844738"
          }
        },
        "id": "113928152169844738",
        "paging_token": "113928152169844738",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229446
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844739"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844739/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844739"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844739"
          }
        },
        "id": "113928152169844739",
        "paging_token": "113928152169844739",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229447
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844740"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844740/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844740"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844740"
          }
        },
        "id": "113928152169844740",
        "paging_token": "113928152169844740",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229448
      },
      {
        "_links": {
          "self": {
            "href": "https://horizon.stellar.org/operations/113928152169844741"
          },
          "transaction": {
            "href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
          },
          "effects": {
            "href": "https://horizon.stellar.org/operations/113928152169844741/effects"
          },
          "succeeds": {
            "href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844741"
          },
          "precedes": {
            "href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844741"
          }
        },
        "id": "113928152169844741",
        "paging_token": "113928152169844741",
        "transaction_successful": true,
        "source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
        "type": "manage_buy_offer",
        "type_i": 12,
        "created_at": "2019-10-28T19:44:09Z",
        "transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
        "amount": "0.0000000",
        "price": "0.0001000",
        "price_r": {
          "n": 1,
          "d": 10000
        },
        "buying_asset_type": "native",
        "selling_asset_type": "credit_alphanum4",
        "selling_asset_code": "SLT",
        "selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
        "offer_id": 126229449
      }
    ]
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.docs.bantufoundation.org/api/introduction/pagination/index.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
