List notes
Stay organized with collections
Save and categorize content based on your preferences.
The following sample shows how to list notes:
Java
/** Lists notes using different filtering and pagination options. */
private void listNotes() throws IOException {
// Lists 3 notes that were created after a specified timestamp and that are not trashed. Results
// are ordered by most recently modified first.
ListNotesResponse response =
keepService
.notes()
.list()
.setFilter("create_time > \"2021-01-01T00:00:00Z\"")
.setFilter("-trashed")
.setPageSize(3)
.execute();
System.out.println("List notes response: " + response);
// Lists notes using a pagination token.
ListNotesResponse firstPageResponse = keepService.notes().list().setPageSize(1).execute();
String nextPageToken = firstPageResponse.getNextPageToken();
for (int i = 0; i < 5; i++) {
// Uses the page token that was returned by the previous page's next page token.
ListNotesResponse pagedResponse =
keepService.notes().list().setPageSize(1).setPageToken(nextPageToken).execute();
System.out.println("Listing note:" + pagedResponse);
nextPageToken = pagedResponse.getNextPageToken();
}
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[],[],null,["# List notes\n\nThe following sample shows how to list notes: \n\n### REST\n\nCall [notes.list()](/workspace/keep/api/reference/rest/v1/notes/list).\n\n### Java\n\n /** Lists notes using different filtering and pagination options. */\n private void listNotes() throws IOException {\n // Lists 3 notes that were created after a specified timestamp and that are not trashed. Results\n // are ordered by most recently modified first.\n ListNotesResponse response =\n keepService\n .notes()\n .list()\n .setFilter(\"create_time \u003e \\\"2021-01-01T00:00:00Z\\\"\")\n .setFilter(\"-trashed\")\n .setPageSize(3)\n .execute();\n\n System.out.println(\"List notes response: \" + response);\n\n // Lists notes using a pagination token.\n ListNotesResponse firstPageResponse = keepService.notes().list().setPageSize(1).execute();\n String nextPageToken = firstPageResponse.getNextPageToken();\n\n for (int i = 0; i \u003c 5; i++) {\n // Uses the page token that was returned by the previous page's next page token.\n ListNotesResponse pagedResponse =\n keepService.notes().list().setPageSize(1).setPageToken(nextPageToken).execute();\n System.out.println(\"Listing note:\" + pagedResponse);\n nextPageToken = pagedResponse.getNextPageToken();\n }\n }"]]