online-judge icon indicating copy to clipboard operation
online-judge copied to clipboard

Deprecate API v1

Open Ninjaclasher opened this issue 3 years ago • 2 comments

We should consider deprecating API v1. There are some endpoints that dump megabytes of data and were not designed for the current size of DMOJ. Notably:

  1. https://dmoj.ca/api/user/list dumps all users (9MB at the time of writing)
  2. https://dmoj.ca/api/user/submissions/wleung_bvg (4.1MB at the time of writing)
  3. https://dmoj.ca/api/user/submissions/xyene (4.8MB at the time of writing)

API v2 contains all the data in v1 and has proper support for pagination, so we should be directing users to upgrade to v2.

Ninjaclasher avatar Feb 27 '22 18:02 Ninjaclasher

How should we go about deprecating exactly?

Riolku avatar Feb 27 '22 18:02 Riolku

We should probably put a deprecation notice into the JSON output and announce it on channels where people actually care, if we are doing this.

quantum5 avatar Feb 27 '22 18:02 quantum5

I did a survey today.

  • We have a consistent 4 requests a day to problem endpoints from a python-requests bot.
  • We have a 2 requests a day to contest endpoints from the same python-requests bot.
    • Notably, clist.by has migrated over to using the API v2 contest endpoint.
  • We have ~14K requests a day to user endpoints from what seems to be a bot tracking the submission activity of 7 users.

I think we can just go ahead and delete API v1.

Xyene avatar Jan 23 '23 06:01 Xyene