Documentation Index
Fetch the complete documentation index at: https://docs.reportify.cn/llms.txt
Use this file to discover all available pages before exploring further.
pip install reportify-sdk
快速开始
from reportify_sdk import Reportify
# 初始化客户端
client = Reportify(api_key="your-api-key")
# 搜索文档
docs = client.search.all("Tesla earnings", num=10)
for doc in docs:
print(doc["title"])
# 搜索新闻
news = client.search.news("Apple iPhone", symbols=["US:AAPL"])
# 获取股票财务数据(返回 pandas DataFrame)
income = client.stock.income_statement("AAPL", period="quarterly")
print(income.head())
文档搜索
支持多种文档类型搜索:新闻、研报、公告、电话会议纪要等
股票数据
获取财务报表、行情数据,返回 pandas DataFrame 格式
配置选项
你的 Reportify API 密钥,可在开发者中心获取
base_url
string
default:"https://api.reportify.cn"
API 基础 URL,通常不需要修改
错误处理
from reportify_sdk import (
Reportify,
AuthenticationError,
RateLimitError,
NotFoundError,
APIError,
)
try:
docs = client.search.all("Tesla")
except AuthenticationError:
print("API Key 无效")
except RateLimitError:
print("请求过于频繁,请稍后重试")
except NotFoundError:
print("资源不存在")
except APIError as e:
print(f"API 错误: {e.message}")
上下文管理器
# 自动关闭连接
with Reportify(api_key="your-api-key") as client:
docs = client.search.all("Tesla")
下一步