Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/en/docs/api-reference/how-to-access-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ It is recommended to directly use the SDK to access the API, the SDK has encapsu
https://open.longbridge.com/sdk
:::

See also: [HTTP API Endpoints](./http-endpoints) (mapped from SDK source).

## OAuth 2.0 (Current Recommendation)

Use OAuth 2.0 for new integrations. It is simpler than the legacy `X-Api-Key` signature flow.
Expand Down
34 changes: 34 additions & 0 deletions docs/en/docs/api-reference/http-endpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: HTTP API Endpoints (from SDK)
id: http-endpoints
slug: /api
sidebar_position: 3
---

This section provides one page per API path (slug path-style, no HTTP verb prefix).

## Endpoint Pages

- [`/v1/watchlist/groups`](./http-endpoints/v1-watchlist-groups)
- [`/v1/quote/get_security_list`](./http-endpoints/v1-quote-get_security_list)
- [`/v1/quote/market_temperature`](./http-endpoints/v1-quote-market_temperature)
- [`/v1/quote/history_market_temperature`](./http-endpoints/v1-quote-history_market_temperature)
- [`/v1/trade/execution/history`](./http-endpoints/v1-trade-execution-history)
- [`/v1/trade/execution/today`](./http-endpoints/v1-trade-execution-today)
- [`/v1/trade/order/history`](./http-endpoints/v1-trade-order-history)
- [`/v1/trade/order/today`](./http-endpoints/v1-trade-order-today)
- [`/v1/trade/order`](./http-endpoints/v1-trade-order)
- [`/v1/trade/estimate/buy_limit`](./http-endpoints/v1-trade-estimate-buy_limit)
- [`/v1/asset/account`](./http-endpoints/v1-asset-account)
- [`/v1/asset/cashflow`](./http-endpoints/v1-asset-cashflow)
- [`/v1/asset/fund`](./http-endpoints/v1-asset-fund)
- [`/v1/asset/stock`](./http-endpoints/v1-asset-stock)
- [`/v1/risk/margin-ratio`](./http-endpoints/v1-risk-margin-ratio)
- [`/v1/token/refresh`](./http-endpoints/v1-token-refresh)

## Source

- `rust/src/quote/context.rs`
- `rust/src/trade/context.rs`
- `rust/src/config.rs`
- Repository: <https://github.com/longportapp/openapi/tree/main/rust/src>
6 changes: 6 additions & 0 deletions docs/en/docs/api-reference/http-endpoints/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "HTTP API Endpoints",
"position": 3,
"collapsible": true,
"collapsed": true
}
74 changes: 74 additions & 0 deletions docs/en/docs/api-reference/http-endpoints/v1-asset-account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: `GET` Asset Account
id: v1-asset-account
slug: /api/v1/asset/account
sidebar_position: 11
---

## Overview

This page documents the HTTP endpoint path used by the SDK for this API.

- **Path:** `/v1/asset/account`
- **Method(s):** `GET`
- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`)

## Authentication

Use OAuth 2.0 Bearer token (recommended):

- Header: `Authorization: Bearer ACCESS_TOKEN`

API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default.

## Request

### HTTP Information

- **HTTP URL:** `/v1/asset/account`
- **HTTP Method(s):** `GET`
- **Content-Type:** `application/json` (for POST/PUT request body)

### Parameters

Parameter details (query/body fields and constraints) should be defined per endpoint business spec.

Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`.

## Examples

### GET Example

```bash
curl -X GET "https://openapi.longportapp.com/v1/asset/account" \
-H "Authorization: Bearer ACCESS_TOKEN"
```

## Response

### Standard Envelope

```json
{
"code": 0,
"message": "success",
"data": {}
}
```

### Common Error Shape

```json
{
"code": 400000,
"message": "error message",
"data": null
}
```

## SDK Source Mapping

- Repository: <https://github.com/longportapp/openapi/tree/main/rust/src>
- Path mapping is extracted from SDK HTTP client calls.

> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation.
74 changes: 74 additions & 0 deletions docs/en/docs/api-reference/http-endpoints/v1-asset-cashflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: `GET` Asset Cashflow
id: v1-asset-cashflow
slug: /api/v1/asset/cashflow
sidebar_position: 12
---

## Overview

This page documents the HTTP endpoint path used by the SDK for this API.

