Back to Blog

data-analysis

Cashflow Stock Code Skill: Query Financial Data with Agent Precision

Use the cashflow-stock-code skill to let agents fetch supported stock codes for cashflow analysis via FTShare API.

OpenAgentSkillPublished:

Where this fits

You are building a financial analysis agent that needs to pull cashflow statements for a list of stocks. Before you can query the cashflow data itself, you must know which stock codes are supported by the FTShare API. Manually checking a documentation page or hardcoding a list is brittle—your agent should discover this dynamically. The cashflow-stock-code skill wraps the GET /api/v2/market/data/finance/cashflow-stock-code endpoint, letting your agent fetch the supported universe on demand, with proper API key handling built in.

Why agents benefit

  • Dynamic discovery: Agents can call this skill to retrieve the exact list of supported stock codes at runtime, eliminating hardcoded assumptions that break when the API expands.
  • Credential safety: The skill reads FTSHARE_API_KEY from the environment and refuses to make requests without it, preventing accidental credential leakage in agent logs or tool calls.
  • Parameterized queries: Supports --stock_code and --stock_name flags, so agents can filter results (e.g., by ticker or name) without parsing raw JSON responses themselves.
  • Standardized output: Returns structured data consistent with the FTShare API spec, making it easy to chain with other financial data skills for downstream analysis.
  • Minimal integration overhead: One command install, and the skill handles request headers and content type automatically—agents focus on logic, not HTTP plumbing.

Practical scenarios

Validating a stock list before batch cashflow analysis

An agent tasked with analyzing cashflow trends for a portfolio of 50 tickers first calls this skill to verify each code is supported. It filters out unsupported codes and proceeds only with valid ones, avoiding wasted API calls and partial failures.

Building a stock universe for screening

A screening agent needs to know which stocks have cashflow data available. It invokes this skill to fetch the full supported list, then cross-references it with other criteria (e.g., sector or market cap) to narrow down candidates for deeper analysis.

Debugging data gaps in an existing pipeline

When a downstream cashflow report is missing entries, an agent can call this skill to check whether a particular stock code is actually supported. This quickly distinguishes "no data" from "unsupported code," saving developer time on manual API checks.

Add it to your agent workflow

Install the skill directly from the FTShare repository:

npx skills add FTShare-Lab/FTShare-skill --skill cashflow-stock-code

Then invoke it in your agent script (assuming FTSHARE_API_KEY is set in the environment):

python <RUN_PY> cashflow-stock-code --stock_code 600519 --stock_name 1

This returns the cashflow-supported stock code information for the given ticker. For full parameter details, refer to the API doc in ftshare-doc/api-doc/股票数据/财务数据/现金流支持股票代码.md.

Compare before adopting

Before integrating this skill, evaluate it against alternatives. Check the GitHub repository for recent commits and issue resolution—does the maintainer keep the API spec current? Compare with other financial data skills (e.g., balance-sheet or income-statement endpoints) to see if the same universe is covered. Also consider whether your agent truly needs dynamic discovery or if a static list suffices for your use case. Finally, verify that the skill's output format matches your downstream parsing logic to avoid extra transformation steps.

Why it is worth tracking

With 63 stars and an active author (FTShare-Lab), this skill shows early community adoption. The clean separation of credential handling and the narrow, focused scope make it a solid building block for financial agents. Track it if you are expanding your agent's coverage of Chinese A-share cashflow data—its simplicity and clear API contract reduce integration risk. You can also find it on the OpenAgentSkill directory for community feedback and version history.

Featured Skill

cashflow-stock-code

Skill by FTShare-Lab