# GET Market Overview Data

### Description

This group of endpoints provides market-level overview data, including market temperature (valuation/sentiment), advance/decline distribution, global indexes, leading industries, and ranking configuration.

### Rate Limit

Shares the same rate limit with other endpoints. Refer to [API Rate Limits](https://docs.infoway.io/getting-started/api-limitation).

### Error Codes

Refer to [HTTP Error Codes](https://docs.infoway.io/getting-started/error-codes/http).

### Request Headers

| Parameter | Type   | Required | Description  |
| --------- | ------ | -------- | ------------ |
| `apiKey`  | String | Yes      | Your API Key |

### Supported Markets

`HK` (Hong Kong), `US` (United States), `CN` (China A-shares), `SG` (Singapore)

***

#### Market Temperature

Get market valuation and sentiment temperature (0-100), useful for gauging market heat.

**Endpoint**

* Base path: `/common/v2/basic/market/temperature`
* Full path: `https://data.infoway.io/common/v2/basic/market/temperature`

**Query Parameters**

| Parameter | Type   | Required | Description                                          | Example |
| --------- | ------ | -------- | ---------------------------------------------------- | ------- |
| `market`  | String | No       | Market codes, comma-separated. Default `HK,US,CN,SG` | `HK,US` |

**Response Example**

```json
{
  "markets": ["HK", "US"],
  "data": {
    "list": [
      {
        "market": "HK",
        "temp": "69",
        "temp_intro": "Temperature is moderate and rising",
        "valuation": "80",
        "sentiment": "58"
      },
      {
        "market": "US",
        "temp": "36",
        "valuation": "54",
        "sentiment": "18"
      }
    ]
  }
}
```

| Field        | Type   | Description                                  |
| ------------ | ------ | -------------------------------------------- |
| `market`     | String | Market code                                  |
| `temp`       | String | Overall temperature (0-100, higher = hotter) |
| `temp_intro` | String | Temperature description                      |
| `valuation`  | String | Valuation temperature                        |
| `sentiment`  | String | Sentiment temperature                        |

***

#### Market Breadth

Get advance/decline distribution statistics.

**Endpoint**

* Base path: `/common/v2/basic/market/breadth/{market}`
* Full path: `https://data.infoway.io/common/v2/basic/market/breadth/{market}`

**Path Parameters**

| Parameter | Type   | Required | Description | Example |
| --------- | ------ | -------- | ----------- | ------- |
| `market`  | String | Yes      | Market code | `HK`    |

**Response Example**

```json
{
  "market": "HK",
  "data": {
    "flatline": 928,
    "rise_less_than_three": 816,
    "rise_three_to_five": 200,
    "rise_five_to_seven": 110,
    "rise_more_than_seven": 128,
    "fall_less_than_three": 686,
    "fall_three_to_five": 154,
    "fall_five_to_seven": 69,
    "fall_more_than_seven": 88
  }
}
```

| Field                  | Type    | Description               |
| ---------------------- | ------- | ------------------------- |
| `flatline`             | Integer | Unchanged stocks          |
| `rise_less_than_three` | Integer | Stocks with <3% gain      |
| `rise_three_to_five`   | Integer | Stocks with 3%-5% gain    |
| `rise_five_to_seven`   | Integer | Stocks with 5%-7% gain    |
| `rise_more_than_seven` | Integer | Stocks with >7% gain      |
| `fall_less_than_three` | Integer | Stocks with <3% decline   |
| `fall_three_to_five`   | Integer | Stocks with 3%-5% decline |
| `fall_five_to_seven`   | Integer | Stocks with 5%-7% decline |
| `fall_more_than_seven` | Integer | Stocks with >7% decline   |

***

#### Global Indexes

Get a list of major global market indexes.

**Endpoint**

* Base path: `/common/v2/basic/market/indexes`
* Full path: `https://data.infoway.io/common/v2/basic/market/indexes`

**Response Example**

```json
{
  "data": {
    "indexes": [
      {"counter_id": "IX/US/.DJI", "name": "Dow Jones", "market": "US"},
      {"counter_id": "IX/US/.IXIC", "name": "NASDAQ", "market": "US"},
      {"counter_id": "IX/US/.SPX", "name": "S&P 500", "market": "US"},
      {"counter_id": "IX/HK/HSI", "name": "Hang Seng Index", "market": "HK"},
      {"counter_id": "IX/HK/HSTECH", "name": "Hang Seng TECH", "market": "HK"},
      {"counter_id": "IX/SG/STI", "name": "Straits Times Index", "market": "SG"},
      {"counter_id": "IX/SH/000001", "name": "SSE Composite", "market": "CN"},
      {"counter_id": "IX/SZ/399001", "name": "SZSE Component", "market": "CN"}
    ]
  }
}
```

| Field        | Type   | Description |
| ------------ | ------ | ----------- |
| `counter_id` | String | Index ID    |
| `name`       | String | Index name  |
| `market`     | String | Market      |

***

#### Leading Industries

Get today's top-performing industries and their leading stocks.

**Endpoint**

* Base path: `/common/v2/basic/market/leaders/{market}`
* Full path: `https://data.infoway.io/common/v2/basic/market/leaders/{market}`

**Path Parameters**

| Parameter | Type   | Required | Description | Example |
| --------- | ------ | -------- | ----------- | ------- |
| `market`  | String | Yes      | Market code | `HK`    |

**Query Parameters**

| Parameter | Type    | Required | Description                            | Example |
| --------- | ------- | -------- | -------------------------------------- | ------- |
| `limit`   | Integer | No       | Number of industries, 1-50, default 10 | `10`    |

**Response Example**

```json
{
  "market": "HK",
  "data": {
    "lists": [
      {
        "counter_id": "BK/HK/IN20351",
        "name": "Insurance Brokers",
        "chg": "0.1535",
        "leading_name": "ZhongMiao Holdings",
        "leading_last_done": "40.400",
        "leading_chg": "0.1717",
        "rise_num": 2,
        "fall_num": 0
      }
    ]
  }
}
```

| Field               | Type    | Description           |
| ------------------- | ------- | --------------------- |
| `counter_id`        | String  | Industry sector ID    |
| `name`              | String  | Industry name         |
| `chg`               | String  | Industry price change |
| `leading_name`      | String  | Leading stock name    |
| `leading_last_done` | String  | Leading stock price   |
| `leading_chg`       | String  | Leading stock change  |
| `rise_num`          | Integer | Advancing stocks      |
| `fall_num`          | Integer | Declining stocks      |

***

#### Ranking Configuration

Get available ranking types and sort field configurations.

**Endpoint**

* Base path: `/common/v2/basic/market/rank-config/{market}`
* Full path: `https://data.infoway.io/common/v2/basic/market/rank-config/{market}`

**Path Parameters**

| Parameter | Type   | Required | Description | Example |
| --------- | ------ | -------- | ----------- | ------- |
| `market`  | String | Yes      | Market code | `HK`    |

**Response Example**

```json
{
  "market": "HK",
  "data": {
    "rank_categories": [
      {
        "market": "HK",
        "items": [
          {
            "key": "all",
            "name": "All",
            "indicators": [
              {"key": "last_done", "name": "Latest Price", "is_sort": true},
              {"key": "chg", "name": "Change %", "is_sort": true},
              {"key": "market_cap", "name": "Market Cap", "is_sort": true}
            ]
          }
        ]
      }
    ]
  }
}
```
