Se7enn's blog

By Se7enn, history, 3 weeks ago, In English

The contest.standings API method now only returns data for gym and mashup contests. All other contest types are rejected it seems.

Anonymous requests return:

{"status":"FAILED","comment":"contestId: You have to be authenticated to use this method"}

Authenticated requests with a valid API key return:

{"status":"FAILED","comment":"contestId: Only gym and mashup contests are available to non-admin users in this method"}

The standings data is still publicly accessible — just not programmatically through the API.

This breaks Carrot and other useful Codeforces extensions/tools.

Does anyone know when these changes took effect, if they're temporary or permanent, what the motive was, and if there are any other alternatives to Carrot?

I enjoy seeing my performance rating after virtual/live contests a lot, and I imagine others do as well.

  • Vote: I like it
  • +94
  • Vote: I do not like it

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Se7enn (previous revision, new revision, compare).

»
3 weeks ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

My guess is this was done to reduce load from high-volume API requests during contests. CF Get Rating and CF Predictor are also affected. Anyone have other guesses?

»
8 days ago, hide # |
 
Vote: I like it +104 Vote: I do not like it

Hi. This change was made by me, so let me explain what happened.

Originally, contest.standings worked for regular public contests with quite a lot of functionality. Unfortunately, this method is much heavier than it may look from outside. It is not always just “read standings from a table and return JSON”. Depending on the request, it may involve current virtual participants of the requester, practice submissions, filtering/paging, and then return a pretty large response.

Recently this endpoint started to be used much more heavily by automated tools/scripts. I also suspect that some of this traffic came from AI/research-related usage. As a result, the whole site could become noticeably slower, because Codeforces had to calculate and return too much data too often.

A few weeks ago I reacted by heavily restricting this method. In particular, I removed access to regular public contest standings through this API for ordinary users. This did break tools like Carrot, CF-Predictor, and similar extensions. I understand that it was unpleasant for users who relied on them.

Today I made the restriction softer and changed the behavior to a compromise.

For gym and mashup contests, contest.standings is available only through an authenticated API request from a user who can view the contest. Optional parameters may still be used there.

For regular contests, ordinary and anonymous users can request standings only for public contests, and only by an anonymous GET request with exactly one query parameter: contestId.

So for public regular contests, please use:

https://mirror.codeforces.com/api/contest.standings?contestId=<id>

The response for such requests is cached for a short time, usually around 1–3 minutes. This should be much safer for the site and, I hope, should be enough for tools like Carrot, CF-Predictor, and similar extensions, as long as they only need public standings by contest id.

If some tool currently sends an authenticated/signed request or passes extra parameters for regular contests, it will probably need to be adjusted to use the simple anonymous URL above.

I don't currently have a technical way to keep the old fully-functional API behavior without risking performance degradation of the whole site. So this is not a full rollback to the old behavior, but an attempt to return the most useful part in a safe form.

Sorry for the breakage. I'll watch how this compromise works in practice.

  • »
    »
    8 days ago, hide # ^ |
    Rev. 2  
    Vote: I like it +29 Vote: I do not like it

    It's sad to see AI ruining Codeforces experience through bots too.

    Now that there is a way to fetch the standings, aropan is it possible to fix clist?

  • »
    »
    8 days ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    finally , thanks MikeMirzayanov.

  • »
    »
    6 days ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Hi MikeMirzayanov, I understand this caching helps reduce load/ recomputation. Would it be possible to still allow the parameter to show unofficial participants — that would allow fetching all the information (this is now not available anymore as I understand it), while still requiring only those 2 to be cached/ computed on the server.

    For context, I operate the Codeforces Live Bot (Telegram bot) with currently ~9000 users. Fetching unofficial participants allows sending upsolving notifications when friends upsolve problems/ participate virtually, which is a fun feature and motivates CF users to solve more problems themselves.

    • »
      »
      »
      6 days ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      I agree with

      is a fun feature and motivates CF users to solve more problems themselves

    • »
      »
      »
      66 minutes ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      I would also greatly appreciate being able to get unofficial participants.

      A platform I have been developing which, among other things, calculates performance for all contests a user has participated in, now gives wrong results for the first few contests of a user. It seems like contestants are counted as unofficial participants if they have not competed in enough contests previously.

      I have also done my best to cache as much of the contest data as possible on my server to avoid hitting the Codeforces API unnecessarily :)

      The platform and GitHub link if anyone is interested:

      https://cf-insights.org

      https://github.com/Yuqzii/codeforces-insights

  • »
    »
    40 hours ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Hi MikeMirzayanov! Thanks so much for letting us know. Carrot is working again, as are other similar extensions. I am happily back to doing virtual contests, and I imagine the site will operate much better with your changes. Looking forward to see how this pans out in practice! Thanks for making Codeforces the great platform it is.