npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fundamentus-unofficial-api

v1.2.2

Published

This is an module to scrap stock market data from https://fundamentus.com.br, a website that makes available financial and fundamentalist information about companies listed in Bovespa.

Downloads

29

Readme

Fundamentus Unofficial API

JavaScript Style Guide

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 = require('fundamentus-unofficial-api') // CommonJS
// or
import FundamentusAPI from 'fundamentus-unofficial-api' // ESM

Fetching details about share

const share = await FundamentusAPI.fetch('petr3')

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
{
  ano2015: -0.0455,
  ano2016: 0.9738,
  ano2017: -0.0018,
  ano2018: 0.5154,
  ano2019: 0.2774,
  ano2020: -0.3891,
  ativo: 926011000000,
  ativoCirculante: 112101000000,
  cotacao: 19.55,
  cresRec5A: 0.009,
  dataUltCot: '08/05/2020',
  dia: 0.0683,
  disponibilidades: 33294000000,
  divBrPorPatrim: 1.19,
  divBruta: 351161000000,
  divLiquida: 317867000000,
  divYield: 0.026,
  ebit: 95991000000,
  ebitPorAtivo: 0.104,
  ebitUltimos3Meses: 28649000000,
  empresa: 'PETROBRAS ON',
  evPorEbit: 5.97,
  evPorEbitda: 3.6,
  giroAtivos: 0.33,
  liquidezCorr: 0.97,
  lpa: 3.08,
  lucroLiquido: 40137000000,
  lucroLiquidoUltimos3Meses: 8153000000,
  margBruta: 0.404,
  margEbit: 0.318,
  margLiquida: 0.136,
  max52Sem: 33.28,
  mes: 0.0483,
  min52Sem: 11.05,
  nroAcoes: 13044500000,
  pPorAtivCircLiq: -0.5,
  pPorAtivos: 0.28,
  pPorCapGiro: -63.03,
  pPorEbit: 2.66,
  pPorL: 6.35,
  pPorVp: 0.86,
  papel: 'PETR3',
  patrimLiq: 295541000000,
  psr: 0.84,
  receitaLiquida: 302245000000,
  receitaLiquidaUltimos3Meses: 72628000000,
  roe: 0.136,
  roic: 0.11,
  setor: 'Petróleo, Gás e Biocombustíveis',
  subsetor: 'Exploração e/ou Refino e Distribuição',      
  tipo: 'ON',
  ultBalancoProcessado: '31/12/2019',
  ultimos12Meses: -0.3437,
  ultimos30Dias: 0.1171,
  valorDaFirma: 572887000000,
  valorDeMercado: 255020000000,
  volMed2M: 607192000,
  vpa: 22.66
}

Fetching quotation history

const quotationHistory = await FundamentusAPI.fetchQuotationHistory('petr3')

Output

// console.log(history)
QuotationHistory {
  share: 'PETR3',
  history: [
    { date: '2020-04-09', quotation: 16.86 },
    ...
  ]
}

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.fetchQuotationHistory('petr3')

// Returns the history range which the quotation value was, at least, R$11.43 since January 1st, 2020
quotationHistory.minQuotation(11.43).minDate('2020-01-01')
const quotationHistory = await FundamentusAPI.fetchQuotationHistory('petr3')

// Returns the history in the last 10 days
quotationHistory.last(10)

Fetching earnings history

const earningsHistory = await FundamentusAPI.fetchEarningsHistory('petr3')

Output

// console.log(history)
EarningsHistory {
  share: 'PETR3',
  history: [
    { date: '2008-04-04', value: 0.05, 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.fetchEarningsHistory('petr3')

// Returns all the earnings of 2019
earningsHistory.minDate('2019-01-01').maxDate('2019-12-31')
const earningsHistory = await FundamentusAPI.fetchEarningsHistory('petr3')

// Returns earnings by dividends with min value of 0.5
earningsHistory.filterByType('DIVIDENDO').minValue(0.5)

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