2.1.0 • Published 12 months ago

@reiryoku/apollo v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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

NameIDNumberProvider/s
U.S. Non Farm Payrolls (MoM)US/NonFarmPayrolls/MoMPure numberInvesting.com
U.S. Interest RateUS/InterestRatePercentageInvesting.com
U.S. Unemployment RateUS/UnemploymentRate/MoMPercentageInvesting.com
U.S. CPI (YoY)US/CPI/YoYPercentageInvesting.com
U.S. Core CPI (MoM)US/CoreCPI/MoMPercentageInvesting.com
U.S. Core CPI (YoY)US/CoreCPI/YoYPercentageInvesting.com
U.S. Crude Oil Inventories (WoW)US/CrudeOilInventories/WoWPure numberInvesting.com
U.S. Natural Gas StorageUS/NaturalGasStoragePure numberInvesting.com
Eurozone CPI (YoY)Eurozone/CPI/YoYPercentageInvesting.com
Eurozone Interest RateEurozone/InterestRatePercentageInvesting.com
Italy CPI (YoY)Italy/CPI/YoYPercentageInvesting.com
Germany CPI (YoY)Germany/CPI/YoYPercentageInvesting.com
Japan CPI (YoY)Japan/CPI/YoYPercentageInvesting.com
Canada Interest RateCanada/InterestRatePercentageInvesting.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

2.1.0

12 months ago

2.0.0

2 years ago

1.0.0

2 years ago