# 获取WHXEX数据

## 获取WHXEX数据

### <mark style="color:blue;">**REST API Baseurl ：**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**`https://openapi.whxex.com`**</mark>

### \[Trade ] <a href="#jiao-yi-lie-biao-jie-kou-trade" id="jiao-yi-lie-biao-jie-kou-trade"></a>

The trades endpoint is to return data on all recently completed trades for a given market pair.

**Path：** /open/pub/trades

**Method：** GET

**Description：**

```
{
	"code": "0",
	"msg": "suc",
	"message": null,
	"data": {
		"date": 1574735405297,
		"trades": [
                        {
				"tradeID": 3523643,
				"price": "0.01",
				"base_volume": "569000",
				"quote_volume": "0.01000000",
				"trade_timestamp": "1566360780",
				"type": "sell"
			},
			{
				"tradeID": 3523642,
				"price": "0.01",
				"base_volume": "569000",
				"quote_volume": "0.01000000",
				"trade_timestamp": "1566360780",
				"type": "sell"
			}
		]
	}
}
```

#### **Parameters**

N/A

**Query**

| Parameter Name | Required | example | Note         |
| -------------- | -------- | ------- | ------------ |
| base           | YES      | btc     |              |
| quote          | YES      | usdt    |              |
| trades         | NO       | 100     | Default 100. |

**Response:**

| Name                | Type       | Required | Default | Note                             | Other             |
| ------------------- | ---------- | -------- | ------- | -------------------------------- | ----------------- |
| code                | string     | NO       |         |                                  |                   |
| msg                 | string     | NO       |         |                                  |                   |
| message             | null       | NO       |         |                                  |                   |
| data                | object     | NO       |         |                                  |                   |
| ├─ date             | number     | NO       |         |                                  |                   |
| ├─ trades           | object \[] | NO       |         |                                  | item Type: object |
| ├─ tradeID          | number     | YES      |         | Transaction ID                   |                   |
| ├─ price            | string     | YES      |         | Price                            |                   |
| ├─ base\_volume     | string     | YES      |         | base currency transaction Volume |                   |
| ├─ quote\_volume    | string     | YES      |         | quto Currency Transaction Volume |                   |
| ├─ trade\_timestamp | string     | YES      |         | Timestamp                        |                   |
| ├─ type             | string     | YES      |         | sell/buy                         |                   |

### \[Ticker] <a href="#bi-dui-hang-qing-jie-kou-ticker" id="bi-dui-hang-qing-jie-kou-ticker"></a>

The ticker endpoint is to provide a 24-hour pricing and volume summary for each market pair available on the exchange.

**Path：** /open/pub/ticker

**Method：** GET

**Description：**

```
{
	"code": "0",
	"msg": "suc",
	"message": null,
	"data": {
		"date": 1574735405297,
		"ticker": {
			"BTC_USDT": {
				"base_id": "1",
				"quote_id": "825",
				"last_price": "10000",
				"quote_volume": "20000",
				"base_volume": "2"
			},
			"LTC_BTC": {
				"base_id": "2",
				"quote_id": "1",
				"last_price": "0.00699900",
				"base_volume": "20028,526",
				"quote_volume": "279594"
			}
		}
	}
}
```

#### **Parameters** <a href="#id-19" id="id-19"></a>

N/A

**Response:**

| Name             | Type   | Required | Default | Note                              | Other |
| ---------------- | ------ | -------- | ------- | --------------------------------- | ----- |
| code             | string | NO       |         |                                   |       |
| msg              | string | NO       |         |                                   |       |
| message          | null   | NO       |         |                                   |       |
| data             | object | NO       |         |                                   |       |
| ├─ date          | number | NO       |         |                                   |       |
| ├─ ticker        | object | NO       |         |                                   |       |
| ├─ BTC\_USDT     | object | NO       |         |                                   |       |
| ├─ base\_id      | string | NO       |         | base currency ID                  |       |
| ├─ quote\_id     | string | NO       |         | quto currencyID                   |       |
| ├─ last\_price   | string | NO       |         | Latest Trading Price              |       |
| ├─ quote\_volume | string | NO       |         | quto Currency Transaction Volumes |       |
| ├─ base\_volume  | string | NO       |         | base Currency Transaction Volumes |       |
| ├─ LTC\_BTC      | object | NO       |         |                                   |       |
| ├─ base\_id      | string | NO       |         | base currency ID                  |       |
| ├─ quote\_id     | string | NO       |         | quto currency ID                  |       |
| ├─ last\_price   | string | NO       |         |                                   |       |
| ├─ base\_volume  | string | NO       |         |                                   |       |
| ├─ quote\_volume | string | NO       |         |                                   |       |

### \[Asset] <a href="#bi-zhong-lie-biao-jie-kou-asset" id="bi-zhong-lie-biao-jie-kou-asset"></a>

The assets endpoint is to provide a detailed summary for each currency available on the exchange.

**Path：** /open/pub/asset

**Method：** GET

**Description：**

```
{
	"code": "0",
	"msg": "suc",
	"message": null,
	"data": {
		"date": 1574735405297,
		"asset": {
			"BTC": {
				"name": "bitcoin",
				"unified_cryptoasset_id": "1",
				"can_withdraw": "true",
				"can_deposit": "true",
				"min_withdraw": "0.01",
				"max_withdraw ": "100"
			},
			"ETH": {
				"name": "bitcoin",
				"unified_cryptoasset_id": "1027",
				"can_withdraw": "true",
				"can_deposit": "true",
				"min_withdraw": "0.01",
				"max_withdraw ": "100"
			}
		}
	}
}
```

