osu-api icon indicating copy to clipboard operation
osu-api copied to clipboard

[Idea] Possible to add an "only" parameter?

Open TheMeq opened this issue 8 years ago • 1 comments

Is it possible to add an optional "only" parameter to each of the API's? The request would limit or take out all the unneeded or unwanted data, and may save upload bandwidth by not sending unneeded information to the client.

Say for example, I only wanted a users username, their current rank, and their current pp.

I would call it like this instead: string url = "https://osu.ppy.sh/api/get_user?k=__KEY__&u=TheMeq&m=0&only=username,pp_rank,pp_raw";

which would return: [{ "username" : "TheMeq", "pp_rank" : "20109", "pp_raw" : "3869.68" }]

This is probably a crap idea... but, it sounded good in my head...

Thanks.

TheMeq avatar Feb 23 '17 12:02 TheMeq

If you want more powerful queries, I'd advocate for something like GraphQL.

ekgame avatar Feb 23 '17 12:02 ekgame