Skip to content

Python API

Everything importable lives at the package top level:

from yfcomment import get_forum, get_comments, get_ranking, Forum, Comment, RankEntry

Functions

yfcomment.get_forum(code, limit=20)

Fetch a stock's forum thread: the sentiment poll header plus the latest limit comments (e.g. "285A", "7203").

The ".T" market suffix is appended automatically when missing. Comments are ordered newest first. poll is None when the page has no poll or it could not be parsed (never raises for this reason).

yfcomment.get_comments(code, limit=20)

Return the latest limit comments for a stock code (e.g. "285A", "7203").

The ".T" market suffix is appended automatically when missing. Comments are ordered newest first.

yfcomment.get_ranking(term='daily', limit=20)

Fetch the BBS comment-count ranking (most-commented stocks).

term is one of "daily", "weekly", "monthly" (daily by default). Returns the top limit entries. No post counts are exposed by the site — entries are ordered by rank, with price and last-forum-activity time only.

Data classes

yfcomment.Forum dataclass

A stock forum thread: the sentiment poll header plus its comments.

yfcomment.Comment dataclass

One comment on a Yahoo Finance Japan stock forum thread.

yfcomment.RankEntry dataclass

One row in the BBS comment-count ranking.