Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(module): Add new fundamentals time series module #748

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
341 changes: 341 additions & 0 deletions docs/modules/fundamentalsTimeSeries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,341 @@
# fundamentalsTimeSeries

## Usage:

```js
import yahooFinance from 'yahoo-finance2';

const query = 'AAPL';
const queryOptions = { period1: '2020-01-01', /* ... */ };
const result = await yahooFinance.fundamentalsTimeSeries(query, queryOptions);

[
{
date: 2022-12-31T00:00:00.000Z,
quarterlyCurrentDebt: 11483000000,
quarterlyTotalEquityGrossMinorityInterest: 56727000000,
quarterlyCashFinancial: 17908000000,
quarterlyInventory: 6820000000,
quarterlyAccumulatedDepreciation: -68044000000,
quarterlyInvestmentsAndAdvances: 114095000000,
quarterlyTotalDebt: 111110000000,
quarterlyOtherNonCurrentAssets: 60924000000,
quarterlyTangibleBookValue: 56727000000,
quarterlyTotalLiabilitiesNetMinorityInterest: 290020000000,
quarterlyCashEquivalents: 2627000000,
quarterlyOtherReceivables: 30428000000,
quarterlyOtherCurrentBorrowings: 9740000000,
quarterlyCommercialPaper: 1743000000,
quarterlyCurrentAssets: 128777000000,
quarterlyOtherEquityAdjustments: -12912000000,
quarterlyCurrentLiabilities: 137286000000,
quarterlyGrossPPE: 110995000000,
quarterlyRetainedEarnings: 3240000000,
quarterlyShareIssued: 15842407000,
quarterlyLongTermDebtAndCapitalLeaseObligation: 99627000000,
quarterlyOrdinarySharesNumber: 15842407000,
quarterlyNetPPE: 42951000000,
quarterlyOtherCurrentLiabilities: 59893000000,
quarterlyPayablesAndAccruedExpenses: 57918000000,
quarterlyOtherShortTermInvestments: 30820000000,
quarterlyNetDebt: 90575000000,
quarterlyWorkingCapital: -8509000000,
quarterlyStockholdersEquity: 56727000000,
quarterlyAccountsReceivable: 23752000000,
quarterlyCommonStock: 66399000000,
quarterlyNetTangibleAssets: 56727000000,
quarterlyTotalAssets: 346747000000,
quarterlyFinishedGoods: 4307000000,
quarterlyTotalNonCurrentAssets: 217970000000,
quarterlyCommonStockEquity: 56727000000,
quarterlyCurrentDeferredLiabilities: 7992000000,
quarterlyTotalCapitalization: 156354000000,
quarterlyCurrentDebtAndCapitalLeaseObligation: 11483000000,
quarterlyCurrentDeferredRevenue: 7992000000,
quarterlyLongTermDebt: 99627000000,
quarterlyCashAndCashEquivalents: 20535000000,
quarterlyCashCashEquivalentsAndShortTermInvestments: 51355000000,
quarterlyOtherNonCurrentLiabilities: 53107000000,
quarterlyOtherInvestments: 114095000000,
quarterlyPayables: 57918000000,
quarterlyInvestedCapital: 167837000000,
quarterlyReceivables: 54180000000,
quarterlyOtherCurrentAssets: 16422000000,
quarterlyAccountsPayable: 57918000000,
quarterlyGainsLossesNotAffectingRetainedEarnings: -12912000000,
quarterlyTotalNonCurrentLiabilitiesNetMinorityInterest: 152734000000,
quarterlyRawMaterials: 2513000000,
quarterlyCapitalStock: 66399000000
},
{
date: 2023-03-31T00:00:00.000Z,
quarterlyCurrentDebt: 12574000000,
quarterlyTotalEquityGrossMinorityInterest: 62158000000,
quarterlyCashFinancial: 20050000000,
quarterlyInventory: 7482000000,
quarterlyAccumulatedDepreciation: -69668000000,
quarterlyInvestmentsAndAdvances: 110461000000,
quarterlyTotalDebt: 109615000000,
quarterlyOtherNonCurrentAssets: 65388000000,
quarterlyTangibleBookValue: 62158000000,
quarterlyTotalLiabilitiesNetMinorityInterest: 270002000000,
quarterlyCashEquivalents: 4637000000,
quarterlyOtherReceivables: 17963000000,
quarterlyOtherCurrentBorrowings: 10578000000,
quarterlyCommercialPaper: 1996000000,
quarterlyAvailableForSaleSecurities: 110461000000,
quarterlyCurrentAssets: 112913000000,
quarterlyOtherEquityAdjustments: -11746000000,
quarterlyCurrentLiabilities: 120075000000,
quarterlyGrossPPE: 113066000000,
quarterlyRetainedEarnings: 4336000000,
quarterlyShareIssued: 15723406000,
quarterlyLongTermDebtAndCapitalLeaseObligation: 97041000000,
quarterlyOrdinarySharesNumber: 15723406000,
quarterlyNetPPE: 43398000000,
quarterlyOtherCurrentLiabilities: 56425000000,
quarterlyPayablesAndAccruedExpenses: 42945000000,
quarterlyOtherShortTermInvestments: 31185000000,
quarterlyNetDebt: 84928000000,
quarterlyWorkingCapital: -7162000000,
quarterlyStockholdersEquity: 62158000000,
quarterlyAccountsReceivable: 17936000000,
quarterlyCommonStock: 69568000000,
quarterlyNetTangibleAssets: 62158000000,
quarterlyTotalAssets: 332160000000,
quarterlyFinishedGoods: 4103000000,
quarterlyTotalNonCurrentAssets: 219247000000,
quarterlyCommonStockEquity: 62158000000,
quarterlyCurrentDeferredLiabilities: 8131000000,
quarterlyTotalCapitalization: 159199000000,
quarterlyCurrentDebtAndCapitalLeaseObligation: 12574000000,
quarterlyCurrentDeferredRevenue: 8131000000,
quarterlyLongTermDebt: 97041000000,
quarterlyCashAndCashEquivalents: 24687000000,
quarterlyCashCashEquivalentsAndShortTermInvestments: 55872000000,
quarterlyOtherNonCurrentLiabilities: 52886000000,
quarterlyPayables: 42945000000,
quarterlyInvestedCapital: 171773000000,
quarterlyReceivables: 35899000000,
quarterlyOtherCurrentAssets: 13660000000,
quarterlyAccountsPayable: 42945000000,
quarterlyGainsLossesNotAffectingRetainedEarnings: -11746000000,
quarterlyTotalNonCurrentLiabilitiesNetMinorityInterest: 149927000000,
quarterlyRawMaterials: 3379000000,
quarterlyInvestmentinFinancialAssets: 110461000000,
quarterlyCapitalStock: 69568000000
},
{
date: 2023-06-30T00:00:00.000Z,
quarterlyCurrentDebt: 11209000000,
quarterlyTotalEquityGrossMinorityInterest: 60274000000,
quarterlyCashFinancial: 25337000000,
quarterlyInventory: 7351000000,
quarterlyAccumulatedDepreciation: -70787000000,
quarterlyInvestmentsAndAdvances: 104061000000,
quarterlyTotalDebt: 109280000000,
quarterlyOtherNonCurrentAssets: 64768000000,
quarterlyTangibleBookValue: 60274000000,
quarterlyTotalLiabilitiesNetMinorityInterest: 274764000000,
quarterlyCashEquivalents: 3071000000,
quarterlyOtherReceivables: 19637000000,
quarterlyOtherCurrentBorrowings: 7216000000,
quarterlyCommercialPaper: 3993000000,
quarterlyAvailableForSaleSecurities: 104061000000,
quarterlyCurrentAssets: 122659000000,
quarterlyOtherEquityAdjustments: -11801000000,
quarterlyCurrentLiabilities: 124963000000,
quarterlyGrossPPE: 114337000000,
quarterlyRetainedEarnings: 1408000000,
quarterlyShareIssued: 15647868000,
quarterlyLongTermDebtAndCapitalLeaseObligation: 98071000000,
quarterlyOrdinarySharesNumber: 15647868000,
quarterlyNetPPE: 43550000000,
quarterlyOtherCurrentLiabilities: 58897000000,
quarterlyPayablesAndAccruedExpenses: 46699000000,
quarterlyOtherShortTermInvestments: 34074000000,
quarterlyNetDebt: 80872000000,
quarterlyWorkingCapital: -2304000000,
quarterlyStockholdersEquity: 60274000000,
quarterlyAccountsReceivable: 19549000000,
quarterlyCommonStock: 70667000000,
quarterlyNetTangibleAssets: 60274000000,
quarterlyTotalAssets: 335038000000,
quarterlyFinishedGoods: 3563000000,
quarterlyTotalNonCurrentAssets: 212379000000,
quarterlyCommonStockEquity: 60274000000,
quarterlyCurrentDeferredLiabilities: 8158000000,
quarterlyTotalCapitalization: 158345000000,
quarterlyCurrentDebtAndCapitalLeaseObligation: 11209000000,
quarterlyCurrentDeferredRevenue: 8158000000,
quarterlyLongTermDebt: 98071000000,
quarterlyCashAndCashEquivalents: 28408000000,
quarterlyCashCashEquivalentsAndShortTermInvestments: 62482000000,
quarterlyOtherNonCurrentLiabilities: 51730000000,
quarterlyPayables: 46699000000,
quarterlyInvestedCapital: 169554000000,
quarterlyReceivables: 39186000000,
quarterlyOtherCurrentAssets: 13640000000,
quarterlyAccountsPayable: 46699000000,
quarterlyGainsLossesNotAffectingRetainedEarnings: -11801000000,
quarterlyTotalNonCurrentLiabilitiesNetMinorityInterest: 149801000000,
quarterlyRawMaterials: 3788000000,
quarterlyInvestmentinFinancialAssets: 104061000000,
quarterlyCapitalStock: 70667000000
},
{
date: 2023-09-30T00:00:00.000Z,
quarterlyCurrentDebt: 15807000000,
quarterlyTradeandOtherPayablesNonCurrent: 15457000000,
quarterlyLeases: 12839000000,
quarterlyTotalEquityGrossMinorityInterest: 62146000000,
quarterlyMachineryFurnitureEquipment: 78314000000,
quarterlyCashFinancial: 28359000000,
quarterlyInventory: 6331000000,
quarterlyAccumulatedDepreciation: -70884000000,
quarterlyInvestmentsAndAdvances: 100544000000,
quarterlyTotalDebt: 111088000000,
quarterlyOtherNonCurrentAssets: 46906000000,
quarterlyTangibleBookValue: 62146000000,
quarterlyNonCurrentDeferredAssets: 17852000000,
quarterlyTotalLiabilitiesNetMinorityInterest: 290437000000,
quarterlyCashEquivalents: 1606000000,
quarterlyOtherReceivables: 31477000000,
quarterlyOtherCurrentBorrowings: 9822000000,
quarterlyCommercialPaper: 5985000000,
quarterlyAvailableForSaleSecurities: 100544000000,
quarterlyCurrentAssets: 143566000000,
quarterlyOtherEquityAdjustments: -11452000000,
quarterlyCurrentLiabilities: 145308000000,
quarterlyGrossPPE: 114599000000,
quarterlyRetainedEarnings: -214000000,
quarterlyShareIssued: 15550061000,
quarterlyLongTermDebtAndCapitalLeaseObligation: 95281000000,
quarterlyOrdinarySharesNumber: 15550061000,
quarterlyNetPPE: 43715000000,
quarterlyOtherCurrentLiabilities: 58829000000,
quarterlyPayablesAndAccruedExpenses: 62611000000,
quarterlyOtherShortTermInvestments: 31590000000,
quarterlyNetDebt: 81123000000,
quarterlyWorkingCapital: -1742000000,
quarterlyStockholdersEquity: 62146000000,
quarterlyNonCurrentDeferredTaxesAssets: 17852000000,
quarterlyAccountsReceivable: 29508000000,
quarterlyCommonStock: 73812000000,
quarterlyNetTangibleAssets: 62146000000,
quarterlyTotalAssets: 352583000000,
quarterlyTotalNonCurrentAssets: 209017000000,
quarterlyCommonStockEquity: 62146000000,
quarterlyCurrentDeferredLiabilities: 8061000000,
quarterlyTotalCapitalization: 157427000000,
quarterlyCurrentDebtAndCapitalLeaseObligation: 15807000000,
quarterlyLandAndImprovements: 23446000000,
quarterlyCurrentDeferredRevenue: 8061000000,
quarterlyLongTermDebt: 95281000000,
quarterlyCashAndCashEquivalents: 29965000000,
quarterlyCashCashEquivalentsAndShortTermInvestments: 61555000000,
quarterlyOtherNonCurrentLiabilities: 34391000000,
quarterlyPayables: 62611000000,
quarterlyInvestedCapital: 173234000000,
quarterlyReceivables: 60985000000,
quarterlyOtherCurrentAssets: 14695000000,
quarterlyAccountsPayable: 62611000000,
quarterlyGainsLossesNotAffectingRetainedEarnings: -11452000000,
quarterlyTotalNonCurrentLiabilitiesNetMinorityInterest: 145129000000,
quarterlyInvestmentinFinancialAssets: 100544000000,
quarterlyCapitalStock: 73812000000
},
{
date: 2023-12-31T00:00:00.000Z,
quarterlyCurrentDebt: 12952000000,
quarterlyTotalEquityGrossMinorityInterest: 74100000000,
quarterlyCashFinancial: 29542000000,
quarterlyInventory: 6511000000,
quarterlyAccumulatedDepreciation: -72510000000,
quarterlyInvestmentsAndAdvances: 99475000000,
quarterlyTotalDebt: 108040000000,
quarterlyOtherNonCurrentAssets: 66681000000,
quarterlyTangibleBookValue: 74100000000,
quarterlyTotalLiabilitiesNetMinorityInterest: 279414000000,
quarterlyCashEquivalents: 11218000000,
quarterlyOtherReceivables: 26908000000,
quarterlyOtherCurrentBorrowings: 10954000000,
quarterlyCommercialPaper: 1998000000,
quarterlyAvailableForSaleSecurities: 99475000000,
quarterlyCurrentAssets: 143692000000,
quarterlyOtherEquityAdjustments: -9378000000,
quarterlyCurrentLiabilities: 133973000000,
quarterlyGrossPPE: 116176000000,
quarterlyRetainedEarnings: 8242000000,
quarterlyShareIssued: 15460223000,
quarterlyLongTermDebtAndCapitalLeaseObligation: 95088000000,
quarterlyOrdinarySharesNumber: 15460223000,
quarterlyNetPPE: 43666000000,
quarterlyOtherCurrentLiabilities: 54611000000,
quarterlyPayablesAndAccruedExpenses: 58146000000,
quarterlyOtherShortTermInvestments: 32340000000,
quarterlyNetDebt: 67280000000,
quarterlyWorkingCapital: 9719000000,
quarterlyStockholdersEquity: 74100000000,
quarterlyAccountsReceivable: 23194000000,
quarterlyCommonStock: 75236000000,
quarterlyNetTangibleAssets: 74100000000,
quarterlyTotalAssets: 353514000000,
quarterlyTotalNonCurrentAssets: 209822000000,
quarterlyCommonStockEquity: 74100000000,
quarterlyCurrentDeferredLiabilities: 8264000000,
quarterlyTotalCapitalization: 169188000000,
quarterlyCurrentDebtAndCapitalLeaseObligation: 12952000000,
quarterlyCurrentDeferredRevenue: 8264000000,
quarterlyLongTermDebt: 95088000000,
quarterlyCashAndCashEquivalents: 40760000000,
quarterlyCashCashEquivalentsAndShortTermInvestments: 73100000000,
quarterlyOtherNonCurrentLiabilities: 50353000000,
quarterlyPayables: 58146000000,
quarterlyInvestedCapital: 182140000000,
quarterlyReceivables: 50102000000,
quarterlyOtherCurrentAssets: 13979000000,
quarterlyAccountsPayable: 58146000000,
quarterlyGainsLossesNotAffectingRetainedEarnings: -9378000000,
quarterlyTotalNonCurrentLiabilitiesNetMinorityInterest: 145441000000,
quarterlyInvestmentinFinancialAssets: 99475000000,
quarterlyCapitalStock: 75236000000
}
]
```

