mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2026-01-14 08:44:46 +01:00
feat: Add financial analysis endpoints (Fundamentals, Funds)
Add OpenAPI specifications for fundamental data: - Company fundamentals with financial statements and metrics - Mutual fund and ETF fees, holdings, and analytics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
255
openapi/schemas/fundamentals-schemas.yaml
Normal file
255
openapi/schemas/fundamentals-schemas.yaml
Normal file
@@ -0,0 +1,255 @@
|
||||
# Tiingo Fundamentals API Schemas
|
||||
# Reference these using: $ref: '../schemas/fundamentals-schemas.yaml#/SchemaName'
|
||||
|
||||
FundamentalDefinition: &FundamentalDefinition
|
||||
type: object
|
||||
description: Definition of a fundamental metric field
|
||||
properties:
|
||||
dataCode:
|
||||
type: string
|
||||
description: An identifier representing the fundamentals field the value belongs to (e.g., "peRatio")
|
||||
example: "peRatio"
|
||||
name:
|
||||
type: string
|
||||
description: A human-friendly readable name of the field
|
||||
example: "Price/Earnings Ratio"
|
||||
description:
|
||||
type: string
|
||||
description: A description of the field
|
||||
example: "The price to earnings ratio of the company"
|
||||
statementType:
|
||||
type: string
|
||||
description: Which statement this value belongs to
|
||||
enum:
|
||||
- balanceSheet
|
||||
- incomeStatement
|
||||
- cashFlow
|
||||
- overview
|
||||
example: "overview"
|
||||
units:
|
||||
type: string
|
||||
description: The unit the field value is in. Value is either "$", "%" or blank. If blank, value may either be an integer (like shares outstanding) or a ratio
|
||||
enum:
|
||||
- "$"
|
||||
- "%"
|
||||
- ""
|
||||
example: ""
|
||||
required:
|
||||
- dataCode
|
||||
- name
|
||||
- description
|
||||
- statementType
|
||||
- units
|
||||
|
||||
DataPoint: &DataPoint
|
||||
type: object
|
||||
description: A single data point with a code and value
|
||||
properties:
|
||||
dataCode:
|
||||
type: string
|
||||
description: An identifier representing the fundamentals field the value belongs to (e.g., "peRatio")
|
||||
example: "totalAssets"
|
||||
value:
|
||||
type: number
|
||||
format: float
|
||||
description: The value of the field corresponding to the dataCode
|
||||
example: 352755000000
|
||||
required:
|
||||
- dataCode
|
||||
- value
|
||||
|
||||
StatementData: &StatementData
|
||||
type: object
|
||||
description: Statement data broken out by four different statement types
|
||||
properties:
|
||||
balanceSheet:
|
||||
type: array
|
||||
description: Balance sheet data (assets, liabilities, equity)
|
||||
items:
|
||||
$ref: '#/DataPoint'
|
||||
incomeStatement:
|
||||
type: array
|
||||
description: Income statement data (revenue, expenses, income)
|
||||
items:
|
||||
$ref: '#/DataPoint'
|
||||
cashFlow:
|
||||
type: array
|
||||
description: Cash flow statement data (operating, investing, financing activities)
|
||||
items:
|
||||
$ref: '#/DataPoint'
|
||||
overview:
|
||||
type: array
|
||||
description: Metrics and ratios that may be a combination of fields from various statements
|
||||
items:
|
||||
$ref: '#/DataPoint'
|
||||
required:
|
||||
- balanceSheet
|
||||
- incomeStatement
|
||||
- cashFlow
|
||||
- overview
|
||||
|
||||
FinancialStatement: &FinancialStatement
|
||||
type: object
|
||||
description: Historical quarterly or annual financial statement
|
||||
properties:
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: The date the statement data was released to the public
|
||||
example: "2023-12-29T00:00:00.000Z"
|
||||
quarter:
|
||||
type: integer
|
||||
format: int32
|
||||
description: An integer corresponding to the fiscal quarter reported. A value of "0" means this is an Annual Report. A value of "1" through "4" corresponds to the respective fiscal quarter
|
||||
minimum: 0
|
||||
maximum: 4
|
||||
example: 1
|
||||
year:
|
||||
type: integer
|
||||
format: int32
|
||||
description: An integer corresponding to the fiscal year reported
|
||||
example: 2024
|
||||
statementData:
|
||||
$ref: '#/StatementData'
|
||||
required:
|
||||
- date
|
||||
- quarter
|
||||
- year
|
||||
- statementData
|
||||
|
||||
DailyMetric: &DailyMetric
|
||||
type: object
|
||||
description: Daily fundamental metrics that rely on price data and update daily
|
||||
properties:
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: The date the daily data corresponds to
|
||||
example: "2023-12-29T00:00:00.000Z"
|
||||
marketCap:
|
||||
type: number
|
||||
format: float
|
||||
description: The value of the field corresponding to the market capitalization
|
||||
example: 3050000000000
|
||||
nullable: true
|
||||
enterpriseVal:
|
||||
type: number
|
||||
format: float
|
||||
description: The value of the field corresponding to the enterprise value
|
||||
example: 2950000000000
|
||||
nullable: true
|
||||
peRatio:
|
||||
type: number
|
||||
format: float
|
||||
description: The value of the field corresponding to the price/earnings ratio
|
||||
example: 29.45
|
||||
nullable: true
|
||||
pbRatio:
|
||||
type: number
|
||||
format: float
|
||||
description: The value of the field corresponding to the price/book ratio
|
||||
example: 48.32
|
||||
nullable: true
|
||||
trailingPEG1Y:
|
||||
type: number
|
||||
format: float
|
||||
description: The value of the field corresponding to the trailing 1 year PEG Ratio
|
||||
example: 2.15
|
||||
nullable: true
|
||||
required:
|
||||
- date
|
||||
additionalProperties: true
|
||||
x-note: "New daily metrics are continuously added, so fields will change over time. Use the 'columns' parameter to ensure consistent output."
|
||||
|
||||
FundamentalMeta: &FundamentalMeta
|
||||
type: object
|
||||
description: Company metadata and information about when data was last updated
|
||||
properties:
|
||||
permaTicker:
|
||||
type: string
|
||||
description: Permanent Tiingo Ticker mapping to the security. Can be used as a primary key
|
||||
example: "AAPL"
|
||||
ticker:
|
||||
type: string
|
||||
description: Ticker related to the asset
|
||||
example: "AAPL"
|
||||
name:
|
||||
type: string
|
||||
description: Full-length name of the asset
|
||||
example: "Apple Inc."
|
||||
isActive:
|
||||
type: boolean
|
||||
description: Boolean describing whether or not the ticker is still actively traded. If false, this ticker is delisted
|
||||
example: true
|
||||
isADR:
|
||||
type: boolean
|
||||
description: Boolean describing whether or not the ticker is an ADR. Value is true if listed ticker is an ADR
|
||||
example: false
|
||||
sector:
|
||||
type: string
|
||||
description: Sector information that is derived from sicSector and is meant to approximate GICS
|
||||
example: "Technology"
|
||||
nullable: true
|
||||
industry:
|
||||
type: string
|
||||
description: Industry information that is derived from sicIndustry and is meant to approximate GICS
|
||||
example: "Consumer Electronics"
|
||||
nullable: true
|
||||
sicCode:
|
||||
type: integer
|
||||
format: int32
|
||||
description: SIC Code that represents company's business activities
|
||||
example: 3571
|
||||
nullable: true
|
||||
sicSector:
|
||||
type: string
|
||||
description: Sector as determined by the SIC Code
|
||||
example: "Industrial and Commercial Machinery and Computer Equipment"
|
||||
nullable: true
|
||||
sicIndustry:
|
||||
type: string
|
||||
description: Industry as determined by the SIC Code
|
||||
example: "Electronic Computers"
|
||||
nullable: true
|
||||
reportingCurrency:
|
||||
type: string
|
||||
description: The currency the company reports their SEC statement filings in
|
||||
example: "USD"
|
||||
nullable: true
|
||||
location:
|
||||
type: string
|
||||
description: Location/domicile of the company. States are included for U.S. companies, otherwise countries for non-US companies
|
||||
example: "California"
|
||||
nullable: true
|
||||
companyWebsite:
|
||||
type: string
|
||||
format: uri
|
||||
description: The website of the company when available
|
||||
example: "https://www.apple.com"
|
||||
nullable: true
|
||||
secFilingWebsite:
|
||||
type: string
|
||||
format: uri
|
||||
description: A URL to where you can find the company's SEC filings directly on the SEC website
|
||||
example: "https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=0000320193&type=&dateb=&owner=exclude&count=100"
|
||||
nullable: true
|
||||
statementLastUpdated:
|
||||
type: string
|
||||
format: date-time
|
||||
description: The timestamp the statement data/endpoint was last updated for the ticker
|
||||
example: "2024-01-15T10:30:00.000Z"
|
||||
nullable: true
|
||||
dailyLastUpdated:
|
||||
type: string
|
||||
format: date-time
|
||||
description: The timestamp the daily data/endpoint was last updated for the ticker
|
||||
example: "2024-01-15T08:00:00.000Z"
|
||||
nullable: true
|
||||
required:
|
||||
- permaTicker
|
||||
- ticker
|
||||
- name
|
||||
- isActive
|
||||
- isADR
|
||||
additionalProperties: true
|
||||
x-note: "As new meta data about companies and their fundamentals is added, the endpoint output will change. Use the 'columns' parameter to ensure consistent output."
|
||||
235
openapi/schemas/funds-schemas.yaml
Normal file
235
openapi/schemas/funds-schemas.yaml
Normal file
@@ -0,0 +1,235 @@
|
||||
# Tiingo Mutual Fund and ETF Fees API Schemas
|
||||
# Reference: /docs/api_extracted/mutual-fund-etf-fees.md
|
||||
|
||||
OtherShareClass: &OtherShareClass
|
||||
type: object
|
||||
description: Information about a related share class of the fund
|
||||
properties:
|
||||
ticker:
|
||||
type: string
|
||||
description: Ticker related to the fund
|
||||
example: "VTSMX"
|
||||
name:
|
||||
type: string
|
||||
description: Full-length name of the fund
|
||||
example: "Vanguard Total Stock Market Index Fund"
|
||||
shareClass:
|
||||
type: string
|
||||
description: Share class of the fund as described by the parent fund company
|
||||
example: "Investor Shares"
|
||||
netExpense:
|
||||
type: number
|
||||
format: float
|
||||
description: The top-level net expense ratio for the fund (expressed as decimal, e.g., 0.0055 = 0.55%)
|
||||
example: 0.0055
|
||||
required:
|
||||
- ticker
|
||||
- name
|
||||
- shareClass
|
||||
- netExpense
|
||||
|
||||
FundOverview: &FundOverview
|
||||
type: object
|
||||
description: Top-level fund data including description and share classes
|
||||
properties:
|
||||
ticker:
|
||||
type: string
|
||||
description: Ticker related to the fund
|
||||
example: "VTSAX"
|
||||
name:
|
||||
type: string
|
||||
description: Full-length name of the fund
|
||||
example: "Vanguard Total Stock Market Index Fund"
|
||||
description:
|
||||
type: string
|
||||
description: Long-form description of the fund
|
||||
example: "Long description of the fund..."
|
||||
shareClass:
|
||||
type: string
|
||||
description: Share class of the fund as described by the parent fund company
|
||||
example: "Admiral Shares"
|
||||
netExpense:
|
||||
type: number
|
||||
format: float
|
||||
description: The top-level net expense ratio for the fund (expressed as decimal, e.g., 0.0035 = 0.35%)
|
||||
example: 0.0035
|
||||
otherShareClasses:
|
||||
type: array
|
||||
description: An array of objects representing related share classes of the given fund
|
||||
items:
|
||||
$ref: '#/OtherShareClass'
|
||||
required:
|
||||
- ticker
|
||||
- name
|
||||
- description
|
||||
- shareClass
|
||||
- netExpense
|
||||
- otherShareClasses
|
||||
|
||||
CustomFee: &CustomFee
|
||||
type: object
|
||||
description: Custom fee charged by the fund (e.g., check processing fee)
|
||||
properties:
|
||||
label:
|
||||
type: string
|
||||
description: Label related to the custom fee
|
||||
example: "Check Processing Fee"
|
||||
value:
|
||||
type: number
|
||||
format: float
|
||||
description: Value of the custom fee field
|
||||
example: 0.0000
|
||||
units:
|
||||
type: string
|
||||
description: '"$" if the value is in dollars or "%" if the value is in percentage terms'
|
||||
enum:
|
||||
- "$"
|
||||
- "%"
|
||||
example: "$"
|
||||
parentFee:
|
||||
type: string
|
||||
description: The parent fee the custom fee belongs under
|
||||
example: "shareholderFee"
|
||||
required:
|
||||
- label
|
||||
- value
|
||||
- units
|
||||
- parentFee
|
||||
|
||||
FundMetrics: &FundMetrics
|
||||
type: object
|
||||
description: Detailed current and historical fee data for a mutual fund or ETF
|
||||
properties:
|
||||
prospectusDate:
|
||||
allOf:
|
||||
- $ref: './common.yaml#/Date'
|
||||
description: The prospectus date when the corresponding fund expense data was published
|
||||
example: "2024-01-15"
|
||||
netExpense:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's net expense ratio, or the net expenses related to the fund (expressed as decimal)
|
||||
example: 0.0035
|
||||
grossExpense:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's gross expense ratio, or the expenses related to running the fund (expressed as decimal)
|
||||
example: 0.0040
|
||||
managementFee:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's management fee, or the fees paid to the manager and/or advisors (expressed as decimal)
|
||||
example: 0.0025
|
||||
12b1:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's fee related to marketing expenses (expressed as decimal)
|
||||
example: 0.0000
|
||||
non12b1:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's fee related to distribution and similar non-12b-1 fees (expressed as decimal)
|
||||
example: 0.0000
|
||||
otherExpenses:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's other expenses, or expenses related to legal, administrative, custodial, etc. (expressed as decimal)
|
||||
example: 0.0015
|
||||
acquiredFundFees:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's acquired fund fees, or expenses related to underlying businesses or funds (expressed as decimal)
|
||||
example: 0.0000
|
||||
feeWaiver:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's fee waiver, or discount on fees (expressed as decimal)
|
||||
example: 0.0005
|
||||
exchangeFeeUSD:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's exchange fee if charged in USD, or expenses related to exchanging or transferring funds to another fund in the fund's family
|
||||
example: 0.0000
|
||||
exchangeFeePercent:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's exchange fee if charged as a percentage, or expenses related to exchanging or transferring funds to another fund in the fund's family (expressed as decimal)
|
||||
example: 0.0000
|
||||
frontLoad:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's front load fee, or the upfront fee charged when investing in the fund (expressed as decimal)
|
||||
example: 0.0000
|
||||
backLoad:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's back load fee, or the back-end fee charged when redeeming from the fund (expressed as decimal)
|
||||
example: 0.0000
|
||||
dividendLoad:
|
||||
type: number
|
||||
format: float
|
||||
description: Dividend load fee, or charges on reinvested dividends (expressed as decimal)
|
||||
example: 0.0000
|
||||
shareholderFee:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's shareholder fees, or the potential fees when buying/selling a fund (expressed as decimal)
|
||||
example: 0.0000
|
||||
accountFeeUSD:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's account fees if charged in USD, or the fee required to maintain your account in USD
|
||||
example: 0.0000
|
||||
accountFeePercent:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's account fees if charged as a percentage, or the fee required to maintain your account in percentage terms (expressed as decimal)
|
||||
example: 0.0000
|
||||
redemptionFeeUSD:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's redemption fees if charged in USD, or the fee charged if funds are redeemed early (as defined by the fund company)
|
||||
example: 0.0000
|
||||
redemptionFeePercent:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's redemption fees as a percentage, or the fee charged if funds are redeemed early (as defined by the fund company) (expressed as decimal)
|
||||
example: 0.0000
|
||||
portfolioTurnover:
|
||||
type: number
|
||||
format: float
|
||||
description: Portfolio turnover (expressed as decimal)
|
||||
example: 0.05
|
||||
miscFees:
|
||||
type: number
|
||||
format: float
|
||||
description: Fund's miscellaneous fees (expressed as decimal)
|
||||
example: 0.0000
|
||||
customFees:
|
||||
type: array
|
||||
description: Fund's custom fees. Array of custom fee objects
|
||||
items:
|
||||
$ref: '#/CustomFee'
|
||||
required:
|
||||
- prospectusDate
|
||||
- netExpense
|
||||
- grossExpense
|
||||
- managementFee
|
||||
- 12b1
|
||||
- non12b1
|
||||
- otherExpenses
|
||||
- acquiredFundFees
|
||||
- feeWaiver
|
||||
- exchangeFeeUSD
|
||||
- exchangeFeePercent
|
||||
- frontLoad
|
||||
- backLoad
|
||||
- dividendLoad
|
||||
- shareholderFee
|
||||
- accountFeeUSD
|
||||
- accountFeePercent
|
||||
- redemptionFeeUSD
|
||||
- redemptionFeePercent
|
||||
- portfolioTurnover
|
||||
- miscFees
|
||||
- customFees
|
||||
Reference in New Issue
Block a user