feat: Add corporate action endpoints (Dividends, Splits)

Add OpenAPI specifications for corporate events:
- Dividend distributions and payment dates
- Stock splits and reverse splits

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Cameron Yick
2025-12-13 23:41:22 -05:00
parent 02b5f88f93
commit 7fe205f7fe
4 changed files with 519 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
# Dividend and Distribution Schemas for Tiingo Corporate Actions API
# Reference these using: $ref: '../schemas/dividends-schemas.yaml#/SchemaName'
Distribution: &Distribution
type: object
description: Detailed dividend and distribution data for a stock, ETF, or mutual fund
properties:
permaTicker:
type: string
description: The Tiingo permaticker
example: AAPL
ticker:
type: string
description: Ticker related to the asset
example: AAPL
exDate:
$ref: './common.yaml#/DateTime'
description: The ex-date of the distribution. In the Tiingo EOD Endpoints, this is the date where "divCash" will be non-zero. This is also the date used for dividend price adjustments.
example: '2023-08-25T00:00:00.000Z'
paymentDate:
type: string
format: date-time
nullable: true
description: The payment date of the distribution
example: '2023-09-07T00:00:00.000Z'
recordDate:
type: string
format: date-time
nullable: true
description: The record date of the distribution
example: '2023-08-28T00:00:00.000Z'
declarationDate:
type: string
format: date-time
nullable: true
description: The declaration date of the distribution
example: '2023-07-27T00:00:00.000Z'
distribution:
type: number
format: float
description: The total distribution for the given date
example: 0.24
distributionFreqency:
type: string
description: |
The frequency associated with this distribution. Frequency codes:
- w: Weekly
- bm: Bimonthly
- m: Monthly
- tm: Trimesterly
- q: Quarterly
- sa: Semiannually
- a: Annually
- ir: Irregular
- f: Final
- u: Unspecified
- c: Cancelled
enum:
- w
- bm
- m
- tm
- q
- sa
- a
- ir
- f
- u
- c
example: q
required:
- permaTicker
- ticker
- exDate
- distribution
- distributionFreqency
DistributionYield: &DistributionYield
type: object
description: Historical yield metrics for a ticker's dividend distributions
properties:
date:
$ref: './common.yaml#/DateTime'
description: Date associated with the yield
example: '2024-01-01T00:00:00.000Z'
trailingDiv1Y:
type: string
description: The trailing distribution yield for the asset based on the previous 1 year of distributions
example: '0.92'
required:
- date
- trailingDiv1Y

View File

@@ -0,0 +1,69 @@
# Splits API Schema Definitions
# Reference these using: $ref: '../schemas/splits-schemas.yaml#/SchemaName'
Split: &Split
type: object
description: Split data for a stock, ETF, or mutual fund
properties:
permaTicker:
type: string
description: The Tiingo permaticker (persistent identifier)
example: 'AAPL'
ticker:
$ref: './common.yaml#/Ticker'
exDate:
type: string
format: date
description: >
The ex-date of the split. In the Tiingo EOD Endpoints, this is the date where
"splitFactor" will not be 1.0. This is also the date used for split adjustments
example: '2023-08-25'
splitFrom:
type: number
format: float
description: The prior split ratio
example: 1.0
splitTo:
type: number
format: float
description: >
The new split ratio, i.e. how many shares of "splitTo" are given for each
share of "splitFrom"
example: 2.0
splitFactor:
type: number
format: float
description: >
The ratio of splitTo from splitFrom. Formula: splitFactor = splitTo/splitFrom.
This ratio is helpful in calculating split price adjustments
example: 2.0
splitStatus:
type: string
enum:
- 'a'
- 'c'
description: >
A code representing the status of split: 'a' = Active, 'c' = Cancelled
example: 'a'
required:
- permaTicker
- ticker
- exDate
- splitFrom
- splitTo
- splitFactor
- splitStatus
example:
permaTicker: 'AAPL'
ticker: 'AAPL'
exDate: '2023-08-25'
splitFrom: 1.0
splitTo: 1.04347826
splitFactor: 1.04347826
splitStatus: 'a'
SplitArray: &SplitArray
type: array
description: Array of split data objects
items:
$ref: '#/Split'