forum

osu!api open beta

posted
Total Posts
90
Topic Starter
peppy
I've had an API available for a while but until now it has been on a private on-request basis. In order to try and make developing third party services which expand and support osu!, I have added an API key setup and started to document the API.

Reference:

osu!api wiki: http://github.com/peppy/osu-api/wiki
osu!api key management: http://osu.ppy.sh/p/api

Documentation will be expanded as I find time to do so! If anyone currently using the API is able to help expand the documentation then please do.
comentarinformal
Before I spam it with requests that might not exist, is there anything to get user's information?
(Also, is there anything to login users from this page in other places?)
Tom94

comentarinformal wrote:

Before I spam it with requests that might not exist, is there anything to get user's information?
(Also, is there anything to login users from this page in other places?)
There is /api/get_user

Gonna write an entry with the information I have about it.

EDIT: Done.
XPJ38
Is there a fair use limit? (e.g. no more than XX requests per day)

For get_user, I suppose there is a mode parameter for getting user information for Taiko, CtB and osu!mania? Or do I have to file an issue in GitHub? Nevermind, I found it, the parameter to add is called "m" :D I have edited the GitHub wiki.
Repflez
So is out...

Oh well. I have some questions:

Are only the beatmap and user endpoints available?
The parameter "since" in /get_beatmap how I need to pass the time on it? UTC or unix timestamp?
Do I need to pass the key on the wiki's API too?
Edit: What the countX values mean? Number of beatmaps?
Topic Starter
peppy
@XPJ38: see doc.

@Repflez:
since = mysql date
wiki api = ?
everything else you asked is in the doc.
Topic Starter
peppy

comentarinformal wrote:

Before I spam it with requests that might not exist, is there anything to get user's information?
(Also, is there anything to login users from this page in other places?)
"spamming" with requests is considered "evil" use. you may be banned from the api and/or osu! for doing so. the api is not provided to retrieve a full set of information. it is provided to do lookups when necessary.
BloodCat2789
I'd like to know beatmap's mode on get_beatmaps request.
Isn't it possible?
Hexide
Minor gripe: Please return integers as such.
Topic Starter
peppy
All requests and bugs should be filed on github: https://github.com/peppy/osu-api/issues
Hexide
Any rate limits?
Topic Starter
peppy
See doc.
Arnold0
With this now open, is getting data from http://osu.ppy.sh/pages/include/profile ... id&m=$mode will be still possible or it may becaume unavaillable ?
(Lazy to change my PHP code *o*)
Topic Starter
peppy
Please switch to using the API. Please please please. That page you are using will no doubt change in the future and cause you more grief than if you spend a bit of time and make your code use the new API.
Damnae
I guess I'll update my userbar too when I find some time.

Before I apply and pick a name that cannot be changed, is the API key going to be global to my osu! account or is it set up in a way that I can have a second API key if I make another app/tool ?
Topic Starter
peppy
For now it's one per account.
Arnold0

Damnae wrote:

I guess I'll update my userbar too when I find some time.

Before I apply and pick a name that cannot be changed, is the API key going to be global to my osu! account or is it set up in a way that I can have a second API key if I make another app/tool ?
I registered it for osu!userbar, but I also use it for my "Big ugly white signature", they are not on the same webserver, but it works fine :)
I belive only you and peppy can see the name you used, too.

(Yes I took my lazyness off, it was not that long to update ^^)
Winshley
@Repflez: I tried using your API-powered signature and I get something weird.



Since I only aim for SS, I have 100% Accuracy all the time, and the Accuracy display is weird.

(I now know that despite having all-SS records, the note hit count for getting 50s and 100s are still counted all the time :P)
Repflez

Winshley wrote:

@Repflez: I tried using your API-powered signature and I get something weird.



Since I only aim for SS, I have 100% Accuracy all the time, and the Accuracy display is weird.

(I now know that despite having all-SS records, the note hit count for getting 50s and 100s are still counted all the time :P)
So that's what the CountX values mean. Thanks for that. I already went and changed the accuracy to show a centered "100% Accuracy" if it's 100. Forget that. I ditched the bar on it and used the extra space for showing the PP.

(I love how the 300 count ended overlaping the border)
Winshley

Repflez wrote:

So that's what the CountX values mean. Thanks for that.
Yeah. At first I thought that there was something wrong with the API showing 50s and 100s despite having 100% Accuracy, until I actually calculated all 300s + 100s + 50s = "Total Hits" on our profile. :P

About the 300 overlap though, it does need some fix:


When you reached 10 millions of 300 hits, the last number is cut off. Cookiezi has 17 millions of 300 hits.

And an extra:

I'm not sure how the level bar breaking happens though... I was thinking that it probably because I don't have any ranked score on osu!mania? :?
Repflez

Winshley wrote:

