New to Claude Skills? Learn how to install them →

daymade on GitHub

Financial Data Collector

Free

Collect and validate financial data for US companies.

Get this skill

Free · Opens the source repo

What Financial Data Collector does

The Financial Data Collector skill is designed for developers and analysts who need to gather accurate financial data for US publicly traded companies. Utilizing the yfinance library, this tool collects a variety of financial metrics, including market data, historical financials, and analyst estimates, and outputs the information in a structured JSON format. This makes it easy to integrate with downstream financial analysis tools such as DCF modeling and earnings reviews.

The workflow consists of two main steps: data collection and validation. The collection process prioritizes data from yfinance, ensuring that users receive the most relevant and up-to-date information. If any data points are missing, the skill will set them to null, indicating that the data could not be retrieved, rather than substituting default values. This ensures that downstream applications can handle missing data appropriately without introducing inaccuracies.

Validation is a critical part of the process, with a dedicated script that checks for completeness, consistency, and adherence to specific sign conventions. For example, capital expenditures (CapEx) are preserved as negative values to reflect cash outflows accurately. Additionally, the skill flags important distinctions, such as the difference between yfinance free cash flow calculations and those used by investment banks, ensuring that users are aware of potential discrepancies in their financial models.

Overall, this skill is ideal for financial analysts, data scientists, and developers who require reliable and structured financial data for analysis and modeling. Its focus on accuracy and clear output makes it a valuable addition to any financial data workflow.

When to use it

Use this skill when you need structured financial data for US companies, especially for analysis tasks like DCF modeling or earnings reviews.

When not to use it

Avoid this skill if you require financial data for non-US companies or if you need additional features like visualizations or reporting.

What you can build with it

Gathering Financials for Analysis

Use this skill to collect essential financial metrics for a company before performing a detailed financial analysis.

Validating Financial Data Accuracy

Run the validation script to ensure that the collected financial data meets specified standards and conventions.

Integrating with Financial Models

Output structured JSON data that can be easily consumed by downstream financial modeling tools and applications.

How to install Financial Data Collector

View source

1. Install with the skills CLI

npx skills add daymade/claude-code-skills/financial-data-collector --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by daymade

Financial Data Collector

Collect and validate real financial data for US public companies using free data sources. Output is a standardized JSON file ready for consumption by other financial skills.

Critical Constraints

NO FALLBACK values. If a field cannot be retrieved, set it to null with _source: "missing". Never substitute defaults (e.g., beta or 1.0). The downstream skill decides how to handle missing data.

Data source attribution is mandatory. Every data section must have a _source field.

CapEx sign convention: yfinance returns CapEx as negative (cash outflow). Preserve the original sign. Document the convention in output metadata. Do NOT flip signs.

yfinance FCF ≠ Investment bank FCF. yfinance FCF = Operating CF + CapEx (no SBC deduction). Flag this in output metadata so downstream DCF skills don't overstate FCF.

Workflow

Step 1: Collect Data

Run the collection script:

python scripts/collect_data.py TICKER [--years 5] [--output path/to/output.json]

The script collects in this priority:

  1. yfinance — market data, historical financials, beta, analyst estimates
  2. yfinance ^TNX — 10Y Treasury yield as risk-free rate proxy
  3. User supplement — for years where yfinance returns NaN (report to user, do not guess)

Step 2: Validate Data

python scripts/validate_data.py path/to/output.json

Checks: field completeness, cross-field consistency (Market Cap = Price × Shares), range sanity (WACC 5-20%, beta 0.3-3.0), sign conventions.

Step 3: Deliver JSON

Single file: {TICKER}_financial_data.json. Schema in references/output-schema.md.

Do NOT create: README, CSV, summary reports, or any auxiliary files.

Output Schema (Summary)

{
  "ticker": "META",
  "company_name": "Meta Platforms, Inc.",
  "data_date": "2026-03-02",
  "currency": "USD",
  "unit": "millions_usd",
  "data_sources": { "market_data": "...", "2022_to_2024": "..." },
  "market_data": { "current_price": 648.18, "shares_outstanding_millions": 2187, "market_cap_millions": 1639607, "beta_5y_monthly": 1.284 },
  "income_statement": { "2024": { "revenue": 164501, "ebit": 69380, "tax_expense": ..., "net_income": ..., "_source": "yfinance" } },
  "cash_flow": { "2024": { "operating_cash_flow": ..., "capex": -37256, "depreciation_amortization": 15498, "free_cash_flow": ..., "change_in_nwc": ..., "_source": "yfinance" } },
  "balance_sheet": { "2024": { "total_debt": 30768, "cash_and_equivalents": 77815, "net_debt": -47047, "current_assets": ..., "current_liabilities": ..., "_source": "yfinance" } },
  "wacc_inputs": { "risk_free_rate": 0.0396, "beta": 1.284, "credit_rating": null, "_source": "yfinance + ^TNX" },
  "analyst_estimates": { "revenue_next_fy": 251113, "revenue_fy_after": 295558, "eps_next_fy": 29.59, "_source": "yfinance" },
  "metadata": { "_capex_convention": "negative = cash outflow", "_fcf_note": "yfinance FCF = OperatingCF + CapEx. Does NOT deduct SBC." }
}

Full schema with all field definitions: references/output-schema.md

<correct_patterns>

Handling Missing Years

if pd.isna(revenue):
    result[year] = {"revenue": None, "_source": "yfinance returned NaN — supplement from 10-K"}
# Report missing years to the user. Do NOT skip or fill with estimates.

CapEx Sign Preservation

capex = cash_flow.loc["Capital Expenditure", year_col]  # -37256.0
result["capex"] = float(capex)  # Preserve negative

Datetime Column Indexing

year_col = [c for c in financials.columns if c.year == target_year][0]
revenue = financials.loc["Total Revenue", year_col]

Field Name Guards

if "Total Revenue" in financials.index:
    revenue = financials.loc["Total Revenue", year_col]
elif "Revenue" in financials.index:
    revenue = financials.loc["Revenue", year_col]
else:
    revenue = None

</correct_patterns>

<common_mistakes>

Mistake 1: Default Values for Missing Data

# ❌ WRONG
beta = info.get("beta", 1.0)
growth = data.get("growth") or 0.02

# ✅ RIGHT
beta = info.get("beta")  # May be None — that's OK

Mistake 2: Assuming All Years Have Data

# ❌ WRONG — 2020-2021 may be NaN
revenue = float(financials.loc["Total Revenue", year_col])

# ✅ RIGHT
value = financials.loc["Total Revenue", year_col]
revenue = float(value) if pd.notna(value) else None

Mistake 3: Using yfinance FCF in DCF Models Directly

yfinance FCF does NOT deduct SBC. For mega-caps like META, SBC can be $20-30B/yr, making yfinance FCF ~30% higher than investment-bank FCF. Always flag this in output.

Mistake 4: Flipping CapEx Sign

# ❌ WRONG — double-negation risk downstream
capex = abs(cash_flow.loc["Capital Expenditure", year_col])

# ✅ RIGHT — preserve original, document convention
capex = float(cash_flow.loc["Capital Expenditure", year_col])  # -37256.0

</common_mistakes>

Known yfinance Pitfalls

See references/yfinance-pitfalls.md for detailed field mapping and workarounds.

Frequently asked questions about Financial Data Collector

Similar skills