G-Prophet AI Skills Documentation
Stock prediction and market analysis capabilities for AI agents
Overview
G-Prophet is an AI-powered stock prediction platform that exposes its core capabilities through an external API for other AI agent systems. It supports global markets (China A-shares, US stocks, HK stocks, Crypto) and provides AI prediction, technical analysis, market sentiment, and deep analysis Skills.
Basic Information
| Item | Description |
|---|
| API Base URL | INLINECODE0 |
| Authentication |
X-API-Key header |
| Key Format |
gp_sk_ prefix (e.g.
gp_sk_[REDACTED]_a1b2c3...) |
| Response Format | JSON |
| Billing | Points-based, each call consumes corresponding points |
Authentication
All requests must include an API Key in the HTTP header:
CODEBLOCK0
API Keys can be created in the G-Prophet platform under "Settings → API Key Management".
Security Recommendations
- - Store API keys in environment variables (
GPROPHET_API_KEY), not in code - Use test/limited-scope keys for development and evaluation
- Monitor usage and billing regularly at https://www.gprophet.com/dashboard
- Rotate keys periodically and revoke compromised keys immediately
- Never commit API keys to version control or share them publicly
Rate Limiting
All API requests are subject to per-key rate limiting (fixed window, per minute).
| Header | Description |
|---|
| INLINECODE5 | Maximum requests allowed per minute |
| INLINECODE6 |
Remaining requests in current window |
|
X-RateLimit-Reset | Seconds until the rate limit window resets |
Default limit is 60 requests per minute per API Key. When exceeded, the API returns HTTP 429:
CODEBLOCK1
The response includes a Retry-After header indicating how many seconds to wait.
Quota Management
Each API Key has configurable daily and monthly call quotas. Quota = 0 means unlimited.
When quota is exceeded, the API returns HTTP 429:
CODEBLOCK2
Check your current quota usage via GET /account/balance.
Unified Response Format
Success Response
CODEBLOCK3
Error Response
Errors return the appropriate HTTP status code (401, 402, 403, 404, 429, 500, 503) along with a JSON body:
CODEBLOCK4
Insufficient Points Response (402)
When points are insufficient, the API returns a detailed 402 response with actionable guidance:
CODEBLOCK5
Points Cost
| Skill | Endpoint | Points/Call |
|---|
| Stock Prediction | INLINECODE10 | CN 10, HK 15, US 20, Crypto 20 |
| Algorithm Compare |
POST /predictions/compare | Single prediction cost × number of algorithms |
| Quote |
GET /market-data/quote | 5 |
| History |
GET /market-data/history | 5 |
| Search |
GET /market-data/search | 5 |
| Batch Quote |
POST /market-data/batch-quote | 5 × number of symbols |
| Technical Analysis |
POST /technical/analyze | 5 |
| Fear & Greed Index |
GET /sentiment/fear-greed | 5 |
| Market Overview |
GET /sentiment/market-overview | 5 |
| AI Stock Analysis |
POST /analysis/stock | 58 |
| Deep Analysis |
POST /analysis/comprehensive | 150 |
| Task Polling |
GET /analysis/task/{task_id} | 0 (free) |
| Account Balance |
GET /account/balance | 0 (free) |
| Usage Statistics |
GET /account/usage | 0 (free) |
| API Info |
GET /info | 0 (free) |
Skill 1: Stock Price Prediction
Predict future stock/cryptocurrency price movements using AI algorithms. Supports G-Prophet2026V1, LSTM, Transformer, and more.
POST /predictions/predict
Request Body (JSON):
| Parameter | Type | Required | Default | Description |
|---|
| symbol | string | ✅ | - | Stock/crypto ticker (e.g. AAPL, 600519, BTCUSDT) |
| market |
string | ✅ | - | Market code:
US,
CN,
HK,
CRYPTO |
| days | integer | No | 7 | Prediction days, range 1-30 |
| algorithm | string | No | auto | Algorithm:
auto,
gprophet2026v1,
lstm,
transformer,
random_forest,
ensemble |
Example Request:
CODEBLOCK6
Example Response:
CODEBLOCK7
POST /predictions/compare
Multi-algorithm comparison prediction. Returns results from each algorithm and the best recommendation. Points cost = single prediction cost × number of algorithms.
Request Body (JSON):
| Parameter | Type | Required | Default | Description |
|---|
| symbol | string | ✅ | - | Stock/crypto ticker |
| market |
string | ✅ | - | Market code:
US,
CN,
HK,
CRYPTO |
| days | integer | No | 5 | Prediction days, range 1-30 |
| algorithms | string[] | No | ["gprophet2026v1","lstm","transformer","ensemble"] | Algorithm list, max 6 |
Example Request:
CODEBLOCK8
Example Response:
CODEBLOCK9
Skill 2: Market Data
Get real-time quotes, historical OHLCV data, search for stocks/crypto, and batch quotes. Each call costs 5 points (batch = 5 × count).
GET /market-data/quote
Get real-time quote.
Query Parameters:
| Parameter | Type | Required | Description |
|---|
| symbol | string | ✅ | Stock/crypto ticker |
| market |
string | ✅ | Market code:
US,
CN,
HK,
CRYPTO |
Example Request:
CODEBLOCK10
Example Response:
CODEBLOCK11
GET /market-data/history
Get historical OHLCV candlestick data.
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|
| symbol | string | ✅ | - | Stock/crypto ticker |
| market |
string | ✅ | - | Market code |
| period | string | No | 3m | Time range:
1w,
1m,
3m,
6m,
1y,
2y |
Example Request:
CODEBLOCK12
Example Response:
CODEBLOCK13
GET /market-data/search
Search for stocks/crypto by keyword.
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|
| keyword | string | ✅ | - | Search keyword |
| market |
string | No | US | Market code |
| limit | integer | No | 10 | Result count, range 1-50 |
Example Request:
CODEBLOCK14
POST /market-data/batch-quote
Get quotes for multiple symbols in a single request. Max 20 symbols. Cost = 5 points × number of symbols.
Request Body (JSON):
| Parameter | Type | Required | Description |
|---|
| symbols | string[] | ✅ | List of stock/crypto tickers (max 20) |
| market |
string | ✅ | Market code:
US,
CN,
HK,
CRYPTO |
Example Request:
CODEBLOCK15
Example Response:
CODEBLOCK16
Skill 3: Technical Analysis
Calculate technical indicators and generate trading signals for a given stock. Each call costs 5 points.
POST /technical/analyze
Request Body (JSON):
| Parameter | Type | Required | Default | Description |
|---|
| symbol | string | ✅ | - | Stock/crypto ticker |
| market |
string | ✅ | - | Market code:
US,
CN,
HK,
CRYPTO |
| indicators | string[] | No | ["rsi","macd","bollinger","kdj"] | Indicators:
rsi,
macd,
bollinger,
kdj,
sma,
ema |
Example Request:
CODEBLOCK17
Example Response:
CODEBLOCK18
Skill 4: Market Sentiment
Get market sentiment data including Fear & Greed Index and market overview. Each call costs 5 points.
GET /sentiment/fear-greed
Get the crypto market Fear & Greed Index.
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|
| days | integer | No | 1 | History days, 1=current only, range 1-365 |
Example Request:
CODEBLOCK19
Example Response:
CODEBLOCK20
GET /sentiment/market-overview
Get comprehensive market overview (breadth, hot sectors, major indices).
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|
| market | string | No | CN | Market code: CN, INLINECODE64 |
Example Request:
CODEBLOCK21
Skill 5: AI Stock Analysis (Async)
Single-stock AI analysis report using LLM. Costs 58 points. Supports CN, US, CRYPTO markets.
⚠️ Async Mode: Analysis typically takes 15-60 seconds, so this endpoint uses async mode.
- 1.
POST /analysis/stock → Returns task_id immediately - INLINECODE67 → Poll for status; get results when INLINECODE68
Recommended polling interval: 5 seconds. Max wait: 5 minutes.
POST /analysis/stock
Submit a stock analysis task. Returns task ID immediately.
Request Body (JSON):
| Parameter | Type | Required | Default | Description |
|---|
| symbol | string | ✅ | - | Stock/crypto ticker |
| market |
string | ✅ | - | Market code:
US,
CN,
CRYPTO |
| locale | string | No | zh-CN | Report language:
zh-CN,
en-US |
| callback_url | string | No | - | Webhook URL; results are POSTed on completion |
Example Request:
CODEBLOCK22
Example Response (immediate):
CODEBLOCK23
Skill 6: Deep Analysis (Async)
Multi-agent collaborative deep analysis evaluating stocks from 5 dimensions: technical, fundamental, capital flow, sentiment, and macro environment. Costs 150 points.
⚠️ Async Mode: Deep analysis typically takes 30-120 seconds, so this endpoint uses async mode.
- 1.
POST /analysis/comprehensive → Returns task_id immediately - INLINECODE76 → Poll for status; get results when INLINECODE77
Recommended polling interval: 5 seconds. Max wait: 5 minutes.
POST /analysis/comprehensive
Submit a deep analysis task. Returns task ID immediately.
Request Body (JSON):
| Parameter | Type | Required | Default | Description |
|---|
| symbol | string | ✅ | - | Stock/crypto ticker |
| market |
string | ✅ | - | Market code:
US,
CN,
HK,
CRYPTO |
| locale | string | No | zh-CN | Report language:
zh-CN,
en-US |
| callback_url | string | No | - | Webhook URL; results are POSTed on completion |
Example Request:
CODEBLOCK24
Example Response (immediate):
CODEBLOCK25
Webhook Callback
Both /analysis/stock and /analysis/comprehensive accept an optional callback_url parameter. When provided, the API will POST the task result to that URL upon completion or failure:
Callback Payload (success):
CODEBLOCK26
Callback Payload (failure):
CODEBLOCK27
GET /analysis/task/{task_id}
Poll analysis task status and results.
Path Parameters:
| Parameter | Type | Description |
|---|
| task_id | string | Task ID returned by analysis endpoints |
Status Flow: pending → running (progress 0-100) → completed / INLINECODE90
Example Response (completed):
CODEBLOCK28
Account Endpoints
GET /account/balance
Check current API Key's points balance and quota usage. Free, no points consumed.
Example Request:
CODEBLOCK29
Example Response:
CODEBLOCK30
GET /account/usage
Get call history statistics for the current API Key. Free, no points consumed.
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|
| days | integer | No | 7 | History days, range 1-90 |
Example Request:
CODEBLOCK31
Example Response:
CODEBLOCK32
GET /info
Get API metadata: supported markets, algorithms, pricing table, authentication info. Free, no points consumed.
Example Request:
CODEBLOCK33
Error Codes
| Code | HTTP Status | Description |
|---|
| MISSINGAPIKEY | 401 | Missing X-API-Key header |
| INVALIDKEYFORMAT |
401 | Invalid API Key format (must start with gp
sk) |
| INVALID
APIKEY | 401 | Invalid API Key |
| API
KEYDISABLED | 403 | API Key has been disabled |
| API
KEYEXPIRED | 403 | API Key has expired |
| INSUFFICIENT_SCOPE | 403 | API Key lacks permission for this Skill |
| INSUFFICIENT_POINTS | 402 | Insufficient points |
| POINTS
DEDUCTIONFAILED | 500 | Failed to deduct points |
| OWNER
NOTFOUND | 403 | API Key owner account not found |
| RATE_LIMITED | 429 | Request frequency exceeded per-minute limit |
| QUOTA_EXCEEDED | 429 | Daily or monthly call quota exhausted |
| INVALID_MARKET | 400 | Unsupported market code |
| UNSUPPORTED_MARKET | 400 | Market not supported for this endpoint |
| SYMBOL
NOTFOUND | 404 | Stock/crypto ticker not found |
| NO_DATA | 404 | Unable to retrieve data |
| TOO
MANYALGORITHMS | 400 | Too many algorithms (max 6) |
| PREDICTION_FAILED | 500 | Prediction service error |
| ANALYSIS_FAILED | 500 | Analysis service error |
| TASK
NOTFOUND | 404 | Async task not found or expired |
| FORBIDDEN | 403 | Access denied (e.g. querying another user's task) |
| DATA_UNAVAILABLE | 503 | Data source temporarily unavailable |
| INTERNAL_ERROR | 500 | Internal service error |
MCP Tools Definitions
MCP (Model Context Protocol) tool definitions for use with Claude, Kiro, and other MCP-compatible agents:
gprophet_predict
CODEBLOCK34
gprophet_quote
CODEBLOCK35
gprophetbatchquote
CODEBLOCK36
gprophet_history
CODEBLOCK37
gprophet_search
CODEBLOCK38
gprophet_technical
CODEBLOCK39
gprophetfeargreed
CODEBLOCK40
gprophetmarketoverview
CODEBLOCK41
gprophetanalyzestock
CODEBLOCK42
gprophetanalyzecomprehensive
CODEBLOCK43
gprophettaskstatus
CODEBLOCK44
gprophet_balance
CODEBLOCK45
gprophet_info
CODEBLOCK46
Integration Guide
Typical Prediction Flow
CODEBLOCK47
Typical Stock Analysis Flow
CODEBLOCK48
Typical Deep Analysis Flow
CODEBLOCK49
Webhook Integration Flow
CODEBLOCK50
Agent Integration Tips
- - Search before predicting: If unsure about a ticker, use
gprophet_search to confirm first - Combine skills: Prediction + Technical Analysis + Sentiment = more comprehensive judgment
- Points management: Use
gprophet_balance to check points before expensive operations - Batch operations: Use
gprophet_batch_quote instead of multiple single quotes to save API calls - Error handling: Check the
success field; on failure, refer to error.code for retry logic - Rate limiting: Respect
X-RateLimit-Remaining header; back off when approaching 0 - Webhooks: Use
callback_url for analysis tasks to avoid polling overhead
Python SDK
Install the official Python SDK for easier integration:
CODEBLOCK51
CODEBLOCK52
MCP Server
Run the standalone MCP server for AI agent integration:
CODEBLOCK53
Supported Market Codes
| Code | Market | Ticker Format | Example Tickers |
|---|
| CN | China A-shares | 6-digit number. 6xxxxx=Shanghai, 0/3xxxxx=Shenzhen | 600519, 000001, 300750 |
| US |
US Stocks | Alphabetic ticker symbol | AAPL, TSLA, GOOGL, MSFT |
| HK | Hong Kong Stocks | Numeric code (no zero-padding needed) | 700, 9988, 1810, 3007 |
| CRYPTO | Cryptocurrency | Trading pair (ending in USDT) | BTCUSDT, ETHUSDT, SOLUSDT |
⚠️ A-share Ticker Notes:
- - A-share tickers are 6-digit numbers; different prefixes indicate different exchanges/boards
- INLINECODE98 = Shanghai Stock Exchange (Main Board / STAR Market)
- INLINECODE99 = Shenzhen Stock Exchange (Main Board / SME Board)
- INLINECODE100 = Shenzhen Stock Exchange (ChiNext / Growth Enterprise Market)
- Make sure to pass the correct 6-digit code, e.g.
600986 and 000001 are different stocks
Supported Prediction Algorithms
| Algorithm | Description |
|---|
| auto | Automatically select the best algorithm |
| gprophet2026v1 |
G-Prophet2026V1 proprietary model (recommended) |
| lstm | Long Short-Term Memory network |
| transformer | Transformer model |
| random_forest | Random Forest |
| ensemble | Ensemble learning (multi-algorithm fusion) |
G-Prophet AI 技能文档
面向AI代理的股票预测与市场分析能力
概述
G-Prophet 是一个基于人工智能的股票预测平台,通过外部API向其他AI代理系统开放其核心能力。它支持全球市场(中国A股、美股、港股、加密货币),并提供AI预测、技术分析、市场情绪和深度分析技能。
基本信息
| 项目 | 描述 |
|---|
| API 基础URL | https://www.gprophet.com/api/external/v1 |
| 认证方式 |
X-API-Key 请求头 |
| 密钥格式 | gp
sk 前缀(例如 gp
sk[已编辑]_a1b2c3...) |
| 响应格式 | JSON |
| 计费方式 | 基于积分,每次调用消耗相应积分 |
认证
所有请求必须在HTTP请求头中包含API密钥:
X-API-Key: gpsk[已编辑]_你的API密钥
API密钥可在G-Prophet平台的设置 → API密钥管理中创建。
安全建议
- - 将API密钥存储在环境变量(GPROPHETAPIKEY)中,而非代码中
- 在开发和评估阶段使用测试/受限范围的密钥
- 定期在 https://www.gprophet.com/dashboard 监控使用情况和计费
- 定期轮换密钥,一旦泄露立即撤销
- 切勿将API密钥提交到版本控制系统或公开分享
速率限制
所有API请求均受每密钥速率限制(固定窗口,每分钟)。
| 请求头 | 描述 |
|---|
| X-RateLimit-Limit | 每分钟允许的最大请求数 |
| X-RateLimit-Remaining |
当前窗口内剩余请求数 |
| X-RateLimit-Reset | 速率限制窗口重置前的秒数 |
默认限制为每个API密钥每分钟60次请求。超出限制时,API返回HTTP 429:
json
{
success: false,
error: {
code: RATE_LIMITED,
message: 超出速率限制。每分钟最多60次请求。,
details: {
limitperminute: 60,
retryafterseconds: 45
}
}
}
响应中包含 Retry-After 请求头,指示需要等待的秒数。
配额管理
每个API密钥都有可配置的每日和每月调用配额。配额 = 0 表示无限制。
超出配额时,API返回HTTP 429:
json
{
success: false,
error: {
code: QUOTA_EXCEEDED,
message: 每日配额已用完(100/100),
details: {
resolution: 升级您的套餐或等待配额重置。
}
}
}
通过 GET /account/balance 查看当前配额使用情况。
统一响应格式
成功响应
json
{
success: true,
data: { ... },
metadata: {
requestid: reqabc123,
timestamp: 2026-02-18T10:30:00Z,
processingtimems: 1250,
api_version: v1
},
error: null
}
错误响应
错误返回相应的HTTP状态码(401、402、403、404、429、500、503)以及JSON格式的响应体:
json
{
success: false,
data: null,
metadata: { ... },
error: {
code: INVALID_SYMBOL,
message: 股票代码 XXXXX 未找到,
details: {}
}
}
积分不足响应(402)
当积分不足时,API返回详细的402响应,包含可操作的指导:
json
{
success: false,
error: {
code: INSUFFICIENT_POINTS,
message: 积分不足。需要:20,可用:5。,
details: {
required: 20,
available: 5,
shortage: 15,
resolution: {
actions: [
{ action: register, url: https://gprophet.com/register },
{ action: recharge, url: https://gprophet.com/membership },
{ action: subscribe, url: https://gprophet.com/membership }
]
}
}
}
}
积分消耗
| 技能 | 接口 | 积分/次调用 |
|---|
| 股票预测 | POST /predictions/predict | A股10,港股15,美股20,加密货币20 |
| 算法对比 |
POST /predictions/compare | 单次预测成本 × 算法数量 |
| 行情 | GET /market-data/quote | 5 |
| 历史数据 | GET /market-data/history | 5 |
| 搜索 | GET /market-data/search | 5 |
| 批量行情 | POST /market-data/batch-quote | 5 × 股票数量 |
| 技术分析 | POST /technical/analyze | 5 |
| 恐惧与贪婪指数 | GET /sentiment/fear-greed | 5 |
| 市场概览 | GET /sentiment/market-overview | 5 |
| AI股票分析 | POST /analysis/stock | 58 |
| 深度分析 | POST /analysis/comprehensive | 150 |
| 任务轮询 | GET /analysis/task/{task_id} | 0(免费) |
| 账户余额 | GET /account/balance | 0(免费) |
| 使用统计 | GET /account/usage | 0(免费) |
| API信息 | GET /info | 0(免费) |
技能1:股票价格预测
使用AI算法预测未来股票/加密货币价格走势。支持G-Prophet2026V1、LSTM、Transformer等算法。
POST /predictions/predict
请求体(JSON):
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|
| symbol | string | ✅ | - | 股票/加密货币代码(例如 AAPL、600519、BTCUSDT) |
| market |
string | ✅ | - | 市场代码:US、CN、HK、CRYPTO |
| days | integer | 否 | 7 | 预测天数,范围1-30 |
| algorithm | string | 否 | auto | 算法:auto、gprophet2026v1、lstm、transformer、random_forest、ensemble |
示例请求:
bash
curl -X POST https://www.gprophet.com/api/external/v1/predictions/predict \
-H X-API-Key: gpsk[已编辑]_你的密钥 \
-H Content-Type: application/json \
-d {symbol: AAPL, market: US, days: 7, algorithm: auto}
示例响应:
json
{
success: true,
data: {
symbol: AAPL,
name: 苹果公司,
market: US,
current_price: 185.50,
predicted_price: 191.20,
change_percent: 3.07,
direction: up,
confidence: 0.78,
prediction_days: 7,
algorithm_used: gprophet2026v1,
data_quality: {
completeness: 1.0,
anomaly_count: 82,
missing_values: 0,
overall_score: 80
},
points_consumed: 20
}
}
POST /predictions/compare
多算法对比预测。返回每种算法的结果和最佳推荐。积分消耗 = 单次预测成本 × 算法数量。
请求体(JSON):
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|
| symbol | string | ✅ | - | 股票/加密货币代码 |
| market |
string | ✅ | - | 市场代码:US、CN、HK、CRYPTO |
| days | integer | 否 | 5 | 预测天数,范围1-30 |
| algorithms | string[] | 否 | [gprophet2026v1,lstm,transformer,ensemble] | 算法列表,最多6个 |
示例请求:
bash