osu-api
osu-api copied to clipboard
feature request: username history
with the new website, there's a "formerly known as" thing next to a players username on user profiles. I'd like to get that username history with the API.
I suppose an array of previous usernames (like the previous_usernames
in the <script id="json-user" type="application/json">
script block on the website) in /get_user response would work well
What is the use case for this?
we're currently in the process of rewriting circle-people.com. On the skins page (https://circle-people.com/skins/) theres a bunch of people listed. Right now this is all manual work. If someone renames themselves they gotta be manually updated on that page as well.
The plan for the rewrite is when implementing that page again to have usernames be fetched from the api (so I only store user-ids). But one feature of the current page is that if a user has renamed we show the old name in parentheses behind it so that people who didn't notice the rename can still find said player.
So as a side-note, I would be happy enough with just one old username (like old osu-web does). But hey, if I can show all old ones (like on hover or something), why not?
Have you tried using the osu-web api out of curiosity? I think this is one feature we’re best waiting for the new API to come into play rather than adding to this v1 api.
I actually have not. I havent really looked into how to use that if im honest. I'm assuming with the osu-web api you mean the /api/v2/* endpoints, the one used by https://github.com/ppy/osu/blob/master/osu.Game/Online/API/APIRequest.cs?
I did play around a bit with the oauth stuff (I have a client on my name, id 11) but I havent used the v2 api. I looked into lazer code so I have a pretty good idea on how it is suppose to be used, just never got around trying it.
If this is a thing to be added to v2 api, at least I did not see it present there currently (I suppose I could even PR it myself xD), how "stable" should I assume those endpoints are gonna be? And with stable I mean feature-stable, not performance or anything.
ok, little update: I just now actually tried the v2 api and saw api/v2/users/:user_id
indeed does return an array of prev usernames. So I guess I can use that.
Except I created an access token through my own client (id 11), and I guess for things like this I need a long lived personal access token? (https://laravel.com/docs/5.7/passport#personal-access-tokens) which I could not figure out how to create (POST to /oauth/personal-access-tokens
resulted in denied error).
Maybe im doing things completely the wrong way, if so please correct me xD
I created a client follow the documentation of laravel. And got a access_token .But with this token ,I can only access api/v2/me. All other API mentioned in web.php return 403. Did I do something in a wrong way or the api is supposed to be like this.
To access the other methods you will need to specify a different scope. Currently there are only limited scopes (we restricted it as a security measure) but keep a watch for proper documentation in the near future.