Check for Recolored Furni

javascriptjqueryphpfurni-api

Use Javascript
Make your request like this.


<script type="text/javascript">
    $(function(){
        $.getJSON('https://api.socialhabbo.com/furni?per_page=30', function(furnis){
        
            $.each(furnis.data, function(key, furni){
                if(furni.colors.length > 0){
                    $.each(furni.colors, function(color_key, color){
                        // Replace Image or Icon, depending on your needs
                        $('div#furni').append('<img src="https://api.socialhabbo.com/furni/' + furni.code + '/image?color=' + color.color_id + '" />');
                    });
                }else{
                    // Replace Image or Icon, depending on your needs
                    $('div#furni').append('<img src="https://api.socialhabbo.com/furni/' + furni.code + '/image" />');
                }
            });
        });
    });
</script>

Use PHP
Make your request like this.


<?php
    $furnis = json_decode(file_get_contents('https://api.socialhabbo.com/furni?per_page=30'), true);
    
    foreach($furnis['data'] as $furni){
        if(count($furni['colors']) > 0){
            foreach($furni['colors'] as $color){
            	// Replace Image or Icon, depending on your needs
                echo '<img src="https://api.socialhabbo.com/furni/' . $furni['code'] . '/image?color=' . $color['color_id'] . '" />';
            }
        }else{
            // Replace Image or Icon, depending on your needs
            echo '<img src="https://api.socialhabbo.com/furni/' . $furni['code'] . '/image" />';
        }
        
    }
    
?>


Use of Furni Directions

htmlfurni-api

Include HTML
Make your <img> tag like this.

<img src="https://api.socialhabbo.com/furni/code/image?direction=2"> <!-- Code will be the one given by our API -->


Use of Furni Colors

htmlfurni-api

Include HTML
Make your <img> tag like this.

<img src="https://api.socialhabbo.com/furni/code/image?color=2"> <!-- Code will be the one given by our API -->