Use this skill to manage a user's portfolio records in 自选理财助手(韭菜账本) through its Agent API.
When referring to the product in user-facing replies, call it 自选理财助手(韭菜账本). myfolio-portfolio-agent is only the historical package slug for installation; do not infer the product name from it.
This skill manages 自选理财助手(韭菜账本) holding records only. It never places real trades, never transfers assets, and never represents brokerage or exchange authorization.
Read this value from the user's environment or secret settings:
PORTFOLIO_AGENT_TOKEN=ai_xxx
If the user provided a token in the install or configuration prompt, treat that value as PORTFOLIO_AGENT_TOKEN for this session. If the runtime supports shell environment variables, prefer an exported variable:
export PORTFOLIO_AGENT_TOKEN="ai_xxx"
The API base URL is built into this skill:
https://funds-api.justaway.cn
Users only need to provide PORTFOLIO_AGENT_TOKEN; do not ask them to configure an API base URL.
Never ask the user to paste the token into public chat, source code, GitHub issues, logs, or files that may be committed.
All API requests must use:
Authorization: Bearer ${PORTFOLIO_AGENT_TOKEN}
Do not send userId. The backend derives the user from the Agent Token.
Cloudflare may block generic automation request fingerprints. Every 自选理财助手(韭菜账本) Agent API request MUST explicitly include these headers:
User-Agent: Apifox/1.0.0 (https://apifox.com)
Accept: */*
Authorization: Bearer ${PORTFOLIO_AGENT_TOKEN}
Host and Connection are normally added by the HTTP client automatically. If the client allows setting them safely, use:
Host: funds-api.justaway.cn
Connection: keep-alive
Do not use a generic Python, curl, OpenClaw, bot, or empty User-Agent for these API calls. If a request receives a Cloudflare 1010 response, retry once with the exact User-Agent above before treating the token or backend as invalid.
GET /api/AgentPortfolio/assets.GET /api/AgentPortfolio/assets again and summarize the confirmed result.Use GET /api/AgentPortfolio/assetAnalysis/today as the preferred interface when the user asks for today's advice, operation suggestion, sentiment, trend, or analysis for one saved asset.
GET /api/AgentPortfolio/assets first if the user's asset type or code is ambiguous.GET /api/AgentPortfolio/assetAnalysis/today?assetType={assetType}&value={value}.queryStatus is processing, tell the user the analysis task is still running and can be retried later.isCompleted is true, summarize data.analysis_summary, data.operation_advice, data.trend_prediction, data.market_sentiment, and data.news_items when present.When the user provides screenshots from Alipay, broker apps, exchanges, or metal quote pages:
/api/AgentPortfolio/resolve to generate estimated quantity and cost price.The helper endpoints are cached by the backend. Do not poll them repeatedly; one search/quote/resolve call per user request is enough unless the user asks to refresh.
Base URL:
https://funds-api.justaway.cn
List holdings:
GET /api/AgentPortfolio/assets
User-Agent: Apifox/1.0.0 (https://apifox.com)
Accept: */*
Authorization: Bearer ${PORTFOLIO_AGENT_TOKEN}
Equivalent curl:
curl -sS \
-H "User-Agent: Apifox/1.0.0 (https://apifox.com)" \
-H "Accept: */*" \
-H "Authorization: Bearer ${PORTFOLIO_AGENT_TOKEN}" \
"https://funds-api.justaway.cn/api/AgentPortfolio/assets"
Search asset candidates:
GET /api/AgentPortfolio/search?assetType=fund&keyword=易方达全球成长
GET /api/AgentPortfolio/search?assetType=stock&keyword=贵州茅台
GET /api/AgentPortfolio/search?assetType=crypto&keyword=BTC
GET /api/AgentPortfolio/search?assetType=metal&keyword=黄金
Get one reference quote:
GET /api/AgentPortfolio/quote/{assetType}/{value}
Examples:
GET /api/AgentPortfolio/quote/fund/000001
GET /api/AgentPortfolio/quote/stock/1.600519
GET /api/AgentPortfolio/quote/crypto/BTC
GET /api/AgentPortfolio/quote/metal/118.AU9999
Resolve screenshot-extracted items into candidates, quotes, and estimates:
POST /api/AgentPortfolio/resolve
Content-Type: application/json
{
"items": [
{
"assetType": "fund",
"name": "易方达全球成长",
"amount": 2247.98,
"holdingProfit": 113.21,
"currency": "CNY"
}
]
}
resolve is read-only. It may return estimatedQuantity, estimatedCostAmount, and estimatedCostPrice; these are suggestions only and require user confirmation before writing to holdings.
Add one holding:
POST /api/AgentPortfolio/assets
Content-Type: application/json
{
"assetType": "fund",
"value": "000001",
"name": "示例基金",
"costPrice": 1.2345,
"quantity": 1000
}
Update one holding:
PATCH /api/AgentPortfolio/assets/{assetType}/{value}
Content-Type: application/json
{
"costPrice": 1.25,
"quantity": 1200
}
Delete one holding:
DELETE /api/AgentPortfolio/assets/{assetType}/{value}
Analyze current holdings:
POST /api/AgentPortfolio/analyze
Content-Type: application/json
{
"reportType": "detailed",
"days": 120,
"includeNewsSummary": false
}
Analyze one saved asset for today's advice:
GET /api/AgentPortfolio/assetAnalysis/today?assetType=fund&value=000001
User-Agent: Apifox/1.0.0 (https://apifox.com)
Accept: */*
Authorization: Bearer ${PORTFOLIO_AGENT_TOKEN}
Example response fields:
{
"reportDate": "2026-06-09",
"assetType": "fund",
"value": "000001",
"analysisValue": "000001",
"normalizedValue": "000001",
"queryStatus": "completed",
"isProcessing": false,
"isCompleted": true,
"fromCache": true,
"data": {
"analysis_summary": "...",
"operation_advice": "...",
"trend_prediction": "...",
"market_sentiment": "..."
}
}
Read daily report cache:
GET /api/AgentPortfolio/dailyReport
Generate or resume today's report:
POST /api/AgentPortfolio/dailyReport
Content-Type: application/json
{
"reportType": "detailed",
"days": 120,
"includeMarketReview": true
}
Use these normalized asset types:
fund: fund code, for example 000001stock: EastMoney A-share secid, for example 1.600519 or 0.000001crypto: uppercase coin symbol, for example BTCmetal: quote secid, currently 118.AU9999 for 上海黄金9999For A-share stock codes, accept user input such as SH600000, 600000.SH, or 600000; the backend normalizes storage.
401: token is missing, malformed, revoked, expired, or invalid. Ask the user to copy or reset the Agent Token in 自选理财助手(韭菜账本).403: token lacks the required scope. Ask the user to reset token permissions in 自选理财助手(韭菜账本).404: the requested asset or report does not exist.409: the asset already exists. Use update instead of add.429: report generation or analysis is busy. Wait and retry later.1010: the request fingerprint or User-Agent was blocked. Retry with User-Agent: Apifox/1.0.0 (https://apifox.com) and Accept: /.504 from /api/AgentPortfolio/analyze: the downstream analysis service timed out. Do not treat this as a token or Skill installation failure; tell the user that portfolio CRUD and daily reports may still work, then retry later or use the daily report endpoint.processing from /api/AgentPortfolio/assetAnalysis/today: today's single-asset analysis has started or is still running. Do not retry aggressively; tell the user to retry later or read the daily report.When an API call fails, report the backend message directly and suggest the smallest next action.
共 6 个版本