forum

OsuAPI, find players through username [solved]

posted
Total Posts
3
Topic Starter
Vivago
With the OsuAPI you can "find" players through their id (https://osu.ppy.sh/ api/v2/users/2/), but is it also possible to find a player through their username instead, like on the osu website?

I'm currently writing a highscore-program where you can compare your stats to players of your chosing. But to add players the user would need to go to the osu website, find the player(s) he/she wants to add via username and then would need to copy the id from the profile link. This seems a little complicated to me.

Maybe anyone of you can help me to find an easier way.
RockRoller
You should be able to just use api/v2/users/{user} where {user} can be either an id or a username. The documentation does say id, but from looking at a friends projects code having {user} be the username should work.
Topic Starter
Vivago

RockRoller wrote:

You should be able to just use api/v2/users/{user} where {user} can be either an id or a username. The documentation does say id, but from looking at a friends projects code having {user} be the username should work.
Thank you, that works. When searching for scores the id-number is needed, but when searching for players the username can be used. So I can first search for the user to also get the id.
Please sign in to reply.

New reply