Introducing osu-score-cache: An API and WebSocket for community devs to better fetch recent scores
Do you develop community apps for the osu! ecosystem? Do your apps need a constant stream of newly submitted scores or a deeper list of user or map recent scores? If so, osu-score-cache is for you!
osu-score-cache is a JSON API and real-time WebSocket providing access to osu!'s recently submitted passing scores. It stores days of score history, letting your app sync back up after downtime with no hiccups.
While the osu! API provides a Get Scores endpoint that returns recent passing scores, it has some shortcomings. This project expands on it by:
- Providing a real-time websocket that broadcasts new scores, allowing clients to receive events passively instead of polling osu! servers.
- Exposing a deeper history (up to 30 days) as opposed to only a couple days.
- Allowing navigation forwards and backwards in recent score history using timestamps instead of opaque query strings.
- Allowing you to fetch recent scores in all modes or a specific mode with a single request.
- Allowing you to filter recent scores for specific players or beatmaps (or both).
While oSC does poll the osu! API's Get Scores endpoint every 5 seconds to save and broadcast new scores, it aims to prevent other devs from doing the same, thus lightening the load on osu!'s own infrastructure.
Read the full documentation here: https://osc.kaysting.dev/
Or check out the GitHub repo: https://github.com/kaysting/osu-score-cache
Happy coding :)