{"id":18464587,"url":"https://github.com/moebits/osu.ts","last_synced_at":"2025-04-08T08:31:08.531Z","repository":{"id":35186372,"uuid":"216714075","full_name":"Moebits/osu.ts","owner":"Moebits","description":"Wrapper for the osu! API with typings","archived":false,"fork":false,"pushed_at":"2024-08-09T02:00:21.000Z","size":1281,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T05:51:11.646Z","etag":null,"topics":["api","hacktoberfest","osu","wrapper"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moebits.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-22T03:18:43.000Z","updated_at":"2024-08-09T02:00:25.000Z","dependencies_parsed_at":"2024-08-09T04:38:23.248Z","dependency_job_id":"d5d7505f-5ee5-43d1-8cb9-a4251aad8c1c","html_url":"https://github.com/Moebits/osu.ts","commit_stats":null,"previous_names":["moebits/osu.ts","tenpi/osu.ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fosu.ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fosu.ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fosu.ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fosu.ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moebits","download_url":"https://codeload.github.com/Moebits/osu.ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804390,"owners_count":20998969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","hacktoberfest","osu","wrapper"],"created_at":"2024-11-06T09:10:24.022Z","updated_at":"2025-04-08T08:31:08.118Z","avatar_url":"https://github.com/Moebits.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"left\"\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://moebits.github.io/osu.ts/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Moebits/osu.ts/master/images/osu.tslogo.gif\" width=\"500\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://nodei.co/npm/osu.ts/\"\u003e\u003cimg src=\"https://nodei.co/npm/osu.ts.png\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n### About\nThis is a wrapper for the osu! API that includes typings. You can also generate a signature using the osu!next signature generator and download the cover on a users profile, which is not available through the API.\n\n### Install\n```ts\nnpm install osu.ts\n```\n\n### Useful Links\n- [**Osu.ts Documentation**](https://moebits.github.io/osu.ts/)\n- [**Osu Api Wiki**](https://github.com/ppy/osu-api/wiki)\n\n### Getting Started\nYou will need to get an API Key in order to use the api, which can be requested here with your osu! account: \nhttps://osu.ppy.sh/p/api/\n\n#### Searching for beatmaps\n```ts\nimport Osu from \"osu.ts\"\n\nasync function useAPI() {\n    /*API Key is required.*/\n    const osu = new Osu(process.env.OSU_API_KEY)\n\n    /*You can get an entire beatmap set with its URL.*/\n    const beatmaps = await osu.beatmaps.get(\"https://osu.ppy.sh/beatmapsets/1022394\")\n\n    /*For a specific beatmap, you will need to add the #osu/(beatmap id) to the URL.\n    For easier typings, it still returns an array so use a .then chain to get the first item.*/\n    const beatmap = await osu.beatmaps.get(\"https://osu.ppy.sh/beatmapsets/1022394#osu/2139012\").then((b) =\u003e b[0])\n\n    /*Unfortunately, the api does not really provide great searching methods. But I might improve on it in \n    the future. Passing in no params will get the 500 most recent beatmaps.*/\n    const beatmapSearch = await osu.beatmaps.search()\n}\n```\n#### Searching for users\n```ts\nasync function useAPI() {\n    /*Getting a user is easy, just pass in their name or ID (which is parsed from the URL).\n    If for some reason the user's name is only numbers, its better to use the URL.*/\n    const user = await osu.users.get(\"vaxei\")\n    const userByURL = await osu.users.get(\"https://osu.ppy.sh/users/4787150\")\n\n    /*Getting the banner is not available in the API, but you can use fetchBanner() to retrieve it.\n    Optionally, if you pass in a path it will be downloaded to that location.*/\n    const banner = await osu.users.banner(\"vaxei\", \"./banner\")\n\n    /*You can also generate a signature using the osu!next signature generator. Important \n    parameters to pass are the uname and colour (yes, with a u). If you pass in a path it \n    will be downloaded to that location as well.*/\n    const sig = await osu.users.sig({uname: \"vaxei\", colour: \"#ff3381\"}, \"./sig\")\n}\n```\n#### Getting scores and replays\n```ts\nasync function useAPI() {\n    /*You can get a users best and recent scores.*/\n    const best = await osu.scores.best(\"vaxei\")\n    const recent = await osu.scores.recent(\"vaxei\")\n\n    /*And the scores on a beatmap.*/\n    const scores = await osu.scores.beatmap(\"https://osu.ppy.sh/beatmapsets/1013140#osu/2120669\")\n\n    /*You can download a replay by passing in the user, beatmap, and destination path. It will also\n    return the raw encoded data.*/\n    const replay = await osu.beatmaps.replay(\"vaxei\", \"https://osu.ppy.sh/beatmapsets/896080#osu/1872396\", \"./replays\")\n}\n```\n\n#### Common Types\n\n\u003cdetails\u003e\n\u003csummary\u003eOsuBeatmap\u003c/summary\u003e\n\n```ts\nexport interface OsuBeatmap {\n    beatmapset_id: string\n    beatmap_id: string\n    approved: string\n    total_length: string\n    hit_length: string\n    version: string\n    file_md5: string\n    diff_size: string\n    diff_overall: string\n    diff_approach: string\n    diff_drain: string\n    mode: string\n    count_normal: string\n    count_slider: string\n    count_spinner: string\n    submit_date: string\n    approved_date: string | null\n    last_update: string\n    artist: string\n    title: string\n    creator: string\n    creator_id: string\n    bpm: string\n    source: string\n    tags: string\n    genre_id: string\n    language_id: string\n    favourite_count: string\n    rating: string\n    download_unavailable: string\n    audio_unavailable: string\n    playcount: string\n    passcount: string\n    max_combo: string | null\n    diff_aim: string | null\n    diff_speed: string | null\n    difficultyrating: string | null\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOsuUser\u003c/summary\u003e\n\n```ts\nexport interface OsuUser {\n    user_id: string\n    username: string\n    join_date: string\n    count300: string\n    count100: string\n    count50: string\n    playcount: string\n    ranked_score: string\n    total_score: string\n    pp_rank: string\n    level: string\n    pp_raw: string\n    accuracy: string\n    count_rank_ss: string\n    count_rank_ssh: string\n    count_rank_s: string\n    count_rank_sh: string\n    count_rank_a: string\n    country: string\n    total_seconds_played: string\n    pp_country_rank: string\n    events: OsuEvent[]\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOsuScore\u003c/summary\u003e\n\n```ts\nexport interface OsuScore {\n    score_id: string\n    score: string\n    username: string\n    maxcombo: string\n    count50: string\n    count100: string\n    count300: string\n    countmiss: string\n    countkatu: string\n    countgeki: string\n    perfect: string\n    enabled_mods: string\n    user_id: string\n    date: string\n    rank: string\n    pp: string | null\n    replay_available: string\n}\n```\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoebits%2Fosu.ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoebits%2Fosu.ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoebits%2Fosu.ts/lists"}