Reading data: Timelines

These functions allow you to access the timelines a logged in user could see, as well as hashtag timelines and the public (federated) and local timelines. For the public, local and hashtag timelines, access is allowed even when not authenticated if the instance admin has enabled this functionality.

Mastodon.timeline(timeline='home', max_id=None, min_id=None, since_id=None, limit=None, only_media=False, local=False, remote=False)[source]

Fetch statuses, most recent ones first. timeline can be ‘home’, ‘local’, ‘public’, ‘tag/hashtag’ or ‘list/id’. See the following functions documentation for what those do.

The default timeline is the “home” timeline.

Specify only_media to only get posts with attached media. Specify local to only get local statuses, and remote to only get remote statuses. Some options are mutually incompatible as dictated by logic.

May or may not require authentication depending on server settings and what is specifically requested.

Returns a list of status dicts.

Added: Mastodon v1.0.0, last changed: Mastodon v3.1.4

Mastodon.timeline_home(max_id=None, min_id=None, since_id=None, limit=None, only_media=False, local=False, remote=False)[source]

Convenience method: Fetches the logged-in user’s home timeline (i.e. followed users and self). Params as in timeline().

Returns a list of status dicts.

Added: Mastodon v1.0.0, last changed: Mastodon v3.1.4

Mastodon.timeline_local(max_id=None, min_id=None, since_id=None, limit=None, only_media=False)[source]

Convenience method: Fetches the local / instance-wide timeline, not including replies. Params as in timeline().

Returns a list of status dicts.

Added: Mastodon v1.0.0, last changed: Mastodon v3.1.4

Mastodon.timeline_public(max_id=None, min_id=None, since_id=None, limit=None, only_media=False, local=False, remote=False)[source]

Convenience method: Fetches the public / visible-network / federated timeline, not including replies. Params as in timeline().

Returns a list of status dicts.

Added: Mastodon v1.0.0, last changed: Mastodon v3.1.4

Mastodon.timeline_hashtag(hashtag, local=False, max_id=None, min_id=None, since_id=None, limit=None, only_media=False, remote=False)[source]

Convenience method: Fetch a timeline of toots with a given hashtag. The hashtag parameter should not contain the leading #. Params as in timeline().

Returns a list of status dicts.

Added: Mastodon v1.0.0, last changed: Mastodon v3.1.4

Mastodon.timeline_list(id, max_id=None, min_id=None, since_id=None, limit=None, only_media=False, local=False, remote=False)[source]

Convenience method: Fetches a timeline containing all the toots by users in a given list. Params as in timeline().

Returns a list of status dicts.

Added: Mastodon v2.1.0, last changed: Mastodon v3.1.4

Mastodon.conversations(max_id=None, min_id=None, since_id=None, limit=None)[source]

Fetches a user’s conversations.

Returns a list of conversation dicts.

Added: Mastodon v2.6.0, last changed: Mastodon v2.6.0