经营数据
按财报期获取经营数据及核心财务指标摘要。
SDK Links
Parameters
SDK 方法参数。
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | 是 | 证券代码,例如 AAPL.US |
| period | string | 否 | 财报期筛选,如 q1、q2、q3、q4、annual |
Request Example
python
from longbridge.openapi import FundamentalContext, Config, OAuthBuilder
oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = FundamentalContext(config)
resp = ctx.operating("AAPL.US")
print(resp)python
import asyncio
from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder
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.operating("AAPL.US")
print(resp)
if __name__ == "__main__":
asyncio.run(main())javascript
const { Config, FundamentalContext, OAuth } = 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.operating('AAPL.US')
console.log(resp)
}
main().catch(console.error)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.getOperating("AAPL.US").get();
System.out.println(resp);
}
}
}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.operating("AAPL.US").await?;
println!("{:?}", resp);
Ok(())
}cpp
#include <iostream>
#include <longbridge.hpp>
using namespace longbridge;
using namespace longbridge::fundamental;
int main() {
OAuthBuilder("your-client-id").build(
[](const std::string& url) { std::cout << "Open: " << url << std::endl; },
[](auto res) {
if (!res) return;
Config config = Config::from_oauth(*res);
FundamentalContext ctx = FundamentalContext::create(config);
ctx.operating("AAPL.US", [](auto resp) {
if (resp) std::cout << "OK" << std::endl;
});
});
std::cin.get();
}go
package main
import (
"context"
"fmt"
"log"
"github.com/longbridge/openapi-go/config"
"github.com/longbridge/openapi-go/oauth"
"github.com/longbridge/openapi-go/fundamental"
)
func main() {
o := oauth.New("your-client-id").
OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
if err := o.Build(context.Background()); err != nil {
log.Fatal(err)
}
conf, err := config.New(config.WithOAuthClient(o))
if err != nil {
log.Fatal(err)
}
c, err := fundamental.NewFromCfg(conf)
if err != nil {
log.Fatal(err)
}
defer c.Close()
resp, err := c.Operating(context.Background(), "AAPL.US")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", resp)
}Response
Response Example
json
{
"code": 0,
"message": "success",
"data": {
"list": [
{
"id": "12345",
"report": "af",
"title": "FY2025 Annual Report Summary",
"txt": "Management discussion...",
"latest": true,
"web_url": "https://longbridge.com/wiki/...",
"financial": {
"code": "700",
"currency": "HKD",
"name": "Tencent",
"region": "HK",
"report": "af",
"indicators": [
{
"field_name": "operating_revenue",
"indicator_name": "Revenue",
"indicator_value": "6786 亿",
"yoy": "0.0800"
}
]
}
}
]
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | 成功 | OperatingList |
| 400 | 请求错误 | None |
Schemas
OperatingListResponse
| Name | Type | Required | Description |
|---|---|---|---|
| list | object[] | true | 经营数据报告列表,见 OperatingItem |
OperatingItem
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | false | 内部报告 ID |
| report | string | false | 报告期代码(如 af = 年报) |
| title | string | false | 报告标题 |
| txt | string | false | 管理层讨论文本 |
| latest | boolean | false | 是否为最新报告 |
| web_url | string | false | 完整报告页面链接 |
| financial | object | false | 关键财务指标 |
OperatingFinancial
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | false | 股票代码 |
| name | string | false | 公司名称 |
| currency | string | false | 报告货币 |
| region | string | false | 市场地区 |
| report | string | false | 报告期代码 |
| indicators | object[] | false | 财务指标列表,见 OperatingIndicator |
OperatingIndicator
| Name | Type | Required | Description |
|---|---|---|---|
| field_name | string | true | 字段名称(如 operating_revenue) |
| indicator_name | string | false | 显示名称 |
| indicator_value | string | false | 格式化数值 |
| yoy | string | false | 同比变化率 |