Skip to main content

Overview

The yf_field_definitions tool provides a complete reference of all available field definitions in yfinance, including which modules (data endpoints) support each field. This is essential for discovering what data is available and building valid queries.

Use Cases

  • Discover available fields: Browse all fields you can request from yfinance
  • Validate field names: Check exact field names before building queries
  • Module compatibility: See which data modules support specific fields
  • Query building: Find the right field names for screener queries and data requests

Parameters

This tool accepts only output formatting parameters:
response_format
string
default:"json"
Output format: "json" or "markdown"
preview_limit
number
default:"25"
Number of rows to preview in markdown format (1-200)
save
object
Save results to a file

Response

Returns a comprehensive list of field definitions with:
  • Field name: The exact field identifier
  • Description: What the field represents
  • Valid modules: Which yfinance data endpoints support this field
  • Data type: Expected data type for the field

Example Usage

Get All Field Definitions

{
  "response_format": "json"
}

Save Field Reference

{
  "response_format": "json",
  "save": {
    "format": "csv",
    "filename": "yfinance-fields.csv"
  }
}

Preview in Markdown

{
  "response_format": "markdown",
  "preview_limit": 50
}

Response Example

{
  "data": [
    {
      "field": "marketCap",
      "description": "Market capitalization",
      "modules": ["price", "summaryDetail"],
      "type": "number"
    },
    {
      "field": "trailingPE",
      "description": "Trailing price-to-earnings ratio",
      "modules": ["summaryDetail"],
      "type": "number"
    },
    {
      "field": "dividendYield",
      "description": "Dividend yield",
      "modules": ["summaryDetail"],
      "type": "number"
    }
  ],
  "saved_path": null
}
  • Field Categories - Organize fields by category groups
  • Screener - Build custom screening queries using field definitions

Tips

Use this tool when you’re unsure about available field names or which modules support specific data points. It’s especially helpful before building custom screener queries.
Field availability may vary by ticker type (stock, ETF, mutual fund, etc.). Not all fields are available for all securities.

Build docs developers (and LLMs) love