mkts Market Data Skill
A complete financial toolkit for AI agents. Get market overviews, live quotes, historical OHLCV data, earnings calendars, and news from 8+ sources. Screen assets by price, volume, and market cap. Compare tickers side-by-side. Track portfolios with P&L, allocation, and benchmark performance. Log trade rationale in a journal. Manage watchlists. No API key needed for market data — register programmatically for higher limits.
Base URL: INLINECODE0
Auth: No API key required for basic access (20 req/hour per IP). For higher limits, register for a free key and pass it via header: INLINECODE1
Register for an API Key (Optional)
Get a free API key programmatically for higher rate limits (100 req/hour):
curl -s -X POST -H "Content-Type: application/json" \
-d '{"email":"you@example.com","name":"my-agent"}' \
https://mkts.io/api/v1/register
Returns
{ "success": true, "data": { "apiKey": "mk_live_...", ... } }. Save the key — it is shown only once. Max 3 keys per email.
Endpoints
Market Overview
Get global market stats (total market cap, BTC dominance, etc.):
CODEBLOCK1
List Assets
Get a filtered, paginated list of assets:
CODEBLOCK2
Query params: type (crypto|stock|etf|commodity|forex), sector, platform, marketType, search, limit (1-500), offset, sort (price|change24h|volume24h|marketCap), dir (asc|desc)
Single Asset
Get details for a specific asset by symbol:
CODEBLOCK3
Live Quote (Real-time)
Get a fresh quote directly from Yahoo Finance or CoinGecko (shared 60s cache, stricter rate limits):
CODEBLOCK4
For stocks/ETFs, the response includes extended-hours fields when available: marketState (PRE, REGULAR, POST, CLOSED), preMarketPrice, preMarketChange, preMarketChangePercent, preMarketTime, postMarketPrice, postMarketChange, postMarketChangePercent, postMarketTime. Times are Unix timestamps in milliseconds. Fields are null when the market is not in that session or for asset types that trade 24/7 (crypto).
Top Movers
Get top gainers and losers:
CODEBLOCK5
Screener
Filter assets with range conditions:
CODEBLOCK6
Query params: type, sector, minPrice, maxPrice, minChange, maxChange, minVolume, maxVolume, minMarketCap, maxMarketCap, limit, offset, sort, INLINECODE35
Sector Performance
Get aggregate performance by sector:
CODEBLOCK7
Compare Assets
Compare multiple assets side-by-side:
CODEBLOCK8
Market Brief
Get a curated summary ideal for morning briefings or agent digests:
CODEBLOCK9
Returns: global market stats, top 5 gainers/losers, sector summary, and natural-language highlights.
Macro Snapshot
Get key macro indicators in one call (BTC, ETH, S&P 500, Nasdaq, Gold, Oil, DXY, VIX, 10Y):
CODEBLOCK10
Returns { indicators, generatedAt }. Each indicator has name, symbol, price, and change24h. Snapshot assets (BTC, ETH, SPY, QQQ, GC=F, CL=F) update on data refresh; live indicators (DX-Y.NYB, ^VIX, ^TNX) are fetched in real-time with 60s caching.
News
Get latest financial news from RSS feeds (free, no extra API cost):
CODEBLOCK11
Query params: category (crypto|markets|commodities|forex), symbol (filter by asset symbol — overrides category), limit (1-50, default 20).
Returns { count, news, sources } (plus symbol when filtering by symbol). Each news item has title, link, pubDate, source, and category. Sources include CoinDesk, Cointelegraph, Decrypt, MarketWatch, CNBC, Investing.com, OilPrice, and FXStreet.
Historical Prices (OHLCV)
Get daily historical candles for any asset:
CODEBLOCK12
Query params: range (1M|3M|6M|YTD|1Y, default 3M).
Returns { symbol, range, candles, source }. Each candle has date, close, and optionally open, high, low, volume. Stocks/ETFs/commodities include full OHLCV; crypto includes close + volume only.
Earnings Calendar
Get earnings dates, EPS estimates, and recent quarter history:
CODEBLOCK13
Query params: symbols (comma-separated, max 20) OR week (current|next). Only stocks and ETFs — crypto/commodities are not supported.
Returns { earnings } array. Each record has symbol, name, earningsDate, earningsDates, epsEstimate, epsActual, revenueEstimate, surprisePercent, and recentQuarters (array of { date, actual, estimate }).
Stock/ETF Details (Fundamentals)
Get comprehensive company data: profile, financials, earnings, analyst consensus, ownership, insider activity, SEC filings, and ETF holdings:
CODEBLOCK14
Stocks and ETFs only — crypto, commodities, and forex are not supported. Real-time Yahoo Finance call with a shared 60s DynamoDB-backed cache (counts against live rate limits).
Returns a rich object with: symbol, name, description, website, industry, sector, employees, headquarters, executives, trailingPE, forwardPE, dividendYield, beta, fiftyTwoWeekHigh, fiftyTwoWeekLow, targetPrice, recommendationKey, numberOfAnalysts, totalRevenue, revenueGrowth, grossMargins, operatingMargins, profitMargins, ebitda, returnOnAssets, returnOnEquity, totalCash, totalDebt, debtToEquity, freeCashflow, operatingCashflow, currentRatio, earningsGrowth, revenuePerShare, earningsQuarterly, earningsYearly, forwardEstimates, insidersPercentHeld, institutionsPercentHeld, topInstitutionalHolders, insiderTransactions, netSharePurchaseActivity, recommendationTrend, upgradeDowngradeHistory, calendarEvents, secFilings. ETFs additionally include fundFamily, category, and topHoldings (holdings array, sector weightings, equity holdings ratios).
SEC Filings
Get filings directly without pulling the full company details payload:
CODEBLOCK15
Query params: type (optional SEC form type, e.g. 10-K, 10-Q, 8-K), limit (1-50, default 20). Backed by a shared 5-minute DynamoDB cache per symbol.
Returns { symbol, count, filings, fetchedAt }. Each filing has date, type, title, and edgarUrl.
Filings Search
Search filings across a bounded stock or ETF universe:
CODEBLOCK16
Query params: type (stock or etf, default stock), sector, search, symbols, filingType, title, minMarketCap, maxMarketCap, dateFrom, dateTo, limit, universe.
INLINECODE146 is capped at 25 tickers. universe is bounded by tier: keyless 10, free key 40, premium 150. dateFrom and dateTo use YYYY-MM-DD. The endpoint uses your snapshot to define the candidate universe, then fetches filings live from Yahoo Finance with a shared per-symbol cache and a shared short-lived result cache.
Returns { results, total, limit, scanned, universe, source }. Each result includes symbol, name, sector, marketCap, and a nested filing object with date, type, title, and edgarUrl. Response headers include X-Query-Cache (hit or miss) and X-Query-Universe (effective capped universe).
Trending / Market Highlights
Get the most active stocks, top gainers, and top losers from Yahoo Finance screener (pre-cached, updated every 30 minutes):
CODEBLOCK17
Query params: section (trending|gainers|losers — omit for all), count (1-50, limits results per section).
Returns { trending, gainers, losers, fetchedAt }. Each item has symbol, shortName, price, change, changePct, volume, marketCap. US equities only. Snapshot endpoint (not live), no extra Yahoo calls.
Fundamentals Time Series
Get historical financial statements (income statement, balance sheet, cash flow) with computed margins:
CODEBLOCK18
Query params: type (annual|quarterly, default annual), module (all|financials|balance-sheet|cash-flow, default all).
Stocks and ETFs only — crypto, commodities, and forex are not supported. Real-time Yahoo Finance call with a shared 60s DynamoDB-backed cache (counts against live rate limits).
Returns { symbol, type, module, periods, fetchedAt }. Each period has: date, periodLabel, revenue, costOfRevenue, grossProfit, operatingIncome, netIncome, ebitda, eps, grossMargin, operatingMargin, netMargin, totalAssets, totalLiabilities, stockholdersEquity, totalDebt, cashAndEquivalents, workingCapital, operatingCashFlow, capitalExpenditure, freeCashFlow. Margins are decimals (0.35 = 35%). Periods are sorted chronologically (oldest first).
Fundamentals Screener
Screen stocks or ETFs using valuation, profitability, growth, leverage, liquidity, and cash-flow metrics:
CODEBLOCK19
Query params: type (stock or etf, default stock), sector, search, symbols, limit, universe, sort, dir, minMarketCap, maxMarketCap, minTrailingPE, maxTrailingPE, minForwardPE, maxForwardPE, minRevenueGrowth, maxRevenueGrowth, minGrossMargin, maxGrossMargin, minOperatingMargin, maxOperatingMargin, minProfitMargin, maxProfitMargin, minReturnOnEquity, maxReturnOnEquity, minReturnOnAssets, maxReturnOnAssets, minDebtToEquity, maxDebtToEquity, minCurrentRatio, maxCurrentRatio, minDividendYield, maxDividendYield, minFreeCashflow, maxFreeCashflow, minTotalRevenue, maxTotalRevenue, minEarningsGrowth, maxEarningsGrowth, minTargetPriceUpside, maxTargetPriceUpside.
INLINECODE245 is capped at 25 tickers. universe is bounded by tier: keyless 10, free key 40, premium 150. Margin, yield, growth, and upside fields are decimals (0.20 = 20%). The screener enriches a capped snapshot universe with shared-cache company details, then filters and sorts the enriched set. Query results also use a shared short-lived result cache.
Returns { results, total, limit, scanned, universe, source }. Each result includes snapshot fields plus valuation, growth, profitability, leverage, and analyst fields. Response headers include X-Query-Cache (hit or miss) and X-Query-Universe (effective capped universe).
Options Chain
Get the options chain for a stock or ETF (calls, puts, open interest, implied volatility, expirations):
CODEBLOCK20
Stocks and ETFs only — crypto, commodities, and forex are not supported. Real-time Yahoo Finance call with a shared 60s DynamoDB-backed cache (counts against live rate limits).
Returns symbol, expirations (array of available dates), selectedExpiration, lastPrice, calls, puts, and summary (totalCallOI, totalPutOI, putCallRatio, totalCallVolume, totalPutVolume). Each contract has strike, lastPrice, bid, ask, change, percentChange, volume, openInterest, impliedVolatility, inTheMoney, expiration, contractSymbol.
Portfolio Card Image
Generate a shareable 1200×630 PNG card showing portfolio summary:
CODEBLOCK21
Query params: range (1M|3M|6M|YTD|1Y, default YTD). Requires API key. Returns image/png.
The card shows total portfolio value, gain/loss with color coding, a sparkline chart, and top holdings by allocation.
Portfolio (Read)
Get the authenticated user's portfolio holdings with current prices, P&L, and allocation:
CODEBLOCK22
Returns totalValue, totalCost, totalGainLoss, totalGainLossPercent, dayChange, dayChangePercent, and a holdings array. Each holding includes symbol, name, type, quantity, avgCostBasis, currentPrice, currentValue, costBasis, gainLoss, gainLossPercent, dayChange, dayChangePercent, and allocation (percentage of portfolio). An empty portfolio returns zero totals and an empty holdings array.
Portfolio (Write)
Add, remove, or clear holdings:
CODEBLOCK23
POST body fields: symbol (required, uppercase), name (required), assetType (crypto|stock|etf|commodity|forex), quantity (> 0), avgCostBasis (>= 0). Optional: purchaseDate (ISO string, max 20 chars), notes (max 1000 chars).
Returns the created holding with a server-generated id.
Portfolio Performance with Benchmarks
Compare your portfolio's historical performance against market benchmarks:
CODEBLOCK24
Query params: range (1M|3M|6M|YTD|1Y|ALL), benchmarks (comma-separated, max 4 from: SPY, QQQ, DIA, IWM, BTC-USD, GLD, AGG).
Returns portfolio.percentChange, portfolio.startValue, portfolio.endValue, per-benchmark percentChange, and a unified chartData array with daily percentage changes. Empty portfolio returns zero values.
Journal
Log trade rationale, notes, and observations:
CODEBLOCK25
POST body fields: title (required, max 200), content (required, max 10000). Optional: symbol, tags (array from: thesis, lesson, mistake, observation, buy, sell, watchlist).
GET returns { count, entries } sorted by most recent first.
Watchlist
Create and manage watchlists of symbols:
CODEBLOCK26
POST body fields: name (required, max 100 chars). Optional: symbols (array of uppercase symbols).
PATCH body fields (all optional): name, addSymbols (array), removeSymbols (array).
GET returns { count, watchlists } sorted by most recent first. Each watchlist has id, userId, name, symbols, createdAt, updatedAt.
Response Format
All responses follow this structure:
CODEBLOCK27
Errors:
CODEBLOCK28
Rate Limits
| Tier | Snapshot endpoints | Live endpoints |
|---|
| Keyless (no API key) | 20 req/hour per IP | 20 req/hour per IP |
| Free (with API key) |
100 req/hour | 10 req/hour |
| Premium | 1,000 req/hour | 100 req/hour |
When rate limited, you'll receive a 429 response with a Retry-After header (in seconds). Register at POST /register for higher limits.
Error Handling
- - 401: Invalid API key, or API key required (portfolio/journal/watchlist endpoints)
- 404: Asset not found
- 429: Rate limit exceeded — wait and retry after
Retry-After seconds - 500/502/503: Server error — retry with backoff
Ask (Natural Language)
Query market data using natural language. Requires API key. Counts against daily AI usage limit (5/day free, unlimited premium).
CODEBLOCK29
POST body: { "q": "your question" } (max 500 chars). Returns { query, action, summary, results, timestamp }. Supported actions: screen, lookup, compare, movers, macro, brief. Results are cached for 5 minutes.
Tips for Agents
- - No API key needed to start — market data endpoints work without auth (20 req/hour). Register at
POST /register when you need higher limits - Portfolio, journal, and watchlist endpoints require an API key — register first if you need these
- Use
/v1/brief for morning market summaries — it combines everything in one call - Use
/v1/screen for building watchlists or alert conditions - Use
/v1/compare when the user asks to compare specific tickers - Use
/v1/asset/{symbol}/live only when the user needs a fresh quote — it has stricter rate limits - Parse the
meta.requestsRemaining field to manage your rate limit budget - The
highlights array in /v1/brief contains pre-formatted natural-language summaries - Use
/v1/portfolio when the user asks about their holdings, P&L, allocation, or portfolio performance - Use
POST /v1/portfolio to add holdings — the id is generated server-side, use it for subsequent deletes - Use
/v1/portfolio/performance?range=YTD&benchmarks=SPY to answer "how am I doing vs the S&P?" - Use
/v1/journal to log trade rationale — attach a symbol and tags for better organization - Portfolio, journal, and watchlist endpoints return
Cache-Control: private, no-store — do not cache these - Use
/v1/watchlist to manage symbol watchlists — create a list, then use /v1/compare or /v1/screen with those symbols - Use
PATCH /v1/watchlist/{id} with addSymbols/removeSymbols to manage symbols without replacing the whole list - Use
/v1/news?category=crypto to get relevant headlines before making trade decisions - Use
/v1/asset/{symbol}/history for technical analysis — stocks get full OHLCV, crypto gets close + volume - Use
/v1/earnings?symbols=AAPL before earnings season — check EPS estimates and recent quarter surprises - Use
/v1/earnings?week=current for a quick weekly earnings calendar (zero real-time API calls) - Use
/v1/portfolio/card to generate a shareable portfolio image — pipe to a file with INLINECODE367 - Use
/v1/news?symbol=AAPL to get news specifically about an asset — searches all feeds by symbol and company name - Use
/v1/macro for a quick macro dashboard — BTC, ETH, S&P 500, Nasdaq, Gold, Oil, DXY, VIX, and 10Y in one call - Use
/v1/asset/{symbol}/details for deep fundamental analysis — earnings, analyst targets, insider activity, SEC filings, and ETF holdings in one call - Use
/v1/asset/{symbol}/options for derivatives analysis — get the full options chain with calls, puts, OI, IV, and all available expirations. Combine with /v1/asset/{symbol}/live for delta-neutral strategies - Use
/v1/trending for live market movers — most active, top gainers, top losers. Pre-cached from Yahoo screener, no live rate limit cost. Filter by ?section=gainers or limit with INLINECODE375 - Use
/v1/asset/{symbol}/fundamentals for historical financial analysis — revenue trends, margin evolution, balance sheet health over 5 years. Use ?type=quarterly for recent quarter-by-quarter trends - Use
POST /v1/ask for complex natural language queries — it parses intent and routes to the right data. Requires API key, counts against AI daily limit
mkts 市场数据技能
AI代理的完整金融工具包。获取市场概览、实时报价、历史OHLCV数据、财报日历以及来自8+来源的新闻。按价格、成交量和市值筛选资产。并排比较股票代码。通过盈亏、配置和基准表现跟踪投资组合。在日志中记录交易理由。管理观察列表。市场数据无需API密钥——通过编程注册可获得更高限制。
基础URL: https://mkts.io/api/v1
认证: 基本访问无需API密钥(每个IP每小时20次请求)。如需更高限制,请注册免费密钥并通过标头传递:-H X-API-Key: $MKTSAPIKEY
注册API密钥(可选)
通过编程方式获取免费API密钥以获得更高速率限制(每小时100次请求):
bash
curl -s -X POST -H Content-Type: application/json \
-d {email:you@example.com,name:my-agent} \
https://mkts.io/api/v1/register
返回 { success: true, data: { apiKey: mklive..., ... } }。请保存密钥——仅显示一次。每个邮箱最多3个密钥。
端点
市场概览
获取全球市场统计数据(总市值、比特币主导地位等):
bash
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/market
列出资产
获取经过筛选的分页资产列表:
bash
所有资产(默认:按市值前50名)
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/assets
按类型筛选
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/assets?type=stock&limit=20
按行业筛选
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/assets?type=stock§or=technology
按名称或代码搜索
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/assets?search=apple
分页和排序
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/assets?sort=change24h&dir=desc&limit=10&offset=0
查询参数:type (crypto|stock|etf|commodity|forex), sector, platform, marketType, search, limit (1-500), offset, sort (price|change24h|volume24h|marketCap), dir (asc|desc)
单个资产
按代码获取特定资产的详细信息:
bash
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/asset/AAPL
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/asset/BTC
实时报价
直接从雅虎财经或CoinGecko获取最新报价(共享60秒缓存,更严格的速率限制):
bash
自动检测来源
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/asset/AAPL/live
强制加密货币来源
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/asset/bitcoin/live?type=crypto
对于股票/ETF,响应在可用时包含盘前盘后字段:marketState (PRE, REGULAR, POST, CLOSED), preMarketPrice, preMarketChange, preMarketChangePercent, preMarketTime, postMarketPrice, postMarketChange, postMarketChangePercent, postMarketTime。时间为Unix毫秒时间戳。当市场不在该交易时段或对于全天候交易的资产类型(加密货币)时,字段为null。
最大涨跌幅
获取涨幅最大和跌幅最大的股票:
bash
同时获取涨幅和跌幅
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/movers
仅涨幅,限制为加密货币
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/movers?direction=gainers&type=crypto&limit=5
筛选器
使用范围条件筛选资产:
bash
跌幅超过3%的股票,市值 > 100亿美元
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/screen?type=stock&maxChange=-3&minMarketCap=10000000000
价格低于1美元且成交量高的加密货币
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/screen?type=crypto&maxPrice=1&minVolume=1000000
查询参数:type, sector, minPrice, maxPrice, minChange, maxChange, minVolume, maxVolume, minMarketCap, maxMarketCap, limit, offset, sort, dir
行业表现
按行业获取汇总表现:
bash
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/sectors
比较资产
并排比较多个资产:
bash
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/compare?symbols=AAPL,MSFT,GOOGL
市场简报
获取适合晨间简报或代理摘要的精选摘要:
bash
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/brief
返回:全球市场统计、前5名涨跌幅、行业摘要和自然语言亮点。
宏观快照
一次调用获取关键宏观指标(BTC、ETH、标普500、纳斯达克、黄金、原油、美元指数、VIX、10年期国债):
bash
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/macro
返回 { indicators, generatedAt }。每个指标包含 name, symbol, price, 和 change24h。快照资产(BTC、ETH、SPY、QQQ、GC=F、CL=F)在数据刷新时更新;实时指标(DX-Y.NYB、^VIX、^TNX)实时获取,60秒缓存。
新闻
从RSS源获取最新财经新闻(免费,无额外API费用):
bash
所有新闻
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/news
按类别筛选
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/news?category=crypto&limit=10
特定代码的新闻(按代码+公司名称搜索所有源)
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/news?symbol=HOOD
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/news?symbol=AAPL&limit=5
查询参数:category (crypto|markets|commodities|forex), symbol(按资产代码筛选——覆盖类别), limit (1-50, 默认20)。
返回 { count, news, sources }(按代码筛选时额外返回 symbol)。每条新闻包含 title, link, pubDate, source, 和 category。来源包括CoinDesk、Cointelegraph、Decrypt、MarketWatch、CNBC、Investing.com、OilPrice和FXStreet。
历史价格(OHLCV)
获取任何资产的每日历史K线:
bash
股票——来自雅虎财经的完整OHLCV
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/asset/AAPL/history?range=3M
加密货币——来自CoinGecko的收盘价+成交量(最多365天)
curl -s -H X-API-Key: $MKTS
APIKEY https://mkts.io/api/v1/asset/BTC/history?range=1Y
查询参数