Add previous record info to /times/worldrecord #6

Open
opened 2025-06-28 22:58:59 +00:00 by fiveman1 · 5 comments

It would be very nice if /times/worldrecord could include the previous record as part of the response. A common use case I have is displaying world records/globals. I can load 100 world records with 1 API call, but in order to load what the previous world record was, it will be 1 API call per record. It's very nice to be able to show what the previous world record was at a glance so people can have a better idea of how good a world record is and just for additional context.

It would be very nice if /times/worldrecord could include the previous record as part of the response. A common use case I have is displaying world records/globals. I can load 100 world records with 1 API call, but in order to load what the previous world record was, it will be 1 API call per record. It's very nice to be able to show what the previous world record was at a glance so people can have a better idea of how good a world record is and just for additional context.
Owner

How about the top 5 in a list of objects that looks like this:

[{
  "game_id": 1,
  "style_id": 1,
  "mode_id": 0,
  "map": <map>,
  "times": [
    {
      "id": 1,
      "rank": 1,
      "time": 9500,
      "has_bot": true,
      "user": <user>
    },
    {
      "id": 2,
      "rank": 2,
      "time": 10200,
      "has_bot": false,
      "user": <user>
    },
    ...
  ]
}]

Will nuke the wr endpoint and make it top or something

How about the top 5 in a list of objects that looks like this: ```json [{ "game_id": 1, "style_id": 1, "mode_id": 0, "map": <map>, "times": [ { "id": 1, "rank": 1, "time": 9500, "has_bot": true, "user": <user> }, { "id": 2, "rank": 2, "time": 10200, "has_bot": false, "user": <user> }, ... ] }] ``` Will nuke the wr endpoint and make it `top` or something
Author

That looks great to me! Make sure date still gets included, but yeah this is basically what I was looking for.

That looks great to me! Make sure date still gets included, but yeah this is basically what I was looking for.
Author

Adding onto this, I noticed that the WR endpoint doesn't support sorting. I figured that there's probably a technical reason for that, but it would be nice to have.

Adding onto this, I noticed that the WR endpoint doesn't support sorting. I figured that there's probably a technical reason for that, but it would be nice to have.
Owner

Given the previous structure, beyond most recent WR, what sorting options are you imagining?

Given the previous structure, beyond most recent WR, what sorting options are you imagining?
Author

The same sorts that /times/ has, date asc/desc and time asc/desc. Being able to see the oldest WRs is nice as well as the shortest and longest ones.

The same sorts that /times/ has, date asc/desc and time asc/desc. Being able to see the oldest WRs is nice as well as the shortest and longest ones.
itzaname added the Kind/Enhancement
Priority
Low
4
labels 2025-07-06 03:31:10 +00:00
Sign in to join this conversation.