Overview

Classes

  • Card
  • CardRegular
  • Component
  • ComponentAvatar
  • ComponentFlag
  • ComponentImage
  • ComponentLabel
  • ComponentXPBar
  • ErrorImage
  • OsuAPI
  • OsuSignature
  • PredefinedColours
  • Signature
  • Template
  • TemplateNormal
  • Utils
  • Overview
  • Class

Class OsuAPI

A class to access the osu! API. It queries the API at OsuAPI::API_URL.

Author: Lemmmy
Located at OsuAPI.php
Methods summary
public
# __construct( string $apiKey )

Creates a new instance of OsuAPI

Creates a new instance of OsuAPI

Parameters

$apiKey
Your private osu!API key
public array|boolean
# getUserForMode( string $username, string $mode = "osu" )

Gets user information for a specific game mode

Gets user information for a specific game mode

Parameters

$username
The player's username
$mode
$mode] The game mode

Returns

array|boolean
public array|null
# request( string $url, array $params = [] )

Request from the osu!API

Request from the osu!API

Parameters

$url
The resource to fetch
$params
A list of arguments to give for the resource

Returns

array|null
The decoded JSON object containing the fetched resource, or null.
protected array|null
# decode( string $content )

Decode a response from the API

Decode a response from the API

Parameters

$content
The response from the API

Returns

array|null
The decoded JSON object, or null.
Constants summary
string API_URL
# "https://osu.ppy.sh/api/"
API documentation generated by ApiGen