https://github.com/samgozman/barchart-dot-com
Fetching data from the barchart.com
https://github.com/samgozman/barchart-dot-com
Last synced: 9 months ago
JSON representation
Fetching data from the barchart.com
- Host: GitHub
- URL: https://github.com/samgozman/barchart-dot-com
- Owner: samgozman
- License: mit
- Created: 2021-03-16T08:47:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-06T14:29:40.000Z (about 2 years ago)
- Last Synced: 2025-04-02T16:55:13.795Z (over 1 year ago)
- Language: JavaScript
- Size: 651 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# barchart-dot-com
[](https://ko-fi.com/C0C1DI4VL)

[](https://www.codacy.com/gh/samgozman/barchart-dot-com/dashboard?utm_source=github.com&utm_medium=referral&utm_content=samgozman/barchart-dot-com&utm_campaign=Badge_Grade)
[](https://www.npmjs.com/package/barchart-dot-com)


Fetching data from the barchart.com
## Installation
Install package from NPM
```bash
npm install barchart-dot-com
```
## Features
Fetch stock data from barchart-dot-com.com such as:
* Financial income
* Financial Cash Flow
* Financial Balance Sheet
* Overview: last price, options, analytics etc.
## Usage
Use **barchart-dot-com** in async functionsю
Most of the financial data is available in annual and quarterly formats. In total, each data format contains 5 periods (years / months).
Results sorted from closest date
### Financials: income
Annual or Quarterly Income Statements.
```javascript
const { financials } = require('barchart-dot-com')
const main = async () => {
const stock = await financials.income('aapl').annual()
console.log(stock.netIncome)
console.log(stock.ebitda)
}
main()
```
*Returns:*
* [ 57411000000, 55256000000, 59531000000, 48351000000, 45687000000 ]
* [ 77344000000, 76477000000, 81801000000, 71501000000, 70529000000 ]
### Financials: Cash Flow
The Cash Flow report is used to assess the quality of a company's income.
```javascript
const { financials } = require('barchart-dot-com')
const main = async () => {
const stock = await financials.cashFlow('aapl').quarterly()
console.log(stock.freeCashFlow.freeFlow)
}
main()
```
*Returns:*
* [ 35263000000, 73365000000, 54573000000, 39867000000, 28409000000 ]
### Financials: Balance Sheet
A Balance Sheet is a financial statement that summarizes a company's assets, liabilities and shareholders' equity.
```javascript
const { financials } = require('barchart-dot-com')
const main = async () => {
const stock = await financials.balanceSheet('aapl').annual()
console.log(stock.assets.total)
console.log(stock.liabilities.total)
console.log(stock.totalLiabilitiesAndEquity)
}
main()
```
*Returns:*
* [ 323888000000, 338516000000, 365725000000, 375319000000, 321686000000 ]
* [ 258549000000, 248028000000, 258578000000, 241272000000, 193437000000 ]
* [ 323888000000, 338516000000, 365725000000, 375319000000, 321686000000 ]
### Quotes: overview
The Quote Overview gives you a snapshot view for a specific symbol.
```javascript
const { quotes } = require('barchart-dot-com')
const main = async () => {
const stock = await quotes.overview('aapl')
console.log(stock.exchange)
console.log(stock.overview.previousPrice)
console.log(stock.fundamentals.beta60Month)
console.log(stock.technicals)
}
main()
```
*Returns:*
* 'NASDAQ'
* 120.09
* 1.25
* { opinion: 'Sell', power: 8 }
## Disclaimer
This is not an official NPM package. Always check the received data from the corresponding page on the barchart.com.