PHPackages                             iamirnet/xtcom - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. iamirnet/xtcom

ActiveLibrary[API Development](/categories/api)

iamirnet/xtcom
==============

PHP SDK for xt.com

1.0.3(4y ago)0181Apache-2.0PHP

Since Mar 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/iamirnet/xt.com)[ Packagist](https://packagist.org/packages/iamirnet/xtcom)[ Docs](https://php.iamir.net/packages/xtcom)[ RSS](/packages/iamirnet-xtcom/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

[![Latest Version](https://camo.githubusercontent.com/bac49e8d3a761216fe9684f20978552defa99002c42cd67cabd8f32295699c78/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f69616d69726e65742f78742e636f6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/iamirnet/xt.com/releases)[![GitHub last commit](https://camo.githubusercontent.com/1c0cfa1a4ba81bac08383518b7390b7f475ec54747cffb11fa128c4ebf6a00d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f69616d69726e65742f78742e636f6d2e7376673f7374796c653d666c61742d737175617265)](#)[![Packagist Downloads](https://camo.githubusercontent.com/1c4c49325f8ea311aef4bee2c75b1a63c87023c79af686b5acfb2768be478630/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69616d69726e65742f7874636f6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iamirnet/xtcom)

PHP XT API
==========

[](#php-xt-api)

This project is designed to help you make your own projects that interact with the [XT API](https://doc.xt.com/).

#### Installation

[](#installation)

```
composer require iamirnet/xtcom

```

 Click for help with installationInstall Composer
----------------

[](#install-composer)

If the above step didn't work, install composer and try again.

#### Debian / Ubuntu

[](#debian--ubuntu)

```
sudo apt-get install curl php-curl
curl -s http://getcomposer.org/installer | php
php composer.phar install

```

Composer not found? Use this command instead:

```
php composer.phar require "iamirnet/xtcom"

```

#### Installing on Windows

[](#installing-on-windows)

Download and install composer:

1.
2. Create a folder on your drive like C:\\iAmirNet\\XT
3. Run command prompt and type `cd C:\iAmirNet\XT`
4. `composer require iamirnet/xtcom`
5. Once complete copy the vendor folder into your project.

#### Getting started

[](#getting-started)

`composer require iamirnet/xtcom`

```
require 'vendor/autoload.php';
// config by specifying api key and secret
$api = new \iAmirNet\XT\Client("","");
```

=======

#### Trading Market Configuration [more...](https://doc.xt.com/#quotesgetMarketConfig)

[](#trading-market-configuration-more)

```
//Call this before running any functions
print_r($api->marketConfig(/* optional */"btc_usdt"));
```

#### Kline/Candlestick Data [more...](https://doc.xt.com/#quotesgetKLine)

[](#klinecandlestick-data-more)

```
//Call this before running any functions
print_r($api->kline("btc_usdt",/* Kline type is optional */ "1min",/* Since is optional */  0));
```

#### Aggregated Markets （Ticker) [more...](https://doc.xt.com/#quotesgetTicker)

[](#aggregated-markets-ticker-more)

```
//Call this before running any functions
print_r($api->bookTicker("btc_usdt"));
```

#### Latest Ticker of all Markets [more...](https://doc.xt.com/#quotesgetTickers)

[](#latest-ticker-of-all-markets-more)

```
//Call this before running any functions
print_r($api->bookPrices());
```

#### Market Depth Data [more...](https://doc.xt.com/#quotesgetDepth)

[](#market-depth-data-more)

```
//Call this before running any functions
print_r($api->depth("btc_usdt"));
```

#### Latest Market Transactions Record [more...](https://doc.xt.com/#quotesgetTrades)

[](#latest-market-transactions-record-more)

```
//Call this before running any functions
print_r($api->trades("btc_usdt"));
```

#### Get Server Time [more...](https://doc.xt.com/#tradegetServerTime)

[](#get-server-time-more)

```
//Call this before running any functions
print_r($api->getServerTime());
```

#### Get Trading (Spot) Account Assets [more...](https://doc.xt.com/#tradegetBalance)

[](#get-trading-spot-account-assets-more)

```
//Call this before running any functions
print_r($api->balances());
```

#### Get the Account Type [more...](https://doc.xt.com/#tradegetAccounts)

[](#get-the-account-type-more)

```
//Call this before running any functions
print_r($api->account());
```

#### Get Specific Account Assets [more...](https://doc.xt.com/#tradegetFunds)

[](#get-specific-account-assets-more)

```
//Call this before running any functions
$accountId = 2;
print_r($api->specificAccount($accountId));
```

#### Place a New Order [more...](https://doc.xt.com/#tradeorder)

[](#place-a-new-order-more)

###### Buy

[](#buy)

```
//Call this before running any functions
$quantity = 1;
$price = 0.0005;
print_r($api->buy("btc_usdt", $quantity, $price, "LIMIT"));
```

###### Sell

[](#sell)

```
//Call this before running any functions
$quantity = 1;
$price = 0.0006;
print_r($api->sell("btc_usdt", $quantity, $price, "LIMIT"));
```

#### Bulk Orders [more...](https://doc.xt.com/#tradebatchOrder)

[](#bulk-orders-more)

```
//Call this before running any functions
$data = [
    [
        "price" => 10000.123,
        "amount" => 0.1,
        "type" => 1    // 1, buy, 0 sell
    ],
    [
        "price" => 10000.123,
        "amount" => 0.1,
        "type" => 0    // 1, buy, 0 sell
    ],
];
print_r($api->bulkOrders("btc_usdt", $data));
```

#### Cancel an Order [more...](https://doc.xt.com/#tradecancel)

[](#cancel-an-order-more)

```
//Call this before running any functions
$orderId = 156387346384491;
print_r($api->cancel("btc_usdt", $orderId));
```

#### Cancel the Bulk Orders [more...](https://doc.xt.com/#tradebatchCancel)

[](#cancel-the-bulk-orders-more)

```
//Call this before running any functions
$data = [];
$data[] = 157154392122493;
$data[] = 157154392122494;
$data[] = 157154392122495;
$data[] = 157154392122496;
$data[] = 157154392122497;
print_r($api->bulkOrdersCancel("btc_usdt", $data));
```

#### Order Information [more...](https://doc.xt.com/#tradegetOrder)

[](#order-information-more)

```
//Call this before running any functions
$orderId = 156387346384491;
print_r($api->orderInfo("btc_usdt", $orderId));
```

#### Get Uncompleted Orders [more...](https://doc.xt.com/#tradegetOpenOrders)

[](#get-uncompleted-orders-more)

```
$openorders = $api->openOrders("btc_usdt",/* page is optional */ 1,/* pageSize is optional */  10);
print_r($openorders);
```

#### Get a batch of Orders Information [more...](https://doc.xt.com/#tradegetBatchOrders)

[](#get-a-batch-of-orders-information-more)

```
//Call this before running any functions
$data = [];
$data[] = 157154392122493;
$data[] = 157154392122494;
$data[] = 157154392122495;
$data[] = 157154392122496;
$data[] = 157154392122497;
print_r($api->bulkOrdersInfo("btc_usdt", $data));
```

#### Get Transaction Records [more...](https://doc.xt.com/#trademyTrades)

[](#get-transaction-records-more)

```
$mytrades = $api->myTrades("btc_usdt",
        /* limit is optional */ 200,
        /* Start Time is optional */  1626428273000,
        /* End Time is optional */  1626428873020,
        /* From ID is optional */  6821734611983271937);
print_r($mytrades);
```

Contribution
------------

[](#contribution)

- Give us a star ⭐
- Fork and Clone! Awesome
- Select existing [issues](https://github.com/iamirnet/xt.com/issues) or create a [new issue](https://github.com/iamirnet/xt.com/issues/new) and give us a PR with your bugfix or improvement after. We love it ❤️

Donate
------

[](#donate)

- USDT Or TRX: TUE8GiY4vmz831N65McwzZVbA9XEDaLinn 😘❤

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

4

Last Release

1487d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1670938?v=4)[Peyman Jahani](/maintainers/jahani)[@jahani](https://github.com/jahani)

---

Top Contributors

[![iamirnet](https://avatars.githubusercontent.com/u/68027783?v=4)](https://github.com/iamirnet "iamirnet (18 commits)")

---

Tags

phpxtapixtsdkxtxt.com

### Embed Badge

![Health badge](/badges/iamirnet-xtcom/health.svg)

```
[![Health](https://phpackages.com/badges/iamirnet-xtcom/health.svg)](https://phpackages.com/packages/iamirnet-xtcom)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
