update readme

This commit is contained in:
2025-11-07 12:52:45 +00:00
parent 3be2f0b855
commit adf0afe3c6
2 changed files with 8 additions and 21 deletions

1
CLAUDE.md Normal file
View File

@@ -0,0 +1 @@
Read .nogit/CLAUDE.md

View File

@@ -19,13 +19,12 @@ pnpm add @fin.cx/opendata
Get complete stock data with automatic enrichment - the elegant way:
```typescript
import { StockDataService, YahooFinanceProvider, SecEdgarProvider } from '@fin.cx/opendata';
import { StockDataService, SecEdgarProvider } from '@fin.cx/opendata';
// Initialize unified service
const stockData = new StockDataService();
// Register providers
stockData.registerPriceProvider(new YahooFinanceProvider());
stockData.registerFundamentalsProvider(new SecEdgarProvider({
userAgent: 'YourCompany youremail@example.com'
}));
@@ -68,10 +67,10 @@ stocks.forEach(stock => {
If you only need prices without fundamentals:
```typescript
import { StockDataService, YahooFinanceProvider } from '@fin.cx/opendata';
import { StockDataService, MarketstackProvider } from '@fin.cx/opendata';
const stockData = new StockDataService();
stockData.registerPriceProvider(new YahooFinanceProvider());
stockData.registerPriceProvider(new MarketstackProvider('YOUR_API_KEY'));
// Get just the price
const price = await stockData.getPrice('AAPL');
@@ -81,7 +80,7 @@ console.log(`${price.ticker}: $${price.price}`);
import { StockPriceService } from '@fin.cx/opendata';
const stockService = new StockPriceService({ ttl: 60000 });
stockService.register(new YahooFinanceProvider());
stockService.register(new MarketstackProvider('YOUR_API_KEY'));
const apple = await stockService.getData({ type: 'current', ticker: 'AAPL' });
console.log(`${apple.companyFullName}: $${apple.price}`);
@@ -201,7 +200,7 @@ const details = await openData.handelsregister.getSpecificCompany({
### 📊 Stock & Crypto Market Module
- **Real-Time Prices** - Live and EOD prices from Yahoo Finance, Marketstack, and CoinGecko
- **Real-Time Prices** - Live and EOD prices from Marketstack and CoinGecko
- **Cryptocurrency Support** - 13M+ crypto tokens with 24/7 market data via CoinGecko
- **Company Names** - Automatic company name extraction (e.g., "Apple Inc (NASDAQ:AAPL)")
- **Historical Data** - Up to 15 years of daily EOD prices with pagination
@@ -238,11 +237,11 @@ const details = await openData.handelsregister.getSpecificCompany({
Analyze multiple companies with automatic enrichment:
```typescript
import { StockDataService, YahooFinanceProvider, SecEdgarProvider } from '@fin.cx/opendata';
import { StockDataService, MarketstackProvider, SecEdgarProvider } from '@fin.cx/opendata';
// Setup unified service
const stockData = new StockDataService();
stockData.registerPriceProvider(new YahooFinanceProvider());
stockData.registerPriceProvider(new MarketstackProvider('YOUR_API_KEY'));
stockData.registerFundamentalsProvider(new SecEdgarProvider({
userAgent: 'YourCompany youremail@example.com'
}));
@@ -487,12 +486,6 @@ stockService.register(new MarketstackProvider('YOUR_API_KEY'), {
retryAttempts: 3,
retryDelay: 1000
});
// Yahoo Finance - Real-time data (no API key)
stockService.register(new YahooFinanceProvider(), {
enabled: true,
priority: 50
});
```
### Fundamentals Service Options
@@ -666,13 +659,6 @@ interface IStockFundamentals {
- ✅ Company names included automatically
- ⚠️ Requires API key (free tier: 100 requests/month)
**YahooFinanceProvider**
- ✅ Real-time stock prices
- ✅ No API key required
- ✅ Global coverage
- ✅ Company names included
- ⚠️ Rate limits may apply
**CoinGeckoProvider**
- ✅ Cryptocurrency prices (Bitcoin, Ethereum, 13M+ tokens)
- ✅ Current, historical, and intraday data