market-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMarket Data API
市场数据API
Access US stock market data through eng0's data proxy service.
通过eng0的数据代理服务获取美股市场数据。
Base URL
基础URL
https://api.eng0.ai/api/datahttps://api.eng0.ai/api/dataData Coverage
数据覆盖范围
- All US stock tickers
- 5 years of historical data
- 100% market coverage
- 15-minute delayed quotes
- 所有美股代码
- 5年历史数据
- 100%市场覆盖
- 延迟15分钟的报价
Available Endpoints
可用接口
| Endpoint | Purpose |
|---|---|
| OHLCV price bars (1min to 1week intervals) |
| News articles with sentiment analysis |
| Company information and market cap |
| API schema discovery |
| 接口 | 用途 |
|---|---|
| 获取OHLCV价格K线(时间间隔从1分钟到1周) |
| 获取带情感分析的新闻文章 |
| 获取公司信息及市值数据 |
| 发现API schema |
Get Price Bars
获取价格K线
Retrieve OHLCV (Open, High, Low, Close, Volume) bars for a stock.
bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "AAPL",
"interval": "1day",
"from": "2024-12-01",
"to": "2024-12-31"
}'Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Stock symbol (e.g., |
| string | Yes | |
| date | Yes | Start date ( |
| date | Yes | End date ( |
Response:
json
{
"ticker": "AAPL",
"count": 21,
"bars": [
{
"t": "2024-12-02T05:00:00.000Z",
"o": 237.27,
"h": 240.79,
"l": 237.16,
"c": 239.59,
"v": 48137103,
"vw": 239.4992,
"n": 469685
}
]
}Response Fields:
| Field | Description |
|---|---|
| Timestamp (ISO 8601 UTC) |
| Open price |
| High price |
| Low price |
| Close price |
| Volume |
| Volume-weighted average price |
| Number of transactions |
获取股票的OHLCV(开盘价、最高价、最低价、收盘价、成交量)K线数据。
bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "AAPL",
"interval": "1day",
"from": "2024-12-01",
"to": "2024-12-31"
}'参数说明:
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 股票代码(例如: |
| string | 是 | 时间间隔: |
| date | 是 | 开始日期( |
| date | 是 | 结束日期( |
响应示例:
json
{
"ticker": "AAPL",
"count": 21,
"bars": [
{
"t": "2024-12-02T05:00:00.000Z",
"o": 237.27,
"h": 240.79,
"l": 237.16,
"c": 239.59,
"v": 48137103,
"vw": 239.4992,
"n": 469685
}
]
}响应字段说明:
| 字段 | 描述 |
|---|---|
| 时间戳(ISO 8601 UTC格式) |
| 开盘价 |
| 最高价 |
| 最低价 |
| 收盘价 |
| 成交量 |
| 成交量加权平均价 |
| 交易笔数 |
Get News
获取新闻数据
Retrieve financial news articles with sentiment analysis.
bash
curl -X POST https://api.eng0.ai/api/data/stocks/news \
-H "Content-Type: application/json" \
-d '{
"ticker": "TSLA",
"limit": 5
}'Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Stock symbol |
| number | No | Max articles (default: 10, max: 100) |
Response:
json
{
"count": 5,
"articles": [
{
"title": "Tesla Stock Rises on Strong Delivery Numbers",
"description": "Tesla reported better-than-expected Q4 deliveries...",
"author": "John Smith",
"publisher": "Reuters",
"publishedAt": "2025-01-06T14:30:00Z",
"url": "https://...",
"tickers": ["TSLA"],
"keywords": ["electric vehicles", "deliveries"],
"sentiment": "positive",
"sentimentReasoning": "Article discusses strong delivery numbers and positive market reaction."
}
]
}Sentiment Values: , ,
positivenegativeneutral获取带情感分析的财经新闻文章。
bash
curl -X POST https://api.eng0.ai/api/data/stocks/news \
-H "Content-Type: application/json" \
-d '{
"ticker": "TSLA",
"limit": 5
}'参数说明:
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 股票代码 |
| number | 否 | 最大返回文章数(默认:10,上限:100) |
响应示例:
json
{
"count": 5,
"articles": [
{
"title": "Tesla Stock Rises on Strong Delivery Numbers",
"description": "Tesla reported better-than-expected Q4 deliveries...",
"author": "John Smith",
"publisher": "Reuters",
"publishedAt": "2025-01-06T14:30:00Z",
"url": "https://...",
"tickers": ["TSLA"],
"keywords": ["electric vehicles", "deliveries"],
"sentiment": "positive",
"sentimentReasoning": "Article discusses strong delivery numbers and positive market reaction."
}
]
}情感分析取值: (正面)、(负面)、(中性)
positivenegativeneutralGet Company Details
获取公司详情
Retrieve company information for a stock ticker.
bash
curl -X POST https://api.eng0.ai/api/data/stocks/details \
-H "Content-Type: application/json" \
-d '{"ticker": "AAPL"}'Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Stock symbol |
Response:
json
{
"ticker": "AAPL",
"name": "Apple Inc.",
"description": "Apple Inc. designs, manufactures, and markets smartphones...",
"market": "stocks",
"primaryExchange": "XNAS",
"type": "CS",
"currencyName": "usd",
"marketCap": 3949128102780,
"listDate": "1980-12-12",
"sicDescription": "ELECTRONIC COMPUTERS",
"homepage": "https://www.apple.com",
"totalEmployees": 164000
}获取股票代码对应的公司信息。
bash
curl -X POST https://api.eng0.ai/api/data/stocks/details \
-H "Content-Type: application/json" \
-d '{"ticker": "AAPL"}'参数说明:
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 股票代码 |
响应示例:
json
{
"ticker": "AAPL",
"name": "Apple Inc.",
"description": "Apple Inc. designs, manufactures, and markets smartphones...",
"market": "stocks",
"primaryExchange": "XNAS",
"type": "CS",
"currencyName": "usd",
"marketCap": 3949128102780,
"listDate": "1980-12-12",
"sicDescription": "ELECTRONIC COMPUTERS",
"homepage": "https://www.apple.com",
"totalEmployees": 164000
}Common Workflows
常见使用流程
Get Last 30 Days of Daily Prices
获取最近30天的日K线数据
bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "NVDA",
"interval": "1day",
"from": "2024-12-07",
"to": "2025-01-07"
}'bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "NVDA",
"interval": "1day",
"from": "2024-12-07",
"to": "2025-01-07"
}'Get Intraday Data (1-minute bars)
获取日内数据(1分钟K线)
bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "AAPL",
"interval": "1min",
"from": "2025-01-06",
"to": "2025-01-06"
}'bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "AAPL",
"interval": "1min",
"from": "2025-01-06",
"to": "2025-01-06"
}'Get Weekly Bars for 1 Year
获取1年的周K线数据
bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "MSFT",
"interval": "1week",
"from": "2024-01-01",
"to": "2025-01-01"
}'bash
curl -X POST https://api.eng0.ai/api/data/stocks/bars \
-H "Content-Type: application/json" \
-d '{
"ticker": "MSFT",
"interval": "1week",
"from": "2024-01-01",
"to": "2025-01-01"
}'Get Recent News with Sentiment
获取带情感分析的近期新闻
bash
curl -X POST https://api.eng0.ai/api/data/stocks/news \
-H "Content-Type: application/json" \
-d '{
"ticker": "GOOGL",
"limit": 20
}'bash
curl -X POST https://api.eng0.ai/api/data/stocks/news \
-H "Content-Type: application/json" \
-d '{
"ticker": "GOOGL",
"limit": 20
}'Using with Python
Python调用示例
python
import requests
BASE_URL = "https://api.eng0.ai/api/data"
def get_price_bars(ticker: str, interval: str, from_date: str, to_date: str):
"""Get OHLCV price bars for a stock."""
response = requests.post(
f"{BASE_URL}/stocks/bars",
json={
"ticker": ticker,
"interval": interval,
"from": from_date,
"to": to_date
}
)
return response.json()
def get_news(ticker: str, limit: int = 10):
"""Get news articles with sentiment for a stock."""
response = requests.post(
f"{BASE_URL}/stocks/news",
json={"ticker": ticker, "limit": limit}
)
return response.json()
def get_company_details(ticker: str):
"""Get company information."""
response = requests.post(
f"{BASE_URL}/stocks/details",
json={"ticker": ticker}
)
return response.json()python
import requests
BASE_URL = "https://api.eng0.ai/api/data"
def get_price_bars(ticker: str, interval: str, from_date: str, to_date: str):
"""获取股票的OHLCV价格K线。"""
response = requests.post(
f"{BASE_URL}/stocks/bars",
json={
"ticker": ticker,
"interval": interval,
"from": from_date,
"to": to_date
}
)
return response.json()
def get_news(ticker: str, limit: int = 10):
"""获取股票的带情感分析新闻文章。"""
response = requests.post(
f"{BASE_URL}/stocks/news",
json={"ticker": ticker, "limit": limit}
)
return response.json()
def get_company_details(ticker: str):
"""获取公司信息。"""
response = requests.post(
f"{BASE_URL}/stocks/details",
json={"ticker": ticker}
)
return response.json()Examples
使用示例
bars = get_price_bars("AAPL", "1day", "2024-12-01", "2024-12-31")
print(f"Got {bars['count']} bars for {bars['ticker']}")
news = get_news("TSLA", limit=5)
for article in news['articles']:
print(f"[{article['sentiment']}] {article['title']}")
details = get_company_details("NVDA")
print(f"{details['name']}: Market Cap ${details['marketCap']:,}")
---bars = get_price_bars("AAPL", "1day", "2024-12-01", "2024-12-31")
print(f"获取到{bars['count']}条{bars['ticker']}的K线数据")
news = get_news("TSLA", limit=5)
for article in news['articles']:
print(f"[{article['sentiment']}] {article['title']}")
details = get_company_details("NVDA")
print(f"{details['name']}: 市值 ${details['marketCap']:,}")
---Error Handling
错误处理
Invalid Parameters:
json
{
"error": "Invalid parameters",
"message": "Missing required parameter: ticker"
}Unknown Operation:
json
{
"error": "Unknown operation",
"message": "Operation 'invalid' not found. Available: bars, news, details"
}参数无效:
json
{
"error": "Invalid parameters",
"message": "Missing required parameter: ticker"
}未知操作:
json
{
"error": "Unknown operation",
"message": "Operation 'invalid' not found. Available: bars, news, details"
}Important Notes
重要说明
- Tickers must be UPPERCASE (e.g., , not
AAPL)aapl - All timestamps are UTC (ISO 8601 format)
- Price data is 15-minute delayed
- Historical data available for 5 years
- No rate limits (use responsibly)
- 股票代码必须为大写(例如:,而非
AAPL)aapl - 所有时间戳均为UTC时区(ISO 8601格式)
- 价格数据延迟15分钟
- 历史数据可追溯5年
- 无调用频率限制(请合理使用)
Combining with Other Skills
与其他工具结合使用
This skill provides market data. Combine with:
- sec-edgar-skill (EdgarTools) → SEC filings, financial statements
- financial-deep-research → Full research workflow and reports
Example combined workflow:
- Get company details and recent price bars (this skill)
- Get SEC filings and financial statements (sec-edgar-skill)
- Generate comprehensive research report (financial-deep-research)
此工具提供市场数据,可与以下工具结合:
- sec-edgar-skill(EdgarTools)→ 获取SEC文件、财务报表
- financial-deep-research → 完整的研究流程与报告生成
组合使用示例流程:
- 获取公司详情及近期价格K线(本工具)
- 获取SEC文件及财务报表(sec-edgar-skill)
- 生成全面的研究报告(financial-deep-research)