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

bovespa

v0.2.5

Published

Bovespa data extractor, server, and command line interface

Downloads

79

Readme

Node Bovespa

Warning: This module is currently partially active, due to bovespa's original API disappearance. But it will be brought back to you once we can work around that issue.

Access bovespa/B3 data in many ways:

  • API
  • JavaScript module

Also:

  • Scrap and organize data from bovespa's historic time series

Dependency
Status Build Status

Why

Free B3 data extraction is poor, the few places that have it have high costs for starters.

This project was done so that developers like you and me can have access to B3 data in a easier way and develop nice things on top of it.

Installing

$ npm install bovespa --save

For CLI usage it would be better to do:

$ npm install bovespa -g

Usage

JavaScript

We use the promise API to fetch all sorts of data:

// Using the default API (attention for the final function call):
const bovespa = require("bovespa")();

// Querying data:
bovespa("ABEV3", "2018-04-23").then(data => {
  // Manipulate your data here
});

// What is received:
bovespa("ABEV3", "2018-04-23").then(console.log);
// Outputs raw bovespa data:
//
// {
//   id: 4851343,
//   day: '2018-04-23',
//   codbdi: '02',
//   codneg: 'ABEV3',
//   tpmerc: '010',
//   nomres: 'AMBEV S/A',
//   especi: 'ON',
//   prazot: '',
//   modref: 'R$',
//   preabe: '23.31',
//   premin: '23.23',
//   premax: '23.55',
//   premed: '23.40',
//   preult: '23.45',
//   preofc: '23.44',
//   preofv: '23.45',
//   preexe: '0.00',
//   totneg: '21813',
//   quatot: '8104000',
//   voltot: '18967719600',
//   indopc: '0',
//   fatcot: '0000001',
//   ptoexe: '0000000000000',
//   codisi: 'BRABEVACNOR1',
//   dismes: '119',
//   datven: '9999-12-31',
//   created_at: '2019-04-01T12:25:13.439Z',
//   updated_at: '2019-04-01T12:25:13.439Z'
// }

You can use a different server to fetch data from your own API too:

const bovespa = require("bovespa")("https://<your own api here>");

bovespa("ABEV3", "2018-04-23").then(data => {
  // Manipulate your data here
});

CLI

Command line help should give you a good guide on how to use the project

$ bovespa --help

  Bovespa data extractor, server, and command line interface

  Usage:
    $ bovespa <codes ...> [Options]

    Extracts data from bovespa and displays it on the terminal

    Options
      --date, -d <YYYY-MM-DD> [Default: Today] Which date to extract the data from
      --api, -a <API URL> [Default 'https://bovespa.nihey.org']

    Examples:
      $ bovespa ABEV3
      $ bovespa ABEV3 --date 2019-04-01
      $ bovespa ABEV3 PETR4 BIDI4 --date 2019-04-01

You can query historic time series by using this command:

$ bovespa ABEV3 PETR4 -d 2019-04-01

# Output:
#
# > CODE: ABEV3 @ 2019-04-01
# > Variation: -0.30%
# > Opening: 16.87
# > Closing: 16.82
# > Average: 16.85
# > Max: 17.00
# > Min: 16.74
# >
# > CODE: PETR4 @ 2019-04-01
# > Variation: -1.43%
# > Opening: 28.40
# > Closing: 28.00
# > Average: 28.11
# > Max: 28.42
# > Min: 27.87

License

This code is released under CC0 (Public Domain)