Skip to content

Expose userRank in kaggle competitions list output #1090

Description

@aadi-joshi

Summary

kaggle competitions list does not show the authenticated user's competition rank, even though the API already returns it. Users who want their rank today have to download the full leaderboard and search locally (see #66).

This proposes exposing the existing userRank field in competitions list output.

Current behavior

kaggle competitions list -g entered -v
ref,deadline,category,reward,teamCount,userHasEntered
https://www.kaggle.com/competitions/example-comp,2026-08-01 00:00:00,Playground,Swag,1200,True

userHasEntered is shown, but rank is not, even when the user has a public leaderboard position.

The leaderboard commands (competitions leaderboard --show / --download) return teamId, teamName, submissionDate, and score. They do not include a rank column.

What the API already provides

competitions list calls ListCompetitions via kagglesdk. The response uses ApiCompetition, which includes userHasEntered (already in CLI output) and userRank (returned by the API but not shown).

In src/kaggle/api/kaggle_api_extended.py, competition_fields omits userRank:

competition_fields = ["ref", "deadline", "category", "reward", "teamCount", "userHasEntered"]

Proposed change

Add userRank to competition_fields so it appears in table, CSV (-v), and --format output.

kaggle competitions list -g entered -v
ref,deadline,category,reward,teamCount,userHasEntered,userRank
https://www.kaggle.com/competitions/example-comp,2026-08-01 00:00:00,Playground,Swag,1200,True,784

Also update docs/competitions.md and skills/references/competitions.md, and add a unit test with a mocked list_competitions response that includes user_rank.

When userHasEntered is True but userRank is 0, the CLI can print 0 as-is. Docs should note that this can mean no public leaderboard position yet.

Related

Contribution

Happy to open a PR for this if the approach looks good. Let me know if you have any questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions