php-binance-api.php
public function depth(string $symbol, int $limit = 100)
    {
        if (is_int($limit) === false) {
            $limit = 100;
        }

        if (isset($symbol) === false || is_string($symbol) === false) {
            // WPCS: XSS OK.
            echo "asset: expected bool false, " . gettype($symbol) . " given" . PHP_EOL;
        }
        $json = $this->httpRequest("v1/depth", "GET", [
            "symbol" => $symbol,
            "limit" => $limit,
        ]);
        if (isset($this->info[$symbol]) === false) {
            $this->info[$symbol] = [];
        }
        $this->info[$symbol]['firstUpdate'] = $json['lastUpdateId'];
        return $this->depthData($symbol, $json);
    }
public function depth(string $symbol, int $limit = 100)
    {
        if (is_int($limit) === false) {
            $limit = 100;
        }

        if (isset($symbol) === false || is_string($symbol) === false) {
            // WPCS: XSS OK.
            echo "asset: expected bool false, " . gettype($symbol) . " given" . PHP_EOL;
        }
        $json = $this->httpRequest("v1/depth", "GET", [
            "symbol" => $symbol,
            "limit" => $limit,
        ]);
        if (isset($this->info[$symbol]) === false) {
            $this->info[$symbol] = [];
        }
        $this->info[$symbol]['firstUpdate'] = $json['lastUpdateId'];
        return $this->depthData($symbol, $json);
    }
public function depth ( string $ symbol , int $ limit = 100 ) { if ( is_int ( $ limit ) === false ) { $ limit = 100 ; } if ( isset ( $ symbol ) === false || is_string ( $ symbol ) === false ) { // WPCS: XSS OK. echo "asset: expected bool false, " . gettype ( $ symbol ) . " given" . PHP_EOL ; } $ json = $ this -> httpRequest ( "v1/depth" , "GET" , [ "symbol" => $ symbol , "limit" => $ limit , ] ) ; if ( isset ( $ this -> info [ $ symbol ] ) === false ) { $ this -> info [ $ symbol ] = [ ] ; } $ this -> info [ $ symbol ] [ 'firstUpdate' ] = $ json [ 'lastUpdateId' ] ; return $ this -> depthData ( $ symbol , $ json ) ; }
depth get Market depth

$depth = $api->depth("ETHBTC");

@param $symbol string the symbol to get the depth information for
@param $limit int set limition for number of market depth data
@return array with error message or array of market depth
@throws \Exception
depth get Market depth