Search by

wiredspast / habbo-api-wrapper-php

An API wrapper for Habbo

Maintainers

Package info

github.com/Habbo-API-Wrappers/Habbo-API-Wrapper-PHP

pkg:composer/wiredspast/habbo-api-wrapper-php

Transparency log

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-08-31 22:39 UTC

This package is auto-updated.

Last update: 2026-08-31 22:40:52 UTC


README

A lightweight, PSR-compliant PHP wrapper for the Habbo API.

Installation

Install the package via Composer:

composer require wiredspast/habbo-api-wrapper-php

Note: This library requires a PSR-18 HTTP client (such as Guzzle) and a PSR-17 HTTP factory. If your project doesn't already have one, install Guzzle:

composer require guzzlehttp/guzzle

Basic Usage

Initializing the API Client

Import the primary API class and your desired hotel configuration:

use Wiredspast\HabboApiWrapperPhp\HabboPublicAPI;
use Wiredspast\HabboApiWrapperPhp\Param\Hotel;

// Create an instance targeting the .COM hotel
$api = HabboPublicAPI::fromHotel(Hotel::COM);

Accessing Standard Endpoints

Once instantiated, use the resource methods to query public data, for example:

// Fetch achievements list
$achievements = $api->achievements()->all();

// Fetch room details by ID
$room = $api->rooms()->byId($roomId);

Wired Variables Endpoints

To interact with WIRED variables, call the variables() method on your API instance with the room ID and your read/write keys:

$varApi = $api->variables($roomId, $wiredReadKey, $wiredWriteKey);

// Access variable data for the specified room
$allVarNames = $varApi->listAll();
$userVarProfile = $varApi->user()->getProfileByUsername('WiredSpast');

Error Handling

API requests throw custom exceptions on failure. Wrap your calls in a try/catch block:

use Wiredspast\HabboApiWrapperPhp\Exceptions\HabboApiException;
use Psr\Http\Client\ClientExceptionInterface;

try {
    $room = $api->rooms()->byId($roomId);
} catch (HabboApiException $e) {
    // Handle API-specific errors (e.g., 404 Not Found, 500 Server Error)
} catch (ClientExceptionInterface $e) {
    // Handle network or transport issues
}

Supported Feature Overview

  • Public Endpoints:
    • Achievements
    • Badge owner count
    • Groups
    • Marketplace statistics
    • Ping
    • Rooms
    • Lists
    • Users
  • Variable Endpoints:
    • Read and manage permanent user variables
    • Read and manage permanent furni variables
    • Read and manage permanent global variables