Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f3a1c1d
docs(fundamental): add macroeconomic-indicators SDK doc (EN)
hogan-yuan Jun 11, 2026
87d44d8
docs(fundamental): add macroeconomic SDK doc (EN)
hogan-yuan Jun 11, 2026
561a309
docs(cli): add macroeconomic command doc (EN)
hogan-yuan Jun 11, 2026
26b09f5
docs(fundamental): add macroeconomic SDK docs (zh-CN)
hogan-yuan Jun 11, 2026
6472eff
docs(fundamental): add macroeconomic SDK docs (zh-HK)
hogan-yuan Jun 11, 2026
e702db6
docs(cli): add macroeconomic command doc (zh-CN + zh-HK)
hogan-yuan Jun 11, 2026
5e3d5c3
docs: update changelog for SDK v4.3.1 + macroeconomic CLI command
hogan-yuan Jun 12, 2026
7affc09
docs(cli): add release notes for macroeconomic command
hogan-yuan Jun 12, 2026
71b01a5
docs: replace vX.Y.Z placeholder with v0.24.0
hogan-yuan Jun 12, 2026
d541007
docs: rename CLI command macroeconomic → macrodata
hogan-yuan Jun 12, 2026
1a9c673
docs: sync macrodata/macroeconomic docs with SDK/CLI/MCP PRs
hogan-yuan Jun 12, 2026
7d1e2c3
docs: update macrodata indicator count 600+ → 400+
hogan-yuan Jun 12, 2026
d9d1939
docs(cli): add --keyword flag to macrodata command (3 langs)
hogan-yuan Jun 12, 2026
c51b9b8
docs(cli): replace macroeconomic → macrodata in all CLI docs
hogan-yuan Jun 12, 2026
8ea3f5a
fix: use full-width colon in zh-CN/zh-HK SDK code examples
hogan-yuan Jun 13, 2026
d338d62
docs: add SDK v4.3.2 changelog entry (macroeconomic v2 methods)
hogan-yuan Jun 13, 2026
ac8867d
docs(fundamental): update macroeconomic - clean response example, rem…
hogan-yuan Jun 13, 2026
1509eb6
docs(fundamental): update macroeconomic-indicators - add keyword para…
hogan-yuan Jun 13, 2026
4269cab
docs(fundamental): remove unmapped v2 fields from MacroeconomicIndica…
hogan-yuan Jun 13, 2026
8234c12
docs: remove v2 references from changelog, keep only user-facing keyw…
hogan-yuan Jun 15, 2026
2661745
docs: merge SDK v4.3.1 into v4.3.2 changelog entry
hogan-yuan Jun 15, 2026
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
12 changes: 12 additions & 0 deletions docs/en/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ sidebar_position: 7
sidebar_icon: newspaper
---

## 2026-06-13

### SDK v4.3.2

- **Macroeconomic indicators** — Two new `FundamentalContext` methods: `macroeconomic_indicators` lists all indicators (filter by country, keyword search), `macroeconomic` returns historical release data (actual / forecast / previous values) for a given indicator code

## 2026-06-11

### CLI v0.24.0

- **New `macrodata` command** — Browse 400+ macro indicators across US/HK/CN/EU/JP/SG and query historical release data with actual, forecast, previous, and revised values; supports `--country`, `--keyword`, `--lang`, `--start`, `--end`, `--limit`, `--page`, `--format json`

## 2026-06-04

### CLI v0.22.4
Expand Down
6 changes: 3 additions & 3 deletions docs/en/docs/cli/fundamentals/finance-calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 6

# longbridge finance-calendar

Browse upcoming financial events — earnings reports, dividend payments, stock splits, IPOs, and macroeconomic releases — filtered by symbol, watchlist, market, or event type.
Browse upcoming financial events — earnings reports, dividend payments, stock splits, IPOs, and macrodata releases — filtered by symbol, watchlist, market, or event type.

## Subcommands

Expand All @@ -16,7 +16,7 @@ Browse upcoming financial events — earnings reports, dividend payments, stock
| `dividend` | Dividend announcements |
| `split` | Stock splits and merges |
| `ipo` | IPO listings |
| `macrodata` | Macroeconomic data releases |
| `macrodata` | Macrodata releases |
| `closed` | Market closure days |