**Note:** The example output above does not cover all possible return results, which can vary by asset type and even time of day (trading period). For an exhausting list of everything we cover and that you might get back, please see the TypeScript interface in https://github.com/gadicc/node-yahoo-finance2/blob/devel/src/modules/fundamentalsTimeSeries.ts

Make sure to also look out for [fundamentalsTimeSeries() errors](#errors)
and [general errors](../README.md#error-handling).

## API

```js
await yahooFinance.fundamentalsTimeSeries(query, queryOptions, moduleOptions);
```

### Symbol

Symbol name as used by Yahoo (often the stock ticker). You can find it
using [autoc](./autoc.md) or [search](./search.md). You can also provide
an array of symbols, and you'll receive an array of results back.

### Query Options

| Name | Type | Default | Description |
| ------------- | ----------| ---------- | --------------------------------- |
| `period1` | Date* | *required* | Starting period
| `period2` | Date* | (today) | Ending period
| `type` | "quarterly", "annual" | "quarterly" | Financial time series type
| `lang` | string | `"en-US"` | |
| `region` | string | `"US"` | |

Dates* can be:

* A **Date** instance, e.g. `new Date(something)`
* A **string** that can be parsed by `Date()`, e.g. `"2020-01-01"`.

### Module Options

See [Common Options](../README.md#common-options).