getUpdatedBookFeed method

Future<UpdatedBookFeed> getUpdatedBookFeed({
  1. int page = 1,
  2. int pageSize = 100,
  3. DateTime? lastUpdated,
  4. String? cursor,
})

Get the paginated feed of recently updated ISBNs.

This ISBNdb endpoint is available on Pro plans and higher and keeps up to 7 days of update history. Pass the previous response's next as cursor until it is null. With a cursor, page and lastUpdated are ignored. Offset pagination with page is deprecated by ISBNdb. ISBNdb rejects pageSize values greater than 1,000 with HTTP 400.

Implementation

Future<UpdatedBookFeed> getUpdatedBookFeed({
  int page = 1,
  int pageSize = 100,
  DateTime? lastUpdated,
  String? cursor,
}) async {
  const path = "feeds/books/updates";
  final response = await _get(
    path,
    queryParameters: <String, Object?>{
      if (cursor == null) "page": page,
      "pageSize": pageSize,
      if (cursor == null) "lastUpdated": _formatQueryDate(lastUpdated),
      "cursor": cursor,
    }..removeWhere((_, value) => value == null),
  );
  return _parseModel(
    method: "GET",
    path: path,
    parser: () => UpdatedBookFeed.fromJson(response),
  );
}