All Projects → 1Forge → javascript-forex-quotes

1Forge / javascript-forex-quotes

Licence: MIT license
JavaScript Library for fetching realtime forex quotes.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to javascript-forex-quotes

python-forex-quotes
Library to fetch and parse realtime Forex quotes and convert currencies
Stars: ✭ 25 (-34.21%)
Mutual labels:  quotes, currency, forex, currency-converter
currency-api
Free Currency Exchange Rates API with 150+ Currencies & No Rate Limits
Stars: ✭ 507 (+1234.21%)
Mutual labels:  currency, forex, currency-exchange-rates, currency-converter
Php Forex Quotes
PHP Library for fetching realtime forex quotes.
Stars: ✭ 61 (+60.53%)
Mutual labels:  quotes, currency, forex, currency-converter
php-currency-api
Standardized wrapper for popular currency rate APIs. Currently supports FixerIO, CurrencyLayer, Open Exchange Rates and Exchange Rates API.
Stars: ✭ 17 (-55.26%)
Mutual labels:  currency, currency-exchange-rates, currency-converter
react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-44.74%)
Mutual labels:  currency, currency-exchange-rates, currency-converter
Money
PHP implementation of Fowler's Money pattern.
Stars: ✭ 3,868 (+10078.95%)
Mutual labels:  currency, currency-exchange-rates, currency-converter
historical-bank-ruby
A Ruby Bank that serves historical exchange rates
Stars: ✭ 14 (-63.16%)
Mutual labels:  currency, currency-exchange-rates, currency-converter
Laravel Swap
💵 Currency exchange rates for Laravel and Lumen
Stars: ✭ 296 (+678.95%)
Mutual labels:  currency, currency-converter
Forex Python
Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io
Stars: ✭ 378 (+894.74%)
Mutual labels:  currency, currency-converter
Gocurrency
Simple currency converter. Insert an amount, what currency to convert from and what currency to convert to.
Stars: ✭ 26 (-31.58%)
Mutual labels:  currency, currency-converter
Coinonline
A Cryptocurrency/Blockchain wallet app based on React Native
Stars: ✭ 59 (+55.26%)
Mutual labels:  currency, currency-converter
Laravel Money
Currency formatting and conversion package for Laravel
Stars: ✭ 261 (+586.84%)
Mutual labels:  currency, currency-converter
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-57.89%)
Mutual labels:  currency, currency-converter
Money
A money and currency library for PHP
Stars: ✭ 855 (+2150%)
Mutual labels:  currency, currency-converter
Android Money
Simple money and currency converter library for android.
Stars: ✭ 66 (+73.68%)
Mutual labels:  currency, currency-converter
Swap
💱 Currency exchange rates library
Stars: ✭ 1,195 (+3044.74%)
Mutual labels:  currency, currency-converter
Laravel Cconverter
A simple currency converter plugin for Laravel 5. Currency providers: The European Central Bank, OpenExchange, CurrencyLayer and fixer.io
Stars: ✭ 39 (+2.63%)
Mutual labels:  currency, currency-converter
Coinc
💰💱Alfred Workflow for currencies conversion
Stars: ✭ 38 (+0%)
Mutual labels:  currency, currency-converter
Dinero
📈 💰 A golang interface for the Open Exchange Rates API
Stars: ✭ 68 (+78.95%)
Mutual labels:  currency, forex
salaryconverter
Equivalent salary converter using PPP
Stars: ✭ 42 (+10.53%)
Mutual labels:  currency, currency-converter

javascript-forex-quotes

javascript-forex-quotes is a Javascript Library for fetching realtime forex quotes.

1Forge Data

Table of Contents

Requirements

Installation

npm install forex-quotes --save

Usage

Importing the client

// With require
const ForgeClient = require("forex-quotes").default;

// With es6 or TypeScript
import ForgeClient from 'forex-quotes';

Using WebSocket

let client = new ForgeClient('YOUR_API_KEY');

// Handle incoming price updates from the server
client.onUpdate((symbol, data) => {
    console.log(symbol, data);
});

// Handle non-price update messages
client.onMessage((message) => {
    console.log(message);
});

// Handle disconnection from the server
client.onDisconnect(() => {
    console.log("Disconnected from server");
});

// Handle successful connection
client.onConnect(() => {

    // Subscribe to a single currency pair
    client.subscribeTo('EUR/USD');

    // Subscribe to an array of currency pairs
    client.subscribeTo([
        'GBP/JPY',
        'AUD/CAD',
        'EUR/CHF',
    ]);

    // Subscribe to all currency pairs
    client.subscribeToAll();

    // Unsubscribe from a single currency pair
    client.unsubscribeFrom('EUR/USD');

    // Unsubscribe from an array of currency pairs
    client.unsubscribeFrom([
        'GBP/JPY',
        'AUD/CAD',
        'EUR/CHF'
    ]);

    // Unsubscribe from all currency pairs
    client.unsubscribeFromAll();

    // Disconnect from the server
    client.disconnect();
});

client.connect();

Using RESTful API

// You can get an API key at 1forge.com
let client = new ForgeClient('YOUR_API_KEY');

// Get the list of available symbols
client.getSymbols().then(response => {
    console.log(response);
});

// Get quotes for specified symbols:
client.getQuotes(['EUR/USD', 'GBP/JPY', 'AUD/USD']).then(response => {
    console.log(response);
});

// Convert from one currency to another:
client.convert('EUR', 'USD', 100).then(response => {
    console.log(response);
});

// Check if the market is open:
client.getMarketStatus().then(response => {
    console.log(response);
});

// Check your usage / quota limit:
client.getQuota().then(response => {
    console.log(response);
});

Contributing

Thank you for considering contributing! Any issues, bug fixes, suggestions, improvements or help in any other way is always appreciated. Please feel free to open an issue or create a pull request.

Support and Contact

Please contact me at [email protected] if you have any questions or requests.

License and Terms

This library is provided without warranty under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].