Skip to content

codingame_tools.client.common.protocol.last_activities

last_activities

JSON-serializable dataclasses for the LastActivities service's getLastActivities Codingame API method. CgLastActivityPuzzle/CgLastActivityContributor/CgPuzzleFeedback are also reused by the Puzzle service's findProgressByIds/findAllMinimalProgress/findProgressByPrettyId methods (see puzzle.py).

CgPuzzleTopicNode dataclass

CgPuzzleTopicNode(handle, value, extra_data=dict(), children=list(), category=None)

Bases: JSONWizardX

A single node in a puzzle's topic tree (CgLastActivityPuzzle.topics). Topics are organized hierarchically--e.g. a top-level "Uncategorized"/"Algorithms" node with more specific child topics like "BFS"/"Pathfinding" underneath.

handle instance-attribute

handle

Opaque (but human-readable) slug for the topic, e.g. "bfs", "uncategorized".

value instance-attribute

value

Display name for the topic, e.g. "BFS", "Uncategorized".

children class-attribute instance-attribute

children = field(default_factory=list)

Child topics nested under this one. Often empty.

category class-attribute instance-attribute

category = None

The topic's difficulty category, e.g. "FUNDAMENTALS", "INTERMEDIATE", "ADVANCED". Not always present--observed absent for at least one top-level "Uncategorized" node.

CgLastActivityContributor dataclass

CgLastActivityContributor(user_id, public_handle, extra_data=dict(), pseudo=None, avatar=None, cover=None)

Bases: JSONWizardX

The codingamer who authored a puzzle, as embedded in CgLastActivityPuzzle.contributor.

user_id instance-attribute

user_id

The contributor's numeric ID.

public_handle instance-attribute

public_handle

The contributor's opaque public handle string.

pseudo class-attribute instance-attribute

pseudo = None

The contributor's display name. Not always present--confirmed live (2026-07-31, via cg puzzle import resolving a title search to a puzzle with such a contributor): a never-configured/minimal account can omit pseudo entirely, same already-documented pattern as CgCodingamer.pseudo/CgCodingamerFollower.pseudo.

avatar class-attribute instance-attribute

avatar = None

The binary image ID of the contributor's avatar image.

cover class-attribute instance-attribute

cover = None

The binary image ID of the contributor's cover image.

CgPuzzleFeedback dataclass

CgPuzzleFeedback(feedback_id, feedbacks, extra_data=dict(), codingamer_feedback=None)

Bases: JSONWizardX

Community feedback/rating summary for a puzzle, as embedded in CgLastActivityPuzzle.feedback and CgPuzzleMinimalProgress.feedback (puzzle.py).

feedback_id instance-attribute

feedback_id

Numeric ID of the feedback record.

feedbacks instance-attribute

feedbacks

A histogram of community feedback ratings (bucket counts), lowest rating first.

codingamer_feedback class-attribute instance-attribute

codingamer_feedback = None

The requesting codingamer's own feedback rating for this puzzle, if given (scale unconfirmed--observed values are 1-5-ish star ratings). Not always present--absent from every example seen via Puzzle/findAllMinimalProgress.

CgLastActivityPuzzle dataclass

CgLastActivityPuzzle(id, title, pretty_id, level, details_page_url, forum_link, feedback, topics, community_creation, achievement_count, done_achievement_count, attempt_count, solved_count, rank, validator_score, xp_points, puzzle_type=Alias('type'), _creation_time=Alias('creationTime'), extra_data=dict(), contributor=None, cover_binary_id=None, test_session_handle=None, _last_activity=Alias('lastActivity', default=None), linked_achievements=None, moderators=None, statement=None, title_map=None)

Bases: JSONWizardX

A community puzzle summary, as embedded in a "PUZZLE"-type CgLastActivity entry (getLastActivities), and also returned directly by Puzzle/findProgressByIds (bare JSON array) and Puzzle/findProgressByPrettyId (bare JSON object--the richest of the three, populating linked_achievements/moderators/statement/title_map, which the other two never include).

id instance-attribute

id

Numeric ID of the puzzle.

title instance-attribute

title

Display title of the puzzle.

pretty_id instance-attribute

pretty_id

