# LongPort Developers Documentation
# SDK
| Market | Symbol |
|---|---|
| HK Market | Securities (including equities, ETFs, Warrants, CBBCs) |
| Hang Seng Index | |
| US Market | Securities (including stocks, ETFs) |
| Nasdsaq Index | |
| OPRA Options | |
| CN Market | Securities (including stocks, ETFs) |
| Index |
- Click "New" in the pop-up window, then enter the environment variable name, such as `LONGPORT_APP_KEY`, `Value` respectively fill in the App Key, App Secret, Access Token obtained from the page.
2. **Through the CMD**: Press the `Win + R` shortcut keys and enter the `cmd` command to start the command line (it is recommended to use [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701) for a better development experience).
Enter the following command in the command line to set the environment variable:
```bash
C:\Users\jason> setx LONGPORT_APP_KEY "App Key from user center"
Success: the specified value has been saved.
C:\Users\jason> setx LONGPORT_APP_SECRET "App Secret from user center"
Success: the specified value has been saved.
C:\Users\jason> setx LONGPORT_ACCESS_TOKEN "Access Token from user center"
Success: the specified value has been saved.
```
:::caution Windows ENV Restrictions
Windows ENV Restrictions, when the above commands are executed successfully, you need to restart Windows or log out and log in again before you can read it.
:::
After logging out or restarting, open the command line again and enter the following command to verify that the environment variables are set correctly:
```bash
C:\Users\jason> set LONGPORT
LONGPORT_APP_KEY=xxxxxxx
LONGPORT_APP_SECRET=xxxxxx
LONGPORT_ACCESS_TOKEN=xxxxxxx
```
If it prints the value you just set correctly, then the environment variable is right.
### Refresh Access Token
:::info
This applies to **Legacy API Key** authentication only. OAuth 2.0 tokens are refreshed automatically by the SDK.
:::
The Legacy API Key `Access Token` expires after 90 days by default. Call `Config.refresh_access_token()` to obtain a new token before it expires, then update your stored `LONGPORT_ACCESS_TOKEN` with the returned value.
| HTTP Method | GET |
| HTTP URL | /v1/content/{symbol}/news |
| HTTP Method | POST |
| HTTP URL | /v1/content/topics/:topic_id/comments |
| HTTP Method | GET |
| HTTP URL | /v1/content/topics/:topic_id/comments |
| HTTP Method | GET |
| HTTP URL | /v1/content/{symbol}/topics |
| HTTP Method | GET |
| HTTP URL | /v1/content/topics/:id |
| HTTP Method | POST |
| HTTP URL | /v1/content/topics |
| HTTP Method | GET |
| HTTP URL | /v1/content/topics/mine |
| HTTP Method | GET |
| HTTP URL | /v1/quote/get_security_list |
| User Type | The maximum number of targets that can be queried per month |
|---|---|
| User account opening | |
| Total assets reach HKD 10,000 | |
| Total assets reach HKD 80,000 | |
| Total assets reach 400,000 HKD or the number of transactions per month is greater than 160 | |
| Total assets reach 4 million HKD or the number of transactions per month is greater than 1,600 | |
| Total assets reach 6 million HKD or the number of transactions per month is greater than 2,500 |
| HTTP Method | POST |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | DELETE |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | PUT |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | PUT |
| HTTP URL | /watchlist/groups |
| HTTP Method | GET |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | POST |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | DELETE |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | PUT |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | GET |
| HTTP URL | /v1/watchlist/groups |
| HTTP Method | GET |
| HTTP URL | /v1/quote/market_temperature |
| HTTP Method | GET |
| HTTP URL | /v1/quote/filings |
| HTTP Method | GET |
| HTTP URL | /v1/quote/history_market_temperature |
| User Type | The maximum number of targets that can be queried per month |
|---|---|
| User account opening | |
| Total assets reach HKD 10,000 | |
| Total assets reach HKD 80,000 | |
| Total assets reach 400,000 HKD or the number of transactions per month is greater than 160 | |
| Total assets reach 4 million HKD or the number of transactions per month is greater than 1,600 | |
| Total assets reach 6 million HKD or the number of transactions per month is greater than 2,500 |
| HTTP Method | GET |
| HTTP URL | /v1/trade/execution/today |
| HTTP Method | GET |
| HTTP URL | /v1/trade/execution/history |
| HTTP Method | GET |
| HTTP URL | /v1/asset/account |
| HTTP Method | GET |
| HTTP URL | /v1/asset/stock |
| HTTP Method | GET |
| HTTP URL | /v1/asset/fund |
| HTTP Method | GET |
| HTTP URL | /v1/risk/margin-ratio |
| HTTP Method | GET |
| HTTP URL | /v1/asset/cashflow |
| HTTP Method | DELETE |
| HTTP URL | /v1/trade/order |
| HTTP Method | GET |
| HTTP URL | /v1/trade/order/history |
| HTTP Method | POST |
| HTTP URL | /v1/trade/order |
| HTTP Method | GET |
| HTTP URL | /v1/trade/estimate/buy_limit |
| HTTP Method | GET |
| HTTP URL | /v1/trade/order/today |
| HTTP Method | PUT |
| HTTP URL | /v1/trade/order |
| HTTP Method | GET |
| HTTP URL | /v1/trade/order |
| Market | Symbol | Ticker | Region |
| HK Market | Securities (including equities, ETFs, Warrants, CBBCs) | The official code of the security on the exchange | HK |
| Hang Seng Index | HSI | HK | |
| Hang Seng China Enterprises Index | HSCEI | HK | |
| Hang Seng TECH Index | HSTECH | HK | |
| US Market | Securities (including stocks, ETFs) | The official code of the security on the exchange | US |
| Nasdsaq Index | .IXIC | US | |
| Dow Jones Industrial Average | .DJI | US | |
| CN Market | Securities (including stocks, ETFs) | The official code of the security on the exchange | SH or SZ |
| Index | The official code of the security on the exchange | SH or SZ |
| HTTP Method | GET |
| HTTP URL | /v1/quote/market_temperature |
| HTTP Method | GET |
| HTTP URL | /v1/quote/history_market_temperature |