> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# MarketPulse

> 面向自主智能体的实时及历史股票市场数据——价格、新闻、财务报表、指标、分析师预测、内部人交易、SEC 文件、股票筛选及宏观利率。

[在 GitHub 上查看 →](https://github.com/AIsa-team/agent-skills/tree/main/financial/marketpulse)

**为自主智能体提供完整的股票市场数据。** 一个 `AISA_API_KEY` 即可解锁股票、财务数据、SEC 文件和宏观数据——智能体研究、筛选和分析上市公司所需的一切。

## 安装

```bash npx skills theme={null}
npx skills add AIsa-team/agent-skills --skill marketpulse
```

```bash AIsa CLI theme={null}
npm install -g @aisa-one/cli
aisa skills install marketpulse
```

安装后请启动一个新的智能体会话，以便加载该 Skill。

## 智能体能用它做什么？

> [card] 投资研究
>
> “完整分析：NVDA 价格趋势、内部人交易、分析师预测、SEC 文件。”

> [card] 财报分析
>
> “获取 Tesla 财报快照、分析师预测和价格反应。”

> [card] 市场筛选
>
> “查找 P/E \< 15 且营收增长 > 20% 的股票。”

> [card] 大户追踪
>
> “追踪 Apple 的内部人交易并与价格走势关联。”

> [card] 财务报表分析
>
> “比较 Apple 的利润表、资产负债表、现金流量表和财务指标。”

> [card] 宏观背景
>
> “拉取联邦基金利率历史数据，与银行财报对照。”

## 核心能力

* **价格**——历史 OHLCV 数据，支持秒、分钟、日、周、月、年粒度
* **新闻**——按股票代码过滤的公司新闻
* **财务报表**——利润表、资产负债表、现金流量表；年度、季度或 TTM
* **财务指标**——实时快照或历史序列
* **分析师预测**——EPS 和增长预测
* **内部人交易**——按股票代码查询 Form 4 文件
* **SEC 文件**——文件索引和解析后的文件条目（10-K、10-Q、8-K 等）
* **公司信息**——按股票代码或 CIK 查询参考数据
* **股票筛选器**——通过 POST 请求体筛选全市场（P/E、增长率等）
* **科目搜索**——一次调用即可拉取多个股票代码的特定指标
* **宏观**——当前及历史央行利率

## 快速开始

```bash theme={null}
export AISA_API_KEY="your-key"
```

### 股票价格

```bash theme={null}
# Historical daily data
curl "https://api.aisa.one/apis/v1/financial/prices?ticker=AAPL&interval=day&interval_multiplier=1&start_date=2025-01-01&end_date=2025-12-31" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Intraday 5-minute bars
curl "https://api.aisa.one/apis/v1/financial/prices?ticker=AAPL&interval=minute&interval_multiplier=5&start_date=2025-01-15&end_date=2025-01-15" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

**必需参数：** `ticker`、`interval`（`second` · `minute` · `day` · `week` · `month` · `year`）、`interval_multiplier`、`start_date`、`end_date`。

### 财务报表

```bash theme={null}
# All three statements in one call
curl "https://api.aisa.one/apis/v1/financial/financials?ticker=AAPL&period=annual" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Or fetch them individually
-H "Authorization: Bearer $AISA_API_KEY"
-H "Authorization: Bearer $AISA_API_KEY"
-H "Authorization: Bearer $AISA_API_KEY"
```

**`period`** 接受 `annual`、`quarterly` 或 `ttm`。

### 财务指标

```bash theme={null}
# Real-time snapshot
curl "https://api.aisa.one/apis/v1/financial/financial-metrics/snapshot?ticker=AAPL" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Historical
curl "https://api.aisa.one/apis/v1/financial/financial-metrics?ticker=AAPL&period=annual" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 内部人交易

```bash theme={null}
curl "https://api.aisa.one/apis/v1/financial/insider-trades?ticker=AAPL" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### SEC 文件

```bash theme={null}
# Filings index
curl "https://api.aisa.one/apis/v1/financial/filings?ticker=AAPL" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Parsed filing items (requires filing_type and year)
curl "https://api.aisa.one/apis/v1/financial/filings/items?ticker=AAPL&filing_type=10-K&year=2024" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 股票筛选器（POST）

```bash theme={null}
curl -X POST "https://api.aisa.one/apis/v1/financial/financials/search/screener" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filters":{"pe_ratio":{"max":15},"revenue_growth":{"min":0.2}}}'
```

### 科目搜索

```bash theme={null}
curl -X POST "https://api.aisa.one/apis/v1/financial/financials/search/line-items" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tickers":["AAPL","MSFT"],"line_items":["revenue","net_income"],"period":"annual"}'
```

### 宏观利率

```bash theme={null}
# Current rates
curl "https://api.aisa.one/apis/v1/financial/macro/interest-rates/snapshot" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Historical (per central bank)
curl "https://api.aisa.one/apis/v1/financial/macro/interest-rates?bank=fed" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

## Python 客户端

自带的 `market_client.py` 封装了所有端点，一行即可调用：

```bash theme={null}
# Prices (start/end are required)
python3 scripts/market_client.py stock prices --ticker AAPL --start 2025-01-01 --end 2025-01-31
python3 scripts/market_client.py stock prices --ticker AAPL --start 2025-01-01 --end 2025-01-31 --interval week

# Statements
python3 scripts/market_client.py stock statements --ticker AAPL --type all --period annual
python3 scripts/market_client.py stock statements --ticker AAPL --type income --period quarterly

# Analysis
python3 scripts/market_client.py stock metrics --ticker AAPL --historical --period annual
python3 scripts/market_client.py stock analyst --ticker AAPL
python3 scripts/market_client.py stock earnings --ticker AAPL

# Insider trades
python3 scripts/market_client.py stock insider --ticker AAPL

# SEC filings
python3 scripts/market_client.py stock filings --ticker AAPL --items --filing-type 10-K --year 2024

# Screener / line items
python3 scripts/market_client.py stock screen --pe-max 15 --growth-min 0.2
python3 scripts/market_client.py stock line-items --tickers AAPL,MSFT --items revenue,net_income --period annual

# Interest rates
python3 scripts/market_client.py stock rates --historical --bank fed
```

## 端点参考

| 端点 | 方法 | 用途 |
| - | - | - |
| `/financial/prices` | GET | [历史价格](https://aisa.one/docs/zh/api-reference/financial/get_prices.md) |
| `/financial/news` | GET | [公司新闻](https://aisa.one/docs/zh/api-reference/financial/get_news.md) |
| `/financial/financials` | GET | [全部报表](https://aisa.one/docs/zh/api-reference/financial/get_financials.md) |
| `/financial/financials/income-statements` | GET | [利润表](https://aisa.one/docs/zh/api-reference/financial/get_financials-income-statements.md) |
| `/financial/financials/balance-sheets` | GET | [资产负债表](https://aisa.one/docs/zh/api-reference/financial/get_financials-balance-sheets.md) |
| `/financial/financials/cash-flow-statements` | GET | [现金流量表](https://aisa.one/docs/zh/api-reference/financial/get_financials-cash-flow-statements.md) |
| `/financial/financial-metrics/snapshot` | GET | [指标快照](https://aisa.one/docs/zh/api-reference/financial/get_financial-metrics-snapshot.md) |
| `/financial/financial-metrics` | GET | [历史指标](https://aisa.one/docs/zh/api-reference/financial/get_financial-metrics.md) |
| `/financial/analyst-estimates` | GET | [分析师预测](https://aisa.one/docs/zh/api-reference/financial/get_analyst-estimates.md) |
| `/financial/insider-trades` | GET | [内部人交易](https://aisa.one/docs/zh/api-reference/financial/get_insider-trades.md) |
| `/financial/filings` | GET | [SEC 文件](https://aisa.one/docs/zh/api-reference/financial/get_filings.md) |
| `/financial/filings/items` | GET | [文件条目](https://aisa.one/docs/zh/api-reference/financial/get_filings-items.md) |
| `/financial/company/facts` | GET | [公司信息](https://aisa.one/docs/zh/api-reference/financial/get_company-facts.md) |
| `/financial/financials/search/screener` | POST | 股票筛选器 |
| `/financial/financials/search/line-items` | POST | [科目搜索](https://aisa.one/docs/zh/api-reference/financial/post_financials-search-line-items.md) |
| `/financial/macro/interest-rates/snapshot` | GET | [利率快照](https://aisa.one/docs/zh/api-reference/financial/get_macro-interest-rates-snapshot.md) |
| `/financial/macro/interest-rates` | GET | [历史利率](https://aisa.one/docs/zh/api-reference/financial/get_macro-interest-rates.md) |

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册并在控制台创建 API key。
2. 在终端中设置：`export AISA_API_KEY="your-key"`。
3. 使用[安装](#安装)部分的命令安装该 Skill，然后启动一个新的智能体会话。

## 相关

> [card] [Financial API 参考](https://aisa.one/docs/zh/api-reference/financial/get_prices.md)
>
> MarketPulse Skill 封装的所有端点，附带交互式调试工具。

> [card] [错误码](https://aisa.one/docs/zh/api-reference/errors.md)
>
> 处理 Financial 端点返回的 400/401/429 响应。

> [card] [速率限制](https://aisa.one/docs/zh/api-reference/rate-limits.md)
>
> 各端点和层级的吞吐量上限。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.