---
slug: corporate-actions
title: 公司行动
sidebar_position: 9
language_tabs: false
toc_footers: []
includes: []
search: true
highlight_theme: ''
headingLevel: 2
---

获取指定证券的公司行动历史，包括拆股、合并、分拆和配股等。

<CliCommand>
longbridge corp-action TSLA.US
longbridge corp-action AAPL.US
</CliCommand>


## SDK

| 语言 | 链接 |
|---|---|
| Python | [longbridge.openapi.fundamental._fundamental_context](https://longbridge.github.io/openapi/python/reference_all/#longbridge.openapi.fundamental._fundamental_context) |
| Rust | [longbridge::<SDKLinks module="fundamental" klass="FundamentalContext" method="corporate_actions" />::fundamental#_fundamental_context](https://longbridge.github.io/openapi/rust/longbridge/<SDKLinks module="fundamental" klass="FundamentalContext" method="corporate_actions" />/struct.fundamental.html#method._fundamental_context) |
| Go | [fundamental.corporate_actions](https://pkg.go.dev/github.com/longbridge/openapi-go/<SDKLinks module="fundamental" klass="FundamentalContext" method="corporate_actions" />#fundamental.corporate_actions) |
| Node.js | [fundamental#FundamentalContext](https://longbridge.github.io/openapi/nodejs/classes/fundamental.html#fundamentalcontext) |
| Java | [fundamental.getFundamentalContext](https://longbridge.github.io/openapi/java/com/longbridge/<SDKLinks module="fundamental" klass="FundamentalContext" method="corporate_actions" />/fundamental.html#getFundamentalContext) |
| C++ | [longbridge::<SDKLinks module="fundamental" klass="FundamentalContext" method="corporate_actions" />::fundamental::_fundamental_context](https://longbridge.github.io/openapi/cpp/classlongbridge_1_1<SDKLinks module="fundamental" klass="FundamentalContext" method="corporate_actions" />_1_1_fundamental.html) |


## Parameters

> **SDK 方法参数。**

| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| symbol | string | 是 | 证券代码，例如 `AAPL.US` |
| start_date | string | 否 | 开始日期，格式 `YYYY-MM-DD` |
| end_date | string | 否 | 结束日期，格式 `YYYY-MM-DD` |

## Request Example

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

```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.corporate_actions("AAPL.US")
print(resp)
```

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

```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.corporate_actions("AAPL.US")
    print(resp)

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

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

```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.corporate_actions('AAPL.US')
  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.getCorporateActions("AAPL.US").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.corporate_actions("AAPL.US").await?;
    println!("{:?}", resp);
    Ok(())
}
```

  </TabItem>
  <TabItem value="cpp" label="C++">

```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.corporate_actions("AAPL.US", [](auto resp) {
                if (resp) std::cout << "OK" << std::endl;
            });
        });
    std::cin.get();
}
```

  </TabItem>
  <TabItem value="go" label="Go">

```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.CorporateActions(context.Background(), "AAPL.US")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", resp)
}
```

  </TabItem>
</Tabs>

## Response


### Response Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "id": "622620",
        "action": "DividendExDate",
        "act_type": "Distribution Plan",
        "act_desc": "Cash dividend 0.27 USD",
        "date": "20260514",
        "date_str": "05.14",
        "date_type": "Payment Date",
        "date_zone": "EST",
        "delay_content": "",
        "is_delay": false,
        "recent": false,
        "live": null
      }
    ]
  }
}
```

### Response Status

| Status | Description | Schema |
| ------ | ----------- | ------ |
| 200    | 成功     | [CorporateActionsResponse](#CorporateActionsResponse) |
| 400    | 请求错误 | None   |

## Schemas

### CorporateActionsResponse

<a id="CorporateActionsResponse"></a>

| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| items | object[] | true | 公司行动列表， |
| ∟ id | string | false | 行动 ID |
| ∟ act_desc | string | false | 行动描述 |
| ∟ act_type | string | false | 行动类型分类 |
| ∟ action | string | false | 行动代码（如 `DividendExDate`） |
| ∟ date | string | false | 生效日期 |
| ∟ date_str | string | false | 简短展示日期（MM.DD） |
| ∟ date_type | string | false | 日期类型标签（如 Payment Date） |
| ∟ date_zone | string | false | 时区（如 EST） |
| ∟ delay_content | string | false | 延迟内容描述 |
| ∟ is_delay | boolean | false | 是否延迟 |
| ∟ live | boolean | false | 是否实时 |
| ∟ recent | boolean | false | 是否为近期事件 |
