logo

Steam Trades

PHP Client

Our PHP client provides convenient and complete access to our REST API.

Installation

The recommended way of embedding our PHP client is using PHP composer. If you're already using Composer for your project: perfect! Just add our entry to the require section of your composer.json. If you aren't: well, you really should be! It makes resolving dependencies a bliss.

copy
"require": {
    "steamtrades/public-api": "*"
}

If you prefer to do things the old-fashioned way for whatever reasons, feel free to just manually clone the client from our GitHub repository. It ships with a basic autoload.php that handles resolving imports for you.

copy
git clone https://github.com/SteamTrades/php-api-client

Using the client

With or without Composer, importing our client is as easy as:

copy
<?php

// Only ONE of the two options below is required.

// With Composer
require_once(__DIR__ . '/vendor/autoload.php');
// With our simple autoload.php
require_once(__DIR__ . '/php-api-client/autoload.php');

$api = new SteamTrades\Api\TradeApi();