forum

[Archived] Osu api java script

posted
Total Posts
3
Topic Starter
HandyCapey
Problem details: Hello I want to code an application in java script. The application is just used to type the name of a bitmap and its found in all the list

I started to look at the doc and I don't understand everything here is my javascript code





function osuBm() {
const url = new URL("https://osu.ppy.sh/api/v2/beatmaps/1");

let headers = {
"Accept": "application/json",
"Content-Type": "application/json",
}

fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
}

I launch the function in my html file by pressing a button
osu! version: Stable 20200104.8 (latest)
Death
API v2 requires Oauth2 authentication: https://docs.ppy.sh/#authentication

Pretty sure the endpoint you are trying to access doesn't have any scopes anyway though, so even if you manage to figure out how the authentication works you still wouldn't get a good response. You're probably better off using API v1 instead: https://github.com/ppy/osu-api/wiki
Topic Starter
HandyCapey
ok ty ^^

And do you know how I should use this line?
/api/get_beatmaps
Please sign in to reply.

New reply