Skip to content

Add comments, comment replies and the heatmap - #4

Merged
ytapi merged 2 commits into
mainfrom
comments-heatmap
Oct 12, 2026
Merged

ytapi merged 2 commits into
mainfrom
comments-heatmap

Conversation

@ytapi

@ytapi ytapi commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Adds the comments and heatmap endpoints of the API.

  • get_comments(video_id, sort=, cursor=) and iter_comments: top or newest comments, about 20 per page, 1 credit per page. Comments turned off raise NotFoundError with comments_disabled (free).
  • get_comment_replies(video_id, cursor) and iter_comment_replies(video_id, replies_cursor).
  • get_heatmap(video_id): YouTube's "most replayed" graph, condensed to the most replayed moment, up to five peaks and a 20-part curve. 1 credit; a video without one raises NotFoundError with heatmap_unavailable (free).
  • TypedDicts for both, README examples, version 0.3.0. The User-Agent had stayed at 0.2.0; it now matches.

Tested

  • Unit tests (mocked HTTP): paths and query strings, both iterators following cursors. 27 pass.
  • Against the live API: heatmap returned 20 curve points; a comments page returned 20 comments; replies paged; a made-for-kids video raised comments_disabled.

🤖 Generated with Claude Code

YTAPI and others added 2 commits October 12, 2026 02:06
- get_comments / iter_comments: top or newest, 1 credit per page
- get_comment_replies / iter_comment_replies from a replies_cursor
- get_heatmap: the "most replayed" graph, condensed
- Types for both; NotFoundError notes comments_disabled and
  heatmap_unavailable
- 0.3.0 (the User-Agent had stayed at 0.2.0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iter_comment_replies yields nothing for a comment without a replies
cursor instead of sending an empty cursor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ytapi
ytapi merged commit 762b699 into main Oct 12, 2026
4 checks passed
@ytapi
ytapi deleted the comments-heatmap branch October 12, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant