Cristian-Sknz / OusuAPI-v2

An OsuAPI v2 wrapper for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Osu Logo

A Osu API v2 Wrapper for Java

πŸ“Ž My Objective

With this improvised "API", I intend to use it in my projects. I would not release it in open source. I decided to leave the source code released because I had trouble finding a Java Wrapper that worked correctly. I hope you enjoy the basic functions of this API

Sorry my english :3

πŸ“€ Dependencies

The dependencies are inside build.gradle

πŸ“° Add your dependencies!

  • Gradle
repositories {
     maven { url 'https://jitpack.io' }
}

dependencies {
     implementation 'com.github.Cristian-Sknz:OusuAPI-v2:VERSION'
}
  • Maven
<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

<dependency>
    <groupId>com.github.Cristian-Sknz</groupId>
    <artifactId>OusuAPI-v2</artifactId>
    <version>VERSION</version>
</dependency>

πŸ‘¨β€πŸ« Simple Use

I recommend that you read the official Documentation to know the limits of the API and among other things

API Reference

*️⃣ Create a Token

πŸ“„

/*
You MUST provide OAuth information to create a Token
*/
OsuAPI api = new OsuAPI(new OAuthApplication(0001, "CLIENT_SECRET", "REDIRECT_URI"));
APIRequest<Token> request = api.createToken("OAUTH_CODE");
Token token = request.get();

*️⃣ Resume Token

πŸ“„

/*
To resume a session, you do not need to use OAuth information
*/
OsuAPI api = new OsuAPI(null/*or new OAuthApplication(0001, "CLIENT_SECRET", "REDIRECT_URI") */);
APIRequest<Token> request = api.resumeToken("Bearer_Token");
Token token = request.get();

πŸ”— Using Token

πŸ“„

[...]
Token token = request.get();
Endpoint endpoint = token.getEndpoint();
APIRequest<User> request = endpoint.getUser(10906977, GameMode.Osu);
User user = request.get();

This project is not complete, I intend to update whenever I can. Thanks for reading me :D

About

An OsuAPI v2 wrapper for Java

License:MIT License


Languages

Language:Java 100.0%