Problem
The planned student profile page would benefit from displaying a user's LeetCode Global Ranking. While the ranking is available from the LeetCode API, it is not currently exposed through the /api/student/:username endpoint.
Expected Behavior
Extend the /api/student/:username endpoint to include the user's global ranking in the API response.
Requirements
- Extract the ranking from the LeetCode API response.
- Include it in the /api/student/:username response.
- Handle cases where ranking data is unavailable.
- Maintain backward compatibility with existing API consumers.
Example Response
{
"username": "john123",
"ranking": 3264237,
"history": [...]
}
Problem
The planned student profile page would benefit from displaying a user's LeetCode Global Ranking. While the ranking is available from the LeetCode API, it is not currently exposed through the /api/student/:username endpoint.
Expected Behavior
Extend the /api/student/:username endpoint to include the user's global ranking in the API response.
Requirements
Example Response
{
"username": "john123",
"ranking": 3264237,
"history": [...]
}