## Examples
Expand Down Expand Up @@ -59,7 +59,7 @@ Shows both split and merge events for Hong Kong-listed stocks.
longbridge finance-calendar macrodata --star 3
```

Filters macroeconomic events to only show high-importance releases (3-star). Covers data like CPI, NFP, Fed rate decisions, and similar market-moving events.
Filters macrodata events to only show high-importance releases (3-star). Covers data like CPI, NFP, Fed rate decisions, and similar market-moving events.

### IPO calendar

Expand Down
98 changes: 98 additions & 0 deletions docs/en/docs/cli/fundamentals/macrodata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: 'macrodata'
sidebar_label: 'macrodata'
sidebar_position: 20
---

# longbridge macrodata

Browse macrodata indicators and their historical release data — covering US, HK, CN, EU, JP, and SG markets.

## Modes

| Mode | Usage | Description |
| ---- | ----- | ----------- |
| List | `longbridge macrodata` | List all available indicators |
| History | `longbridge macrodata <CODE>` | Historical releases for one indicator |

## Examples

### List all indicators

```bash
longbridge macrodata
```

```
Total: 619
Code Name Category Country Frequency Source
62267 Non-Farm Payroll Employment US Monthly Bureau of Labor Statistics
...
```

### Filter by country

```bash
longbridge macrodata --country US
longbridge macrodata --country HK
longbridge macrodata --country CN
```

Supported country codes: `HK`, `CN`, `US`, `EU`, `JP`, `SG`.

### Search by keyword

```bash
longbridge macrodata --keyword CPI
longbridge macrodata --keyword CPI --country US
```

### Paginate the list

```bash
longbridge macrodata --country US --limit 50 --page 2
```

### Historical releases for a specific indicator

```bash
longbridge macrodata 62267
```

```
Non-Farm Payroll [Employment | Bureau of Labor Statistics · Monthly]

Period Actual Forecast Previous Revised Unit
2026-05-01 272000 250000 265000 263500 Thousand
2026-04-01 228000 137000 228000 228000 Thousand
...
```

### Filter history by date range

```bash
longbridge macrodata 62267 --start 2024-01-01 --end 2024-12-31
```

### JSON output for AI / scripting

```bash
# List as JSON
longbridge macrodata --format json

# History as JSON
longbridge macrodata 62267 --format json
```

## Options

| Option | Description | Default |
| ------ | ----------- | ------- |
| `--country` | Filter list: `HK` \| `CN` \| `US` \| `EU` \| `JP` \| `SG` | All |
| `--keyword` | Filter list by indicator name (fuzzy, list mode only) | — |
| `--start` | History start date `YYYY-MM-DD` | — |
| `--end` | History end date `YYYY-MM-DD` | — |
| `--lang` | Language for names/descriptions: `zh-CN` \| `zh-HK` \| `en` | — |
| `--limit` | Max records per page (list: max 1000, history: max 100) | 20 |
| `--page` | Page number, 1-based | 1 |
| `--format` | `table` or `json` | `table` |
4 changes: 4 additions & 0 deletions docs/en/docs/cli/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ sidebar_icon: newspaper

# Release Notes

### [v0.24.0](https://github.com/longbridge/longbridge-terminal/releases/tag/v0.24.0)

- **New `macrodata` command** — Browse 400+ macrodata indicators across US/HK/CN/EU/JP/SG; list mode with optional `--country` filter, history mode for a specific indicator code with `--start`/`--end` date range; `--format json` for AI/scripting workflows

### [v0.22.4](https://github.com/longbridge/longbridge-terminal/releases/tag/v0.22.4)

- **`constituent` now supports ETFs** — ETF symbols return an asset-allocation breakdown (holdings / regional / asset-class / industry tables); index symbols behave exactly as before
Expand Down
196 changes: 196 additions & 0 deletions docs/en/docs/fundamental/fundamental/macroeconomic-indicators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
slug: macroeconomic-indicators
title: Macroeconomic Indicators
sidebar_position: 20
language_tabs: false
toc_footers: []
includes: []
search: true
highlight_theme: ''
headingLevel: 2
---

List macroeconomic indicators available through Longbridge, optionally filtered by country.

<CliCommand>
# List all indicators
longbridge macrodata
# Filter by US indicators
longbridge macrodata --country US
</CliCommand>

<SDKLinks module="fundamental" klass="FundamentalContext" method="macroeconomic_indicators" />

## Parameters

> **SDK method parameters.**

| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| country | MacroeconomicCountry | NO | Filter by country. Omit for all countries. |
| keyword | string | NO | Fuzzy search by indicator name (case-insensitive) |
| offset | int | NO | Pagination offset. Default: 0 |
| limit | int | NO | Max records per page. Default: 100, max: 1000 |

### MacroeconomicCountry

| Value | Country |
| ----- | ------- |
| HK | Hong Kong SAR |
| CN | China (Mainland) |
| US | United States |
| EU | Euro Zone |
| JP | Japan |
| SG | Singapore |

## Request Example

<Tabs groupId="request-example">
<TabItem value="python" label="Python">

```python
from longbridge.openapi import FundamentalContext, Config, OAuthBuilder, MacroeconomicCountry

oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = FundamentalContext(config)

# All indicators
resp = ctx.macroeconomic_indicators()
print(resp)

# US only
resp = ctx.macroeconomic_indicators(country=MacroeconomicCountry.UnitedStates, limit=50)
print(resp)

# Search by keyword
resp = ctx.macroeconomic_indicators(keyword="payroll")
print(resp)
```

</TabItem>
<TabItem value="python-async" label="Python (async)">

```python
import asyncio
from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder, MacroeconomicCountry

async def main() -> None:
oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = AsyncFundamentalContext.create(config)
resp = await ctx.macroeconomic_indicators(country=MacroeconomicCountry.UnitedStates)
print(resp)

if __name__ == "__main__":
asyncio.run(main())
```

</TabItem>
<TabItem value="nodejs" label="Node.js">

```javascript
const { Config, FundamentalContext, OAuth, MacroeconomicCountry } = require('longbridge')

async function main() {
const oauth = await OAuth.build('your-client-id', (_, url) => {
console.log('Open this URL to authorize: ' + url)
})
const config = Config.fromOAuth(oauth)
const ctx = FundamentalContext.new(config)
const resp = await ctx.macroeconomicIndicators({ country: MacroeconomicCountry.UnitedStates })
console.log(resp)
}
main().catch(console.error)
```

</TabItem>
<TabItem value="java" label="Java">

```java
import com.longbridge.*;
import com.longbridge.fundamental.*;

class Main {
public static void main(String[] args) throws Exception {
try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
Config config = Config.fromOAuth(oauth);
FundamentalContext ctx = FundamentalContext.create(config)) {
var resp = ctx.getMacroeconomicIndicators(null, null, null).get();
System.out.println(resp);
}
}
}
```

</TabItem>
<TabItem value="rust" label="Rust">

```rust
use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?;
let config = Arc::new(Config::from_oauth(oauth));
let ctx = FundamentalContext::new(config);
let resp = ctx.macroeconomic_indicators(None, None, None).await?;
println!("{:?}", resp);
Ok(())
}
```

</TabItem>
</Tabs>

## Response

### Response Example

```json
{
"count": 619,
"list": [
{
"indicator_code": "62267",
"country": "US",
"name": "Non-Farm Payroll",
"periodicity": "Monthly",
"describe": "Employment situation report...",
"importance": 3
}
]
}
```

### Response Status

| Status | Description | Schema |
| ------ | ----------- | ------ |
| 200 | Success | [MacroeconomicIndicatorListResponse](#MacroeconomicIndicatorListResponse) |
| 400 | Bad request | None |

## Schemas

### MacroeconomicIndicatorListResponse

<a id="MacroeconomicIndicatorListResponse"></a>

| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| list | MacroeconomicIndicator[] | true | Indicator list |
| count | int | true | Total number of matching indicators |

### MacroeconomicIndicator

<a id="MacroeconomicIndicator"></a>

| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| indicator_code | string | true | Indicator code (use as input to `macroeconomic`) |
| country | string | true | Country name |
| name | string | true | Indicator name |
| periodicity | string | true | Release periodicity (e.g. `Monthly`, `Quarterly`) |
| describe | string | true | Indicator description |
| importance | int | true | Importance level (1 = Low, 2 = Medium, 3 = High) |
Loading
Loading