When you reached 10 millions of 300 hits, the last number is cut off. Cookiezi has 17 millions of 300 hits.
I plan to change that to the Total Hit Count once I finish with some things with the API interface that the image uses.

Winshley wrote:

I'm not sure how the level bar breaking happens though... I was thinking that it probably because I don't have any ranked score on osu!mania? :?
The API says that you "full" stats in osu!mania:
SPOILER
Array
(
[0] => Array
(
[user_id] => 864895
[username] => Winshley
[count300] => 7164
[count100] => 23
[count50] => 12
[playcount] => 338
[ranked_score] => 0
[total_score] => 144063600
[pp_rank] => 0
[level] => 28.0984
[pp_raw] => 0
[accuracy] => 0
[country] => ID
)

)

Probably the stats didn't got cleared after the score clear when the mode went gold so the API returns what it has. I'll go raise an issue to peppy when I have the time. issue #9

About the bar... Yeah, that's a bug. The formula to calculate the width of the bar is flawed:
number_format(substr(unround_number($user[level],true),0,3)*0.264,0)

That means: The first 3 decimals of $user[level] * 0.264 and the result gets rounded.

In your case is making this operation: 98 * 0.264 which is returning a width of 26 (The actual result is 25.872 but I round it) and it expects to be at least 71 for some reason and since the result is lower, the entire bar went backwards. I blame ImageFilledRectangle for that bug.
Avail_old_1
old

Still loads to do though :>

EDIT:

Available online for all you people at http://availu.net/osu/
Don't mind the ugly generator looks, still working on stylizing it.
Topic Starter
peppy
@Avail: you are currently doing *no* caching. That means every time that image is displayed, it is consuming huge resources on your server (and doing an underlying API call to osu!). best work on that if you plan on letting many people use it :p.
Winshley
I'm curious... in osu!mania, what are count300, count100, and count50 based from? Is it MAX, 300, and 200 respectively? If so, how to get the remaining hits though (e.g: 100 and 50)?
Avail_old_1

peppy wrote:

@Avail: you are currently doing *no* caching. That means every time that image is displayed, it is consuming huge resources on your server (and doing an underlying API call to osu!). best work on that if you plan on letting many people use it :p.
I plan on adding caching, if I ever learn how to.
Piotrekol
If you really have no idea how to do caching then I highly recommend that you at least use this: t/141331
Frizz
Just recently found this. Pretty cool, helps me a lot to gather information and whatnot. But I got questions to ask:
1. Is it possible to get more than 5 events/recent activities from /api/get_user? Since profile page offers more than the API does.
2. Pretty much just a suggestion. Perhaps can you add the information about infringements into /api/get_user?
Topic Starter
peppy
Please request additions on the github issues page!
Menchi
Ohhh!! :D
-Sandy Corzeta-
This like an almost a year threads, i don't know where do i ask about API things, most of users push me to the forum. And i don't know if this would be answered or not, but i kinda like to ask something..

The API stats for osu!Mania,
in the game there is a 200 Hit, but in stats there is no such thing for that...
so is that means 200 count as 300 hit on the stats? ... thank you !

#48 issues on GitHub
QuestCube
Is it possible to get API access for WIP projects, even if now official website exists yet?

If not, how likely is it to get the API access request accepted? I don't wan't to finish a project and then not being able to publish it because the api request was denied.
Topic Starter
peppy
go for it. it's automated.
QuestCube
Great, thanks!
Repflez
I want to request something (not an API request but some data). Can someone send me some of their cached hits on /api/get_match? I want to do (or try) something related to multiplayer matches but I need some data to test with, especially matches with FreeMod because I want to make sure that I did the mod enum right on my application.
Corin
Could we have the old "previously known as" field that used to be in the profile page in the API?
Would be quite useful seeing as it's not even in the users profile anymore.
Topic Starter
peppy
what for? and it is still in user profiles
Corin

peppy wrote:

what for? and it is still in user profiles
Say some guys app tracks names primarily (me, it cycles through logs for usernames not UIDs and editing the username to UID would use way too much in resources and would break logging, unless you want logs like <39283> Hi there greg) it'd make migrating a user from the old username to the new much easier/faster. As for the user profile, a quick view of source tells me I'm dumb and I need to hover over the username, didn't know that. Whoops.
Topic Starter
peppy
Logging based on username is horribly wrong. You should be using user id from the start..
Corin

peppy wrote:

Logging based on username is horribly wrong. You should be using user id from the start..
Not as easy as that seeing how my stuff comes directly from IRC with no middleman for conversion. If there was a version of Bancho that used UID; I'd use it and create a postprocessor for converting the UID to real name but its a pain creating a preprocessor to convert to UID and a postprocessor to convert from for human readable format especially seeing the quantity people talk in all channels and the amount of API calls that'll be, even with caching it'll still be heavy.

Probably phrased that wrong as I'm typing this from my phone but you get my drift.
show more
Please sign in to reply.

New reply