@fin.cx/opendata 3.2.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/readme.md CHANGED
@@ -87,6 +87,56 @@ const apple = await stockService.getData({ type: 'current', ticker: 'AAPL' });
87
87
  console.log(`${apple.companyFullName}: $${apple.price}`);
88
88
  ```
89
89
 
90
+ ### đŸĒ™ Cryptocurrency Prices
91
+
92
+ Get real-time crypto prices with the CoinGecko provider:
93
+
94
+ ```typescript
95
+ import { StockPriceService, CoinGeckoProvider } from '@fin.cx/opendata';
96
+
97
+ const stockService = new StockPriceService({ ttl: 30000 });
98
+
99
+ // Optional: Pass API key for higher rate limits
100
+ // const provider = new CoinGeckoProvider('your-api-key');
101
+ const provider = new CoinGeckoProvider();
102
+
103
+ stockService.register(provider);
104
+
105
+ // Fetch single crypto price (using ticker symbol)
106
+ const btc = await stockService.getPrice({ ticker: 'BTC' });
107
+ console.log(`${btc.ticker}: $${btc.price.toLocaleString()}`);
108
+ console.log(`24h Change: ${btc.changePercent.toFixed(2)}%`);
109
+ console.log(`24h Volume: $${btc.volume?.toLocaleString()}`);
110
+
111
+ // Or use CoinGecko ID directly
112
+ const ethereum = await stockService.getPrice({ ticker: 'ethereum' });
113
+
114
+ // Batch fetch multiple cryptos
115
+ const cryptos = await stockService.getPrices({
116
+ tickers: ['BTC', 'ETH', 'USDT', 'BNB', 'SOL']
117
+ });
118
+
119
+ cryptos.forEach(crypto => {
120
+ console.log(`${crypto.ticker}: $${crypto.price.toFixed(2)} (${crypto.changePercent >= 0 ? '+' : ''}${crypto.changePercent.toFixed(2)}%)`);
121
+ });
122
+
123
+ // Historical crypto prices
124
+ const history = await stockService.getData({
125
+ type: 'historical',
126
+ ticker: 'BTC',
127
+ from: new Date('2025-01-01'),
128
+ to: new Date('2025-01-31')
129
+ });
130
+
131
+ // Intraday crypto prices (hourly)
132
+ const intraday = await stockService.getData({
133
+ type: 'intraday',
134
+ ticker: 'ETH',
135
+ interval: '1hour',
136
+ limit: 24 // Last 24 hours
137
+ });
138
+ ```
139
+
90
140
  ### 💰 Fundamentals-Only Data (Alternative)
91
141
 
92
142
  If you only need fundamentals without prices:
@@ -149,9 +199,10 @@ const details = await openData.handelsregister.getSpecificCompany({
149
199
 
150
200
  ## Features
151
201
 
152
- ### 📊 Stock Market Module
202
+ ### 📊 Stock & Crypto Market Module
153
203
 
154
- - **Real-Time Prices** - Live and EOD stock prices from Yahoo Finance and Marketstack
204
+ - **Real-Time Prices** - Live and EOD prices from Yahoo Finance, Marketstack, and CoinGecko
205
+ - **Cryptocurrency Support** - 13M+ crypto tokens with 24/7 market data via CoinGecko
155
206
  - **Company Names** - Automatic company name extraction (e.g., "Apple Inc (NASDAQ:AAPL)")
156
207
  - **Historical Data** - Up to 15 years of daily EOD prices with pagination
157
208
  - **OHLCV Data** - Open, High, Low, Close, Volume for technical analysis
@@ -622,6 +673,15 @@ interface IStockFundamentals {
622
673
  - ✅ Company names included
623
674
  - âš ī¸ Rate limits may apply
624
675
 
676
+ **CoinGeckoProvider**
677
+ - ✅ Cryptocurrency prices (Bitcoin, Ethereum, 13M+ tokens)
678
+ - ✅ Current, historical, and intraday data
679
+ - ✅ 24/7 market data (crypto never closes)
680
+ - ✅ OHLCV data with market cap and volume
681
+ - ✅ Supports both ticker symbols (BTC, ETH) and CoinGecko IDs (bitcoin, ethereum)
682
+ - ✅ 240+ networks, 1600+ exchanges
683
+ - â„šī¸ Optional API key (free tier: 30 requests/min, 10K/month)
684
+
625
685
  **OpenData**
626
686
  - `start()` - Initialize MongoDB connection
627
687
  - `buildInitialDb()` - Import bulk data
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@fin.cx/opendata',
6
- version: '3.2.2',
6
+ version: '3.4.0',
7
7
  description: 'A comprehensive TypeScript library for accessing business data and real-time financial information. Features include German company data management with MongoDB integration, JSONL bulk processing, automated Handelsregister interactions, and real-time stock market data from multiple providers.'
8
8
  }
@@ -15,4 +15,5 @@ export * from './classes.baseproviderservice.js';
15
15
  // Export providers
16
16
  export * from './providers/provider.yahoo.js';
17
17
  export * from './providers/provider.marketstack.js';
18
- export * from './providers/provider.secedgar.js';
18
+ export * from './providers/provider.secedgar.js';
19
+ export * from './providers/provider.coingecko.js';