Enable automatic pagination in REST client
masterWhen making REST requests, you can enable automatic pagination by passing rest.WithPagination(true) to the client constructor. This allows you to use an iterator to seamlessly traverse through multiple pages of results by following the next_url automatically.
c := rest.NewWithOptions("YOUR_API_KEY",
rest.WithPagination(true),
)
// After making a request:
iter := rest.NewIteratorFromResponse(c, resp)
for iter.Next() {
item := iter.Item()
fmt.Printf("%+v\n", item)
}
if err := iter.Err(); err != nil {
// handle error
}