Skip to main content

Method

client.comments.list(args: ListCommentsParameters): Promise<ListCommentsResponse>

Parameters

block_id
string
required
Identifier for a Notion block or page.
start_cursor
string
If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.
page_size
number
The number of items from the full list desired in the response. Maximum: 100.
auth
string
Bearer token for authentication. If not provided, the client-level auth is used.

Response

object
string
Always "list".
type
string
Always "comment".
results
array
An array of Comment objects.
next_cursor
string | null
A cursor to use in the next request to get the next page of results. If null, there are no more results.
has_more
boolean
Whether there are more results to fetch.

Example

const response = await client.comments.list({
  block_id: "page-id-123",
})

console.log(response.results)

Pagination

Use the pagination helpers for easy iteration:
import { iteratePaginatedAPI } from "@notionhq/client"

for await (const comment of iteratePaginatedAPI(
  client.comments.list,
  { block_id: "page-id-123" }
)) {
  console.log(comment.rich_text)
}

Build docs developers (and LLMs) love