market-data

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Market Data API

市场数据API

Access US stock market data through eng0's data proxy service.
通过eng0的数据代理服务获取美股市场数据。

Base URL

基础URL

https://api.eng0.ai/api/data
https://api.eng0.ai/api/data

Data Coverage

数据覆盖范围

  • All US stock tickers
  • 5 years of historical data
  • 100% market coverage
  • 15-minute delayed quotes

  • 所有美股代码
  • 5年历史数据
  • 100%市场覆盖
  • 延迟15分钟的报价

Available Endpoints

可用接口

EndpointPurpose
POST /stocks/bars
OHLCV price bars (1min to 1week intervals)
POST /stocks/news
News articles with sentiment analysis
POST /stocks/details
Company information and market cap
GET /schema
API schema discovery

接口用途
POST /stocks/bars
获取OHLCV价格K线(时间间隔从1分钟到1周)
POST /stocks/news
获取带情感分析的新闻文章
POST /stocks/details
获取公司信息及市值数据
GET /schema
发现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:
NameTypeRequiredDescription
ticker
stringYesStock symbol (e.g.,
AAPL
,
MSFT
)
interval
stringYes
1min
,
5min
,
15min
,
30min
,
1hour
,
4hour
,
1day
,
1week
from
dateYesStart date (
YYYY-MM-DD
)
to
dateYesEnd date (
YYYY-MM-DD
)
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:
FieldDescription
t
Timestamp (ISO 8601 UTC)
o
Open price
h
High price
l
Low price
c
Close price
v
Volume
vw
Volume-weighted average price
n
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"
  }'
参数说明:
参数名类型是否必填描述
ticker
string股票代码(例如:
AAPL
MSFT
interval
string时间间隔:
1min
5min
15min
30min
1hour
4hour
1day
1week
from
date开始日期(
YYYY-MM-DD
格式)
to
date结束日期(
YYYY-MM-DD
格式)
响应示例:
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
    }
  ]
}
响应字段说明:
字段描述
t
时间戳(ISO 8601 UTC格式)
o
开盘价
h
最高价
l
最低价
c
收盘价
v
成交量
vw
成交量加权平均价
n
交易笔数

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:
NameTypeRequiredDescription
ticker
stringYesStock symbol
limit
numberNoMax 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:
positive
,
negative
,
neutral

获取带情感分析的财经新闻文章。
bash
curl -X POST https://api.eng0.ai/api/data/stocks/news \
  -H "Content-Type: application/json" \
  -d '{
    "ticker": "TSLA",
    "limit": 5
  }'
参数说明:
参数名类型是否必填描述
ticker
string股票代码
limit
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."
    }
  ]
}
情感分析取值:
positive
(正面)、
negative
(负面)、
neutral
(中性)

Get 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:
NameTypeRequiredDescription
ticker
stringYesStock 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"}'
参数说明:
参数名类型是否必填描述
ticker
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.,
    AAPL
    , not
    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:
  1. Get company details and recent price bars (this skill)
  2. Get SEC filings and financial statements (sec-edgar-skill)
  3. Generate comprehensive research report (financial-deep-research)
此工具提供市场数据,可与以下工具结合:
  • sec-edgar-skill(EdgarTools)→ 获取SEC文件、财务报表
  • financial-deep-research → 完整的研究流程与报告生成
组合使用示例流程:
  1. 获取公司详情及近期价格K线(本工具)
  2. 获取SEC文件及财务报表(sec-edgar-skill)
  3. 生成全面的研究报告(financial-deep-research)