Search…
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.
  • 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.
1
var StellarSdk = require("stellar-sdk");
2
var server = new StellarSdk.Server("https://horizon.stellar.org");
3
4
server
5
.transactions()
6
.call()
7
.then(function (resp) {
8
// page 1
9
console.log(resp);
10
return resp.next();
11
})
12
.then(function (resp) {
13
// page 2
14
console.log(resp);
15
})
16
.catch(function (err) {
17
console.error(err);
18
});
Copied!
1
{
2
"_links": {
3
"self": {
4
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=&limit=5&order=asc"
5
},
6
"next": {
7
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=113928152169844741&limit=5&order=asc"
8
},
9
"prev": {
10
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906/operations?cursor=113928152169844737&limit=5&order=desc"
11
}
12
},
13
"_embedded": {
14
"records": [
15
{
16
"_links": {
17
"self": {
18
"href": "https://horizon.stellar.org/operations/113928152169844737"
19
},
20
"transaction": {
21
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
22
},
23
"effects": {
24
"href": "https://horizon.stellar.org/operations/113928152169844737/effects"
25
}
26
},
27
"id": "113928152169844737",
28
"paging_token": "113928152169844737",
29
"transaction_successful": true,
30
"source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
31
"type": "manage_buy_offer",
32
"type_i": 12,
33
"created_at": "2019-10-28T19:44:09Z",
34
"transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
35
"amount": "0.0000000",
36
"price": "0.0001000",
37
"price_r": {
38
"n": 1,
39
"d": 10000
40
},
41
"buying_asset_type": "native",
42
"selling_asset_type": "credit_alphanum4",
43
"selling_asset_code": "SLT",
44
"selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
45
"offer_id": 126229445
46
},
47
{
48
"_links": {
49
"self": {
50
"href": "https://horizon.stellar.org/operations/113928152169844738"
51
},
52
"transaction": {
53
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
54
},
55
"effects": {
56
"href": "https://horizon.stellar.org/operations/113928152169844738/effects"
57
},
58
"succeeds": {
59
"href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844738"
60
},
61
"precedes": {
62
"href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844738"
63
}
64
},
65
"id": "113928152169844738",
66
"paging_token": "113928152169844738",
67
"transaction_successful": true,
68
"source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
69
"type": "manage_buy_offer",
70
"type_i": 12,
71
"created_at": "2019-10-28T19:44:09Z",
72
"transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
73
"amount": "0.0000000",
74
"price": "0.0001000",
75
"price_r": {
76
"n": 1,
77
"d": 10000
78
},
79
"buying_asset_type": "native",
80
"selling_asset_type": "credit_alphanum4",
81
"selling_asset_code": "SLT",
82
"selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
83
"offer_id": 126229446
84
},
85
{
86
"_links": {
87
"self": {
88
"href": "https://horizon.stellar.org/operations/113928152169844739"
89
},
90
"transaction": {
91
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
92
},
93
"effects": {
94
"href": "https://horizon.stellar.org/operations/113928152169844739/effects"
95
},
96
"succeeds": {
97
"href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844739"
98
},
99
"precedes": {
100
"href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844739"
101
}
102
},
103
"id": "113928152169844739",
104
"paging_token": "113928152169844739",
105
"transaction_successful": true,
106
"source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
107
"type": "manage_buy_offer",
108
"type_i": 12,
109
"created_at": "2019-10-28T19:44:09Z",
110
"transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
111
"amount": "0.0000000",
112
"price": "0.0001000",
113
"price_r": {
114
"n": 1,
115
"d": 10000
116
},
117
"buying_asset_type": "native",
118
"selling_asset_type": "credit_alphanum4",
119
"selling_asset_code": "SLT",
120
"selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
121
"offer_id": 126229447
122
},
123
{
124
"_links": {
125
"self": {
126
"href": "https://horizon.stellar.org/operations/113928152169844740"
127
},
128
"transaction": {
129
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
130
},
131
"effects": {
132
"href": "https://horizon.stellar.org/operations/113928152169844740/effects"
133
},
134
"succeeds": {
135
"href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844740"
136
},
137
"precedes": {
138
"href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844740"
139
}
140
},
141
"id": "113928152169844740",
142
"paging_token": "113928152169844740",
143
"transaction_successful": true,
144
"source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
145
"type": "manage_buy_offer",
146
"type_i": 12,
147
"created_at": "2019-10-28T19:44:09Z",
148
"transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
149
"amount": "0.0000000",
150
"price": "0.0001000",
151
"price_r": {
152
"n": 1,
153
"d": 10000
154
},
155
"buying_asset_type": "native",
156
"selling_asset_type": "credit_alphanum4",
157
"selling_asset_code": "SLT",
158
"selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
159
"offer_id": 126229448
160
},
161
{
162
"_links": {
163
"self": {
164
"href": "https://horizon.stellar.org/operations/113928152169844741"
165
},
166
"transaction": {
167
"href": "https://horizon.stellar.org/transactions/2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906"
168
},
169
"effects": {
170
"href": "https://horizon.stellar.org/operations/113928152169844741/effects"
171
},
172
"succeeds": {
173
"href": "https://horizon.stellar.org/effects?order=desc\u0026cursor=113928152169844741"
174
},
175
"precedes": {
176
"href": "https://horizon.stellar.org/effects?order=asc\u0026cursor=113928152169844741"
177
}
178
},
179
"id": "113928152169844741",
180
"paging_token": "113928152169844741",
181
"transaction_successful": true,
182
"source_account": "GDO2BIMNH7T6MOJVPKEJHWAGMYGOQU5QMK5BKT5XMVWPZKHAGA4JNAQZ",
183
"type": "manage_buy_offer",
184
"type_i": 12,
185
"created_at": "2019-10-28T19:44:09Z",
186
"transaction_hash": "2a09c3d79027721f2b8a78e2a936cbeda484bfe98a6e34856c1fee743b7e8906",
187
"amount": "0.0000000",
188
"price": "0.0001000",
189
"price_r": {
190
"n": 1,
191
"d": 10000
192
},
193
"buying_asset_type": "native",
194
"selling_asset_type": "credit_alphanum4",
195
"selling_asset_code": "SLT",
196
"selling_asset_issuer": "GCKA6K5PCQ6PNF5RQBF7PQDJWRHO6UOGFMRLK3DYHDOI244V47XKQ4GP",
197
"offer_id": 126229449
198
}
199
]
200
}
201
}
Copied!
Last modified 10mo ago
Copy link