Skip to main content
This guide takes you from zero to your first David response. You’ll authenticate, find a scenario, and query prices, fundamentals, and news for a ticker inside that scenario.

Prerequisites

  • An API key. Get one from the dashboard, and pass it in the X-API-KEY header on every request.
  • The base URL for all requests is https://api.davidhf.com.
Every data endpoint requires a scenario_id. A scenario is a self-contained synthetic market world. See Scenarios for the full model.

Get started

1

Authenticate

Send your key in the X-API-KEY header. A quick health check confirms the connection:
curl -s https://api.davidhf.com/health \
  -H "X-API-KEY: YOUR_API_KEY"
{ "status": "ok", "environment": "production" }
2

Find a scenario

David ships with a library of ready-made scenarios. List them to grab a scenario_id:
curl -s "https://api.davidhf.com/scenarios?limit=3" \
  -H "X-API-KEY: YOUR_API_KEY"
{
  "scenarios": [
    {
      "id": "6724c7d1-1b34-5da4-bc69-5ab0ef99c3c0",
      "status": "ready",
      "name": "War-driven energy shock: shipping-lane escalation ...",
      "start_date": "1993-05-28",
      "end_date": "2023-05-08",
      "public_summary": { "scenario_theme": "geopolitical_war_energy_shock", "...": "..." }
    }
  ]
}
Copy an id. You’ll use it as scenario_id in every query below.
3

See what's inside

Inspect a scenario’s manifest to see its date range and available tickers:
curl -s "https://api.davidhf.com/scenarios/6724c7d1-1b34-5da4-bc69-5ab0ef99c3c0" \
  -H "X-API-KEY: YOUR_API_KEY"
The response includes available_tickers (e.g. AAPL, MSFT, NVDA) and a public_summary describing the market world.
4

Pull prices

Query daily OHLCV for a ticker in that scenario:
curl -s "https://api.davidhf.com/prices?scenario_id=6724c7d1-1b34-5da4-bc69-5ab0ef99c3c0&ticker=AAPL&interval=day&limit=5" \
  -H "X-API-KEY: YOUR_API_KEY"
{
  "ticker": "AAPL",
  "prices": [
    { "ticker": "AAPL", "open": 182.4, "high": 184.1, "low": 181.2, "close": 183.6, "volume": 51200000, "time": "2026-01-02" }
  ]
}
5

Pull fundamentals and news

Same scenario_id, different endpoint:
# Quarterly income statements
curl -s "https://api.davidhf.com/financials/income-statements?scenario_id=6724c7d1-1b34-5da4-bc69-5ab0ef99c3c0&ticker=AAPL&period=quarterly&limit=4" \
  -H "X-API-KEY: YOUR_API_KEY"

# Latest news visible as of a date
curl -s "https://api.davidhf.com/news?scenario_id=6724c7d1-1b34-5da4-bc69-5ab0ef99c3c0&ticker=AAPL&as_of=2026-03-20" \
  -H "X-API-KEY: YOUR_API_KEY"

Browse more scenarios

David curates the full scenario library, you don’t generate worlds, you choose from them. Filter the library to assemble the sets you need:
# Future-branch scenarios that passed validation
curl -s "https://api.davidhf.com/scenarios?path_mode=future_branch&healthy_only=true&limit=10" \
  -H "X-API-KEY: YOUR_API_KEY"
Need a world with characteristics the library doesn’t cover? Reach out at investors@davidhf.com and we’ll generate it.

Next steps

Scenarios

How worlds are scoped, validated, and replayed.

Authentication

Keys, accounts, plans, and rate limits.

Point-in-time agents

Build a leakage-free backtest loop.

API reference

Every endpoint in detail.
Need help? Reach out at investors@davidhf.com.