- **Path:** `/v1/asset/cashflow`
- **Method(s):** `GET`
- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`)

## Authentication

Use OAuth 2.0 Bearer token (recommended):

- Header: `Authorization: Bearer ACCESS_TOKEN`

API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default.

## Request

### HTTP Information

- **HTTP URL:** `/v1/asset/cashflow`
- **HTTP Method(s):** `GET`
- **Content-Type:** `application/json` (for POST/PUT request body)

### Parameters

Parameter details (query/body fields and constraints) should be defined per endpoint business spec.

Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`.

## Examples

### GET Example

```bash
curl -X GET "https://openapi.longportapp.com/v1/asset/cashflow" \
-H "Authorization: Bearer ACCESS_TOKEN"
```

## Response

### Standard Envelope

```json
{
"code": 0,
"message": "success",
"data": {}
}
```

### Common Error Shape

```json
{
"code": 400000,
"message": "error message",
"data": null
}
```

## SDK Source Mapping

- Repository: <https://github.com/longportapp/openapi/tree/main/rust/src>
- Path mapping is extracted from SDK HTTP client calls.

> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation.
74 changes: 74 additions & 0 deletions docs/en/docs/api-reference/http-endpoints/v1-asset-fund.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: `GET` Asset Fund
id: v1-asset-fund
slug: /api/v1/asset/fund
sidebar_position: 13
---

## Overview

This page documents the HTTP endpoint path used by the SDK for this API.

- **Path:** `/v1/asset/fund`
- **Method(s):** `GET`
- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`)

## Authentication

Use OAuth 2.0 Bearer token (recommended):

- Header: `Authorization: Bearer ACCESS_TOKEN`

API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default.

## Request

### HTTP Information

- **HTTP URL:** `/v1/asset/fund`
- **HTTP Method(s):** `GET`
- **Content-Type:** `application/json` (for POST/PUT request body)

### Parameters

Parameter details (query/body fields and constraints) should be defined per endpoint business spec.

Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`.

## Examples

### GET Example

```bash
curl -X GET "https://openapi.longportapp.com/v1/asset/fund" \
-H "Authorization: Bearer ACCESS_TOKEN"
```

## Response

### Standard Envelope

```json
{
"code": 0,
"message": "success",
"data": {}
}
```

### Common Error Shape

```json
{
"code": 400000,
"message": "error message",
"data": null
}
```

## SDK Source Mapping

- Repository: <https://github.com/longportapp/openapi/tree/main/rust/src>
- Path mapping is extracted from SDK HTTP client calls.

> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation.
74 changes: 74 additions & 0 deletions docs/en/docs/api-reference/http-endpoints/v1-asset-stock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: `GET` Asset Stock
id: v1-asset-stock
slug: /api/v1/asset/stock
sidebar_position: 14
---

## Overview

This page documents the HTTP endpoint path used by the SDK for this API.

- **Path:** `/v1/asset/stock`
- **Method(s):** `GET`
- **Base URL:** `https://openapi.longportapp.com` (or `https://openapi.longportapp.cn`)

## Authentication

Use OAuth 2.0 Bearer token (recommended):

- Header: `Authorization: Bearer ACCESS_TOKEN`

API-key signature flow can remain as fallback for legacy integrations, but OAuth 2.0 is the default.

## Request

### HTTP Information

- **HTTP URL:** `/v1/asset/stock`
- **HTTP Method(s):** `GET`
- **Content-Type:** `application/json` (for POST/PUT request body)

### Parameters

Parameter details (query/body fields and constraints) should be defined per endpoint business spec.

Current source mapping for this endpoint comes from SDK request definitions in `longportapp/openapi`.

## Examples

### GET Example

```bash
curl -X GET "https://openapi.longportapp.com/v1/asset/stock" \
-H "Authorization: Bearer ACCESS_TOKEN"
```

## Response

### Standard Envelope

```json
{
"code": 0,
"message": "success",
"data": {}
}
```

### Common Error Shape

```json
{
"code": 400000,
"message": "error message",
"data": null
}
```

## SDK Source Mapping

- Repository: <https://github.com/longportapp/openapi/tree/main/rust/src>
- Path mapping is extracted from SDK HTTP client calls.

> Next step: enrich each endpoint with concrete parameter tables and real response examples from runtime validation.
Loading
Loading