Fundamentus Unofficial API
This module provides an api to get data from Brazilian stock shares.
The truth of source is Fundamentus, a website that provides financial and fundamentalist information about companies listed on the Bovespa.
Content
Installation
$ npm install fundamentus-unofficial-api --save
Usage
Importing
const FundamentusAPI = // CommonJS// or
Fetching details about share
const share = await FundamentusAPI
Output
- All fields are parsed to its correct data type
- i.e. '"1,78%" => 0.0178
- If a field is
null
, it means there is no data available from Fundamentus
console.log(share)
ano2015: -00455 ano2016: 09738 ano2017: -00018 ano2018: 05154 ano2019: 02774 ano2020: -03891 ativo: 926011000000 ativoCirculante: 112101000000 cotacao: 1955 cresRec5A: 0009 dataUltCot: '08/05/2020' dia: 00683 disponibilidades: 33294000000 divBrPorPatrim: 119 divBruta: 351161000000 divLiquida: 317867000000 divYield: 0026 ebit: 95991000000 ebitPorAtivo: 0104 ebitUltimos3Meses: 28649000000 empresa: 'PETROBRAS ON' evPorEbit: 597 evPorEbitda: 36 giroAtivos: 033 liquidezCorr: 097 lpa: 308 lucroLiquido: 40137000000 lucroLiquidoUltimos3Meses: 8153000000 margBruta: 0404 margEbit: 0318 margLiquida: 0136 max52Sem: 3328 mes: 00483 min52Sem: 1105 nroAcoes: 13044500000 pPorAtivCircLiq: -05 pPorAtivos: 028 pPorCapGiro: -6303 pPorEbit: 266 pPorL: 635 pPorVp: 086 papel: 'PETR3' patrimLiq: 295541000000 psr: 084 receitaLiquida: 302245000000 receitaLiquidaUltimos3Meses: 72628000000 roe: 0136 roic: 011 setor: 'Petróleo, Gás e Biocombustíveis' subsetor: 'Exploração e/ou Refino e Distribuição' tipo: 'ON' ultBalancoProcessado: '31/12/2019' ultimos12Meses: -03437 ultimos30Dias: 01171 valorDaFirma: 572887000000 valorDeMercado: 255020000000 volMed2M: 607192000 vpa: 2266
Fetching quotation history
const quotationHistory = await FundamentusAPI
Output
// console.log(history)QuotationHistory share: 'PETR3' history: date: '2020-04-09' quotation: 1686 ...
Methods
fetchQuotationHistory
returns a QuotationHistory
instance which we can manipulate to get only a specific range of timeline or quotation value using the following methods:
- last
- minDate
- maxDate
- minQuotation
- maxQuotation
Examples
const quotationHistory = await FundamentusAPI // Returns the history range which the quotation value was, at least, R$11.43 since January 1st, 2020quotationHistory
const quotationHistory = await FundamentusAPI // Returns the history in the last 10 daysquotationHistory
Fetching earnings history
const earningsHistory = await FundamentusAPI
Output
// console.log(history)EarningsHistory share: 'PETR3' history: date: '2008-04-04' value: 005 type: 'DIVIDENDO' perShare: 1 ...
Methods
fetchEarningsHistory
returns a EarningsHistory
instance which we can manipulate to get only a specific range of timeline, value or by type using the following methods:
- minDate
- maxDate
- minValue
- maxValue
- filterByType
Examples
const earningsHistory = await FundamentusAPI // Returns all the earnings of 2019earningsHistory
const earningsHistory = await FundamentusAPI // Returns earnings by dividends with min value of 0.5earningsHistory
Getting help
If you need help, want to make a suggestion or encounter a bug, please contact me:
https://github.com/margato/fundamentus-unofficial-api/issues