Build It WithMetricDuck APIPythonDeveloper Tutorials

Build It With MetricDuck: Developer Tutorials for Financial Data APIs

Developer tutorials that ship working code. Each lab walks you through building a real financial tool with the MetricDuck API — from stock comparison tools to valuation alerts. Clone the repo, run the code, extend it for your own projects.

min read
Updated Feb 12, 2026

Build It With MetricDuck

Developer tutorials for financial data APIs

Each tutorial walks you through building a real financial tool with the MetricDuck API. Clone the repo, run the code, extend it for your own projects.

No API key required to start. Guest access gives you all 70 metrics and 12 dimensions. Register free for 500 credits/day to build more.


The Labs

All labs live in our public GitHub repo: github.com/metric-duck/build-with-metricduck

Lab 02: Stock Showdown

Compare any two stocks across Valuation and Quality panels using 7 metrics — 5 of which are MetricDuck exclusives not available in yfinance.

What you'll build:

  • Fetch 7 metrics for 2 tickers in a single API call
  • Panel 1 (Valuation): PE, EV/EBITDA, EV/EBIT*, FCF Yield*
  • Panel 2 (Quality): ROIC*, FCF Margin*, Total Shareholder Yield*
  • Multi-dimensional verdict: valuation winner + quality winner + ROIC highlight
  • Optional yfinance integration for sector, beta, 52-week range

Read the tutorial →

git clone https://github.com/metric-duck/build-with-metricduck.git
cd build-with-metricduck/labs/02-stock-showdown
pip install -r requirements.txt
python showdown.py NVDA AMD

Lab 03: Stock Pulse (Value Trap Detector)

Check any stock against its own 2-year history using Q.MED8 (median) and Q.TREND8 (trend) dimensions. The tool diagnoses whether a stock is an OPPORTUNITY, EARNING IT, WATCH, VALUE TRAP, or STABLE.

What you'll build:

  • Fetch 8 metrics with 4 statistical dimensions for any ticker in a single API call
  • Vital Signs: ROIC, Gross Margin, Operating Margin, FCF Margin vs 2-year median
  • Valuation: PE Ratio and EV/EBITDA trend direction
  • 5-word diagnosis: OPPORTUNITY / EARNING IT / WATCH / VALUE TRAP / STABLE
  • Optional --json output for chaining with other tools

Read the tutorial →

git clone https://github.com/metric-duck/build-with-metricduck.git
cd build-with-metricduck/labs/03-stock-pulse
pip install -r requirements.txt
python pulse.py NVDA

Lab 04: Stock Screener

Screen 50+ stocks by Quality (ROIC, FCF Margin) and Value (PE, FCF Yield, EV/EBITDA). Percentile-ranked composite score finds stocks that are strong businesses and reasonably priced.

What you'll build:

  • Fetch the top 50 companies by market cap from the universe endpoint
  • Score each on 5 metrics using percentile normalization
  • Composite score: Quality (60%) + Value (40%), fully configurable
  • Signal labels: QUALITY / VALUE / BALANCED
  • Optional --json output, custom --tickers list, --top N

Read the tutorial →

git clone https://github.com/metric-duck/build-with-metricduck.git
cd build-with-metricduck/labs/04-stock-screener
pip install -r requirements.txt
python screener.py

What You Can Build

The MetricDuck API provides 70+ curated metrics with 7 years of history. Some ideas:

ProjectMetrics You'd UseComplexity
Stock screenerpe_ratio, roic, fcf_yieldBeginner
Valuation alertsAny metric + threshold logicBeginner
Sector dashboardMultiple tickers + chartingIntermediate
Portfolio analyzerWeighted metrics across holdingsIntermediate
Earnings quality scannerfcf_margin, sbc_ratio, cash_conversionAdvanced
Historical backtestingQuarterly data + years=7Advanced

API Quick Reference

Base URL: https://api.metricduck.com/api/v1

Main endpoint: GET /data/metrics

import httpx

response = httpx.get(
    "https://api.metricduck.com/api/v1/data/metrics",
    params={
        "tickers": "AAPL,MSFT",
        "metrics": "pe_ratio,roic,fcf_yield",
        "period": "ttm",
        "price": "current",
    },
)
data = response.json()

Use price=current for real-time valuations at today's market price. Add dimensions=Q.MED8,Q.TREND8 for historical context (see Lab 03).

Key dimensions:

  • Q.MED8 — 8-quarter median (2-year historical norm)
  • Q.TREND8 — 8-quarter trend (improving or deteriorating)
  • TTM.YOY — Year-over-year change
  • TTM.CAGR3 — 3-year compound annual growth rate

Full docs: /docs/api-reference/overview


Access Tiers

TierDaily LimitMax TickersCost
Guest (no key)5 requests/day10 tickersFree
Free (registered)500 credits/day200 tickersFree
Builder200,000 credits/mo200 tickers$29/mo
Production1,000,000 credits/mo200 tickers$79/mo

Guest access works immediately — no signup required. Register free for 500 credits/day — enough for 2 stock screens, 14 pulse checks, or 35 showdowns every day.

Register free → | Builder tier →


Coming Soon

More labs are in development:

  • Lab 10: Valuation Alerts — Get notified when a stock's PE drops below your threshold
  • Lab 50: Enterprise Data Pipeline — Bulk data ingestion for production systems

Star the repo to get notified: github.com/metric-duck/build-with-metricduck

In This Series (3 articles)

MetricDuck Team

Building financial intelligence you can trust. Sourced directly from SEC Edgar.