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

@reiryoku/apollo

v2.1.0

Published

A JavaScript library providing real-time economic data

Downloads

6

Readme

Apollo

Image Image Image

Apollo is a JavaScript library providing real-time economic data such as inflation rates, unemployment rates or interest rates reported by governments and other entities.

This library gives its best when used with Mida, our JavaScript framework for trading in global financial markets.

Usage

How to get an economic factor and its declarations

First you have to choose an economic factor from the list then request its declarations

const { ApolloEconomicFactor, } = require("@reiryoku/apollo");

const japanInflationRate = ApolloEconomicFactor.getById("Japan/CPI/YoY");
const lastDeclaration = await japanInflationRate.getLastDeclaration();

console.log(`Japan inflation rate is ${lastDeclaration.actualValue}%`);
console.log(`The last declaration was made on ${lastDeclaration.date}`);

Economic declaration structure

The structure of an economic declaration in Apollo

export type ApolloEconomicFactorDeclaration = {
    date: Date;
    previousDeclaration?: ApolloEconomicFactorDeclaration;
    nextDeclaration?: ApolloEconomicFactorDeclaration;
    actualValue?: number;
    forecastValue?: number;
};

Supported economic factors

| Name | ID | Number | Provider/s | |----------------------------------|----------------------------|-------------|---------------| | U.S. Non Farm Payrolls (MoM) | US/NonFarmPayrolls/MoM | Pure number | Investing.com | | U.S. Interest Rate | US/InterestRate | Percentage | Investing.com | | U.S. Unemployment Rate | US/UnemploymentRate/MoM | Percentage | Investing.com | | U.S. CPI (YoY) | US/CPI/YoY | Percentage | Investing.com | | U.S. Core CPI (MoM) | US/CoreCPI/MoM | Percentage | Investing.com | | U.S. Core CPI (YoY) | US/CoreCPI/YoY | Percentage | Investing.com | | U.S. Crude Oil Inventories (WoW) | US/CrudeOilInventories/WoW | Pure number | Investing.com | | U.S. Natural Gas Storage | US/NaturalGasStorage | Pure number | Investing.com | | Eurozone CPI (YoY) | Eurozone/CPI/YoY | Percentage | Investing.com | | Eurozone Interest Rate | Eurozone/InterestRate | Percentage | Investing.com | | Italy CPI (YoY) | Italy/CPI/YoY | Percentage | Investing.com | | Germany CPI (YoY) | Germany/CPI/YoY | Percentage | Investing.com | | Japan CPI (YoY) | Japan/CPI/YoY | Percentage | Investing.com | | Canada Interest Rate | Canada/InterestRate | Percentage | Investing.com |

Economic factors ids are case sensitive.

Declarations frequency

  • WoW means week over week
  • MoM means month over month
  • YoY means year over year

How to contribute

How to add a new economic provider

It's very simple to add a new economic factor you just need to edit the factors.json file and include a new definition.

  • Visit https://www.investing.com/economic-calendar/
  • Choose the economic factor to add, then open its link
  • Add a new definition to factors.json according to the existent format, include the URL of the economic factor
  • Done! Test it and create a pull request

Providers

Apollo is desgined to support multiple data providers, for now all the data is kindly offered by Investing.com