URL-friendly slug for the puzzle, e.g. "logic-gates-detective".

level instance-attribute

level

Difficulty level, e.g. "easy", "medium".

details_page_url instance-attribute

details_page_url

Relative URL path to the puzzle's details/training page.

forum_link

Relative URL path (minus domain) to the puzzle's discussion forum thread.

feedback instance-attribute

feedback

Community feedback/rating summary for this puzzle.

topics instance-attribute

topics

The puzzle's topic tree; see CgPuzzleTopicNode.

community_creation instance-attribute

community_creation

Whether this is a community-created puzzle (as opposed to an official CodinGame puzzle).

achievement_count instance-attribute

achievement_count

Total number of achievements associated with this puzzle.

done_achievement_count instance-attribute

done_achievement_count

Number of this puzzle's achievements the requesting codingamer has unlocked.

attempt_count instance-attribute

attempt_count

Total number of attempts made on this puzzle across all codingamers.

solved_count instance-attribute

solved_count

Total number of codingamers who have solved this puzzle.

rank instance-attribute

rank

Unclear precise semantics; observed as 0 in all examples so far.

validator_score instance-attribute

validator_score

Score achieved against the puzzle's validators, e.g. 100 for a fully-solved puzzle.

xp_points instance-attribute

xp_points

XP points awarded for solving this puzzle.

puzzle_type class-attribute instance-attribute

puzzle_type = Alias('type')

The puzzle's own type discriminator, e.g. "CODE", "SOLO". Only observed via getLastActivities so far ("CODE"); findProgressByIds additionally returned "SOLO".

contributor class-attribute instance-attribute

contributor = None

The codingamer who authored this puzzle, or None for a puzzle CodinGame provides itself.

Confirmed live (2026-08-02) absent entirely--not null--for official puzzles, which is what community_creation: False marks. Only community-created puzzles have an author to name.

cover_binary_id class-attribute instance-attribute

cover_binary_id = None

Binary image ID for the puzzle's cover image, or None for a puzzle that has no cover.

Omitted entirely (not null) rather than defaulted--observed on 7 of 30 puzzles returned by a single Puzzle/findProgressByIds call (2026-08-03), so this is ordinary, not an edge case. Defaulted (rather than left required) for the same reason contributor is.

test_session_handle class-attribute instance-attribute

test_session_handle = None

Opaque handle for a test session against this puzzle. Not always present--absent (along with last_activity) for puzzles the codingamer has never attempted, observed via Puzzle/findProgressByIds.

linked_achievements class-attribute instance-attribute

linked_achievements = None

Achievements linked to this puzzle. Only observed as an empty list so far, so element shape is unknown. Only present via Puzzle/findProgressByPrettyId.

moderators class-attribute instance-attribute

moderators = None

Codingamers who moderate this puzzle. Only present via Puzzle/findProgressByPrettyId.

statement class-attribute instance-attribute

statement = None

Rendered HTML of the puzzle's full problem statement. Only present via Puzzle/findProgressByPrettyId.

title_map class-attribute instance-attribute

title_map = None

Localized title (locale ID as a string key, e.g. "1"/"2" -> title). Only present via Puzzle/findProgressByPrettyId.

creation_time property writable

creation_time

See the field docstring for _creation_time. Always UTC.

last_activity property writable

last_activity

See the field docstring for _last_activity. Always UTC. None if not applicable.

CgLastActivity dataclass

CgLastActivity(activity_type=Alias('type'), extra_data=dict(), puzzle=None)

Bases: JSONWizardX

A single entry in a codingamer's recent activity feed, as returned (in a bare JSON array) by getLastActivities.

Only activity_type == "PUZZLE" has been observed so far, in which case puzzle is populated. Other activity types (e.g. Clash of Code, contributions) likely exist and probably populate a different, not-yet-modeled field instead of puzzle--any such field would currently land in extra_data and be logged at DEBUG level (see JSONWizardX).

activity_type class-attribute instance-attribute

activity_type = Alias('type')

Discriminator for the kind of activity; only "PUZZLE" observed so far.

puzzle class-attribute instance-attribute

puzzle = None

Populated when activity_type == "PUZZLE".