CSharpOsuAPI - fully asynchronous library to work with osu! API V1 (An update for V2 is coming soon)
First, create an instance of the client to work with:
//Creating new instance of osuClient
osuApiClient osuClient = new osuApiClient( " your_token" ) ;
All the functions of osu!API V1 have been integrated into the library. Here is an example of how to use it:
//Getting user
var user = osuClient. GetUserAsync ( " Shoukko" ) . Result;
Console. WriteLine ( $" Username: { user. Username} \n PPCount: { user. PPRaw} \n " ) ;
//Getting beatmap
var beatmap = osuClient. GetBeatmapsAsync ( 1811527 ) . Result. First ( ) ;
Console. WriteLine ( $" BM Name: { beatmap. Title} \n BM Diff: { beatmap. Difficultyrating} \n " ) ;
//Getting scores
var scores = osuClient. GetScoresAsync ( 1811527 , " Shoukko" , type: EUserType. String) . Result;
Console. WriteLine ( $" Score's date: { scores. First ( ) . Date} \n Score's pp: { scores. First ( ) . PP} \n " ) ;
//Getting user's best scores
var bestScores = osuClient. GetUserBestScoresAsync ( " Shoukko" , type: EUserType. String) . Result;
Console. WriteLine ( $" The best score: { bestScores. First ( ) . PP} \n " ) ;
//Getting user's recent scores
var recentScores = osuClient. GetUserRecentScoresAsync ( " Shoukko" , type: EUserType. String) . Result;
Console. WriteLine ( $" Recent scores count: { recentScores. Length} \n " ) ;
//Getting information about multiplayer match
var multiplayerMatch = osuClient. GetMultiplayerMatchInfoAsync ( 107936575 ) . Result;
Console. WriteLine ( $" Multiplayer match name: { multiplayerMatch. Match. Name} \n Games count: { multiplayerMatch. Games. Length} \n " ) ;
//Getting replay
var replay = osuClient. GetReplayDataAsync ( 1690353 , " Shoukko" , EUserType. String) . Result;
Console. WriteLine ( $" Replay: { replay. Content. Substring ( 0 , 10 ) } ... (and a lot of characters) \n " ) ;