Skip to main content
client.gamma.comments.getCommentById fetches the root comment and its replies for the supplied ID.

Request

const thread = await client.gamma.comments.getCommentById(id, params);

Parameters

NameTypeRequiredNotes
idnumber (≥ 0)Comment ID.
get_positionsbooleanInclude position data within profiles.

Response

An array of Comment objects identical to List Comments. The first element is the root comment.

Usage example

const thread = await client.gamma.comments.getCommentById(1975918, { get_positions: true });

console.log(thread[0]?.body);

Failure modes

  • id must be numeric.