#### **Parameters** <a href="#id-19" id="id-19"></a>

N/A

**Response:**

| Name                        | Type   | Required | Default | Note                      | Other |
| --------------------------- | ------ | -------- | ------- | ------------------------- | ----- |
| code                        | string | NO       |         |                           |       |
| msg                         | string | NO       |         |                           |       |
| message                     | null   | NO       |         |                           |       |
| data                        | object | NO       |         |                           |       |
| ├─ date                     | number | NO       |         |                           |       |
| ├─ asset                    | object | NO       |         |                           |       |
| ├─ BTC                      | object | NO       |         |                           |       |
| ├─ name                     | string | NO       |         | Currency Full Name        |       |
| ├─ unified\_cryptoasset\_id | string | NO       |         | Currency ID               |       |
| ├─ can\_withdraw            | string | NO       |         | is open the withdrawal    |       |
| ├─ can\_deposit             | string | NO       |         | is to open the deposit    |       |
| ├─ min\_withdraw            | string | NO       |         | Minimum Withdrawal Amount |       |
| ├─ max\_withdraw            | string | NO       |         | Maximum Withdrawal Amount |       |
| ├─ ETH                      | object | NO       |         |                           |       |
| ├─ name                     | string | NO       |         |                           |       |
| ├─ unified\_cryptoasset\_id | string | NO       |         | Currency ID               |       |
| ├─ can\_withdraw            | string | NO       |         |                           |       |
| ├─ can\_deposit             | string | NO       |         |                           |       |
| ├─ min\_withdraw            | string | NO       |         |                           |       |
| ├─ max\_withdraw            | string | NO       |         |                           |       |

### \[OrderBook] <a href="#pan-kou-shu-ju-jie-kou-orderbook" id="pan-kou-shu-ju-jie-kou-orderbook"></a>

The order book endpoint is to provide a complete level 2 order book (arranged by best asks/bids) with full depth returned for a given market pair.

**Path：** /open/pub/orderbook

**Method：** GET

**Description：**

```
{
	"code": "0",
	"msg": "suc",
	"message": null,
	"data": {
		"date": 1574735405297,
		"orderbook": {
			"bids": [
				["12462000", "0.04548320"],
				["12457000", "3.00000000"]
			],
			"asks": [
				["12506000", "2.73042000"],
				["12508000", "0.33660000"]
			]
		}
	}
}
```

#### **Parameters** <a href="#id-19" id="id-19"></a>

N/A

**Query**

| Parameter Name | Required | Example | Note      |
| -------------- | -------- | ------- | --------- |
| base           | YES      | btc     | btc       |
| quote          | YES      | usdt    | usdt      |
| depth          | NO       | 0,1,2   | Default 0 |
| bids           | NO       | 150     |           |
| asks           | NO       | 150     |           |

**Response:**

| Name         | Type      | Required | Default | Note | Other            |
| ------------ | --------- | -------- | ------- | ---- | ---------------- |
| code         | string    | NO       |         |      |                  |
| msg          | string    | NO       |         |      |                  |
| message      | null      | NO       |         |      |                  |
| data         | object    | NO       |         |      |                  |
| ├─ date      | number    | NO       |         |      |                  |
| ├─ orderbook | object    | NO       |         |      |                  |
| ├─ bids      | array \[] | NO       |         |      | item Type: array |
| ├─           |           | NO       |         |      |                  |
| ├─           |           | NO       |         |      |                  |
| ├─ asks      | array \[] | NO       |         |      | item Type: array |
| ├─           |           | NO       |         |      |                  |
| ├─           |           | NO       |         |      |                  |

### **\[SUMMARY]**

The summary endpoint is to provide an overview of market data for all tickers and all market pairs on the exchange.

**Path：** /open/api/get\_allticker

**Method：** GET

**Description：**

#### **Parameters** <a href="#id-19" id="id-19"></a>

N/A

**Response:**

| Name      | Type       | Required | Default | Note                            | Other             |
| --------- | ---------- | -------- | ------- | ------------------------------- | ----------------- |
| code      | string     | NO       |         |                                 | mock: 0           |
| msg       | string     | NO       |         |                                 | mock: suc         |
| data      | object     | NO       |         |                                 |                   |
| ├─ date   | number     | NO       |         | Server time when returning data |                   |
| ├─ ticker | object \[] | NO       |         |                                 | item Type: object |
| ├─ symbol | string     | YES      |         | Trading pair                    |                   |
| ├─ high   | string     | YES      |         | High Price                      |                   |
| ├─ low    | string     | YES      |         | Low Price                       |                   |
| ├─ buy    | number     | YES      |         | Buy price                       |                   |
| ├─ sell   | number     | YES      |         | Sell Price                      |                   |
| ├─ vol    | string     | YES      |         | 24H Trade Volume                |                   |
|           |            |          |         |                                 |                   |
| ├─ last   | number     | YES      |         | Latest Price                    |                   |
| ├─ rose   | string     | YES      |         | Change(24H)                     |                   |

#### &#x20;<a href="#u83b7u53d6u884cu60c5u6210u4ea4u8bb0u5f550a3ca20id3du83b7u53d6u884cu60c5u6210u4ea4u8bb0u5f553e203ca3e" id="u83b7u53d6u884cu60c5u6210u4ea4u8bb0u5f550a3ca20id3du83b7u53d6u884cu60c5u6210u4ea4u8bb0u5f553e203ca3e"></a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whxex.gitbook.io/api/docs-zh/huo-qu-whxex-shu-ju.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
