1.0.5 • Published 3 years ago

osu-npm v1.0.5

Weekly downloads
112
License
ISC
Repository
github
Last release
3 years ago

npm npm install size

NPM

osu! NPM

Installation

npm i osu-npm

Access osu! data without an API key.

Argument Options

ArgumentOptionsDefinitions
usernameStringNumberString: UsernameNumber: User ID
typetexthtmltext: Returns data in text form (images don't show)html: Returns data in html form
gamemodeosu/standardtaikocatch/fruitsmaniaosu/standard: Returns data from the standard version of osu!taiko: Returns data from the taiko version of osu!catch/fruits: Returns data from the catch version of osu!mania: Returns data from the mania version of osu!
urlStringString: News page URL
indexNumberNumber: Index of the 10 most recent news posts
codeNumberNumber: Beatmap ID
diff_codeNumberNumber: Difficulty ID
leaderboardCodeNumberNumber: Choose a leaderboard typeget_leaderboard_codes(callback)
nNumberNumber: The number of players you want to get (below 50)
linkStringString: The URL of a specific osu! post
forumCodeNumberNumber: Choose a forum genreget_forums_codes(callback)
postStringString: The post URL of a specific post

Stream Functions


FunctionDescription
get_current_streams(callback)Gets the current osu! streams in progress
return_streams_page(callback)Gets the osu! streams page in HTML

Player Functions


FunctionDescription
get_player_about(username, type, callback)Gets the players about page
get_player_misc(username, callback)Gets the players miscellaneous data
get_player_scores(username, gamemode, callback)Gets the players score data
get_player_stats(username, gamemode, callback)Gets the players stats data

News Functions


FunctionDescription
return_specific_news_page(url, callback)Gets the HTML of a specific news page
return_news_page(callback)Gets the HTML of the osu! news page
get_news_at_index(index, callback)Get the news data at the specified index
get_most_recent_news(callback)Get the data of the most recent news
get_full_news_content(url, type, callback)Get the content of a specific news page

Map Functions


FunctionDescription
return_specific_mapset_difficulty(code, diff_code, callback)Get the HTML of a specific beatmapset difficulty
return_mapset_page(code, callback)Gets the HTML of a beatmap
get_mapset_difficulty_codes(code, callback)Get the difficulty codes of every difficulty
get_mapset_description(code, type, callback)Get the description of a beatmap
get_difficulty_stats(code, diff_code, callback)Get the difficulty stats of a difficulty (only standard for now)
get_beatmap_stats(code, callback)Get the beatmaps information

Leaderboard Functions


FunctionDescription
return_leaderboards_page(leaderboardCode, callback)Get the HTML of a specific leaderboard
get_n_leaderboard_spots(leaderboardCode, n, callback)Get the top n players
get_leaderboard_codes(callback)Get which number is equal to which leaderboard type

Forums Functions


FunctionDescription
return_post_page(link, callback)Get the HTML of a specific post
return_forums_page(forumCode, callback)Get the HTML of a specific forum
get_post_question(post, type, callback)Get post question
get_post_answers(post, callback)Coming soon...
get_newest_post(forumCode, callback)Get the newest post on a forum
get_forums_codes(callback)Get which number is equal to which forum genre

Contest Functions


FunctionDescription
return_contests_page(callback)Get the HTML of the contests page
get_contests_list(callback)Get an array of the newest contests

Examples

Await/Async example

const api = require('osu-npm')

async function test() {
    await api.get_contests_list(res => console.log(res))
}
      
test();

returns:

[
  {
    url: 'https://osu.ppy.sh/community/contests/115',
    title: 'A Labour of Love',
    date: 'November 30, 2020 - March 1, 2021',       
    type: 'beatmap'
  },
  {
    url: 'https://osu.ppy.sh/community/contests/114',
    title: 'Winter Sports 2020 Fanart Contest',      
    date: 'Ended December 6, 2020',
    type: 'art'
  },
  {
    url: 'https://osu.ppy.sh/community/contests/113',
    title: 'Monthly Beatmapping Contests 2020: #10',
    date: 'Ended',
    type: 'beatmap'
  },
...

NOTES

  • These results are NOT static and are getting scraped realtime whenever a function is run
  • This was based on Osu-Free-Api which was made in python

TODO

  • get_player_first_place_plays
  • get_player_socials
  • get_player_most_played_map
  • get_player_favorite_maps
  • Add paging arguments
  • Organize functions
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago