borsajs 0.1.4 → 0.1.5
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.en.md +58 -1
- package/README.md +64 -0
- package/package.json +2 -2
- package/test/demo.ts +31 -0
package/README.en.md
CHANGED
|
@@ -39,6 +39,8 @@ const cryptoList = await cryptoSymbols(); // → ['BTCTRY', 'ETHTRY', ...] (173
|
|
|
39
39
|
|
|
40
40
|
### Ticker (Stocks)
|
|
41
41
|
|
|
42
|
+
**Get real-time BIST stock prices and volume data in seconds.** The Ticker API provides instant access to current price, daily change, volume, and OHLC (Open-High-Low-Close) values for any stock. Perfect for technical analysis, portfolio tracking, or automated trading strategies.
|
|
43
|
+
|
|
42
44
|
```typescript
|
|
43
45
|
import { Ticker } from 'borsajs';
|
|
44
46
|
|
|
@@ -83,6 +85,8 @@ const history = await stock.getHistory({ period: '5d', interval: '1d' });
|
|
|
83
85
|
|
|
84
86
|
### FX (Forex & Commodities)
|
|
85
87
|
|
|
88
|
+
**Track live exchange rates and commodity prices effortlessly.** Access real-time data for major currencies (USD, EUR, GBP) and precious metals (gold, silver). Essential for currency arbitrage, gold investment strategies, or exchange rate monitoring.
|
|
89
|
+
|
|
86
90
|
```typescript
|
|
87
91
|
import { FX, fxSymbols } from 'borsajs';
|
|
88
92
|
|
|
@@ -107,6 +111,8 @@ const current = await usd.getCurrent();
|
|
|
107
111
|
|
|
108
112
|
### Crypto
|
|
109
113
|
|
|
114
|
+
**Live data from Turkey's largest crypto exchange, BtcTurk.** Access price, volume, and change information for 173 cryptocurrency pairs. The fastest way to track Bitcoin, Ethereum, and other cryptos in Turkish Lira.
|
|
115
|
+
|
|
110
116
|
```typescript
|
|
111
117
|
import { Crypto, cryptoSymbols } from 'borsajs';
|
|
112
118
|
|
|
@@ -136,6 +142,8 @@ const current = await btc.getCurrent();
|
|
|
136
142
|
|
|
137
143
|
### Index
|
|
138
144
|
|
|
145
|
+
**Monitor BIST indices in real-time.** Get current values and percentage changes for market and sector indices like XU100, XU030, XBANK. Essential for analyzing market trends and comparing sectoral performance.
|
|
146
|
+
|
|
139
147
|
```typescript
|
|
140
148
|
import { Index, indexSymbols } from 'borsajs';
|
|
141
149
|
|
|
@@ -163,6 +171,8 @@ const info = await xu100.getInfo();
|
|
|
163
171
|
|
|
164
172
|
### Fund (Investment Funds)
|
|
165
173
|
|
|
174
|
+
**Search and track Turkish investment funds from TEFAS.** Access fund prices, returns, and performance metrics. Compare funds and make informed investment decisions with official data.
|
|
175
|
+
|
|
166
176
|
```typescript
|
|
167
177
|
import { Fund, searchFunds } from 'borsajs';
|
|
168
178
|
|
|
@@ -186,6 +196,8 @@ const info = await fund.getInfo();
|
|
|
186
196
|
|
|
187
197
|
### Inflation
|
|
188
198
|
|
|
199
|
+
**Access official inflation data directly from TCMB (Central Bank).** Query monthly and annual CPI rates, or calculate inflation between any two dates. Critical for evaluating investments on a real return basis.
|
|
200
|
+
|
|
189
201
|
```typescript
|
|
190
202
|
import { Inflation } from 'borsajs';
|
|
191
203
|
|
|
@@ -220,6 +232,14 @@ const calc = await inflation.calculate(100000, '2020-01', '2024-01');
|
|
|
220
232
|
|
|
221
233
|
### KAP (Public Disclosure Platform)
|
|
222
234
|
|
|
235
|
+
**One-stop access to official company announcements and disclosures.** Query disclosures, expected report calendars, and corporate information for all 731 BIST companies. Make investment decisions based on official company statements.
|
|
236
|
+
|
|
237
|
+
**Features:**
|
|
238
|
+
- 🏢 **731 BIST Companies** - Complete list with details
|
|
239
|
+
- 📢 **Live Disclosures** - All company announcements
|
|
240
|
+
- 📅 **Disclosure Calendar** - Financial report dates
|
|
241
|
+
- 🏛️ **Corporate Info** - Sector, market, website
|
|
242
|
+
|
|
223
243
|
```typescript
|
|
224
244
|
import { getKapProvider } from 'borsajs';
|
|
225
245
|
|
|
@@ -301,6 +321,8 @@ const details = await kap.getCompanyDetails('THYAO');
|
|
|
301
321
|
|
|
302
322
|
### Symbols
|
|
303
323
|
|
|
324
|
+
**Access all market symbols in a single call.** Get comprehensive lists of stocks, cryptocurrencies, currencies, and indices. Perfect starting point for automated data collection or screening algorithms.
|
|
325
|
+
|
|
304
326
|
```typescript
|
|
305
327
|
import { symbols, searchSymbols, cryptoSymbols, fxSymbols, indexSymbols } from 'borsajs';
|
|
306
328
|
|
|
@@ -320,17 +342,52 @@ console.log(indexSymbols); // → 19 indices
|
|
|
320
342
|
|
|
321
343
|
### VIOP (Derivatives)
|
|
322
344
|
|
|
345
|
+
**Track Turkish derivatives market (futures and options).** Access real-time data for stock futures, index futures, currency futures, and options contracts. Essential for hedging strategies and derivatives trading.
|
|
346
|
+
|
|
323
347
|
```typescript
|
|
324
348
|
import { VIOP } from 'borsajs';
|
|
325
349
|
|
|
326
350
|
const viop = new VIOP();
|
|
351
|
+
|
|
352
|
+
// Get all futures
|
|
327
353
|
const futures = await viop.getFutures();
|
|
354
|
+
|
|
355
|
+
// Stock futures
|
|
356
|
+
const stockFutures = await viop.getStockFutures();
|
|
357
|
+
|
|
358
|
+
// Index futures (XU100, XU030, etc.)
|
|
359
|
+
const indexFutures = await viop.getIndexFutures();
|
|
360
|
+
|
|
361
|
+
// Currency futures (USD, EUR)
|
|
362
|
+
const currencyFutures = await viop.getCurrencyFutures();
|
|
363
|
+
|
|
364
|
+
// Commodity futures (Gold)
|
|
365
|
+
const commodityFutures = await viop.getCommodityFutures();
|
|
366
|
+
|
|
367
|
+
// Options
|
|
328
368
|
const options = await viop.getOptions();
|
|
329
|
-
|
|
369
|
+
|
|
370
|
+
// Contracts for specific stock
|
|
371
|
+
const thyaoContracts = await viop.getBySymbol('THYAO');
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**Response (Contract Data):**
|
|
375
|
+
```json
|
|
376
|
+
{
|
|
377
|
+
"code": "THYAO",
|
|
378
|
+
"contract": "THYAO0226",
|
|
379
|
+
"price": 275.5,
|
|
380
|
+
"change": 1.25,
|
|
381
|
+
"volumeTl": 15420000,
|
|
382
|
+
"volumeQty": 56000,
|
|
383
|
+
"category": "stock"
|
|
384
|
+
}
|
|
330
385
|
```
|
|
331
386
|
|
|
332
387
|
### Download (Multiple Tickers)
|
|
333
388
|
|
|
389
|
+
**Batch download historical data for multiple stocks at once.** Efficient way to collect OHLCV data for portfolio analysis or backtesting strategies. Get data for dozens of stocks in a single request.
|
|
390
|
+
|
|
334
391
|
```typescript
|
|
335
392
|
import { download, Tickers } from 'borsajs';
|
|
336
393
|
|
package/README.md
CHANGED
|
@@ -39,6 +39,8 @@ const cryptoList = await cryptoSymbols(); // → ['BTCTRY', 'ETHTRY', ...] (173
|
|
|
39
39
|
|
|
40
40
|
### Ticker (Hisse Senedi)
|
|
41
41
|
|
|
42
|
+
**BIST hisselerinin anlık fiyat ve hacim verilerine saniyeler içinde ulaşın.** Ticker API, bir hisse senedinin güncel fiyatı, günlük değişimi, işlem hacmi ve OHLC (açılış-en yüksek-en düşük-kapanış) değerlerini kolayca almanızı sağlar. Teknik analiz, portföy takibi veya otomatik alım-satım stratejileri için ideal.
|
|
43
|
+
|
|
42
44
|
```typescript
|
|
43
45
|
import { Ticker } from 'borsajs';
|
|
44
46
|
|
|
@@ -65,6 +67,8 @@ const info = await stock.getInfo();
|
|
|
65
67
|
|
|
66
68
|
### FX (Döviz & Emtia)
|
|
67
69
|
|
|
70
|
+
**Döviz kurları ve emtia fiyatlarını canlı takip edin.** FX API ile USD, EUR gibi döviz kurlarının yanı sıra altın, gümüş ve ons fiyatlarına anında erişebilirsiniz. Kur takibi, döviz arbitrajı veya altın yatırım stratejileri için güvenilir veri kaynağı.
|
|
71
|
+
|
|
68
72
|
```typescript
|
|
69
73
|
import { FX, fxSymbols } from 'borsajs';
|
|
70
74
|
|
|
@@ -89,6 +93,8 @@ const current = await usd.getCurrent();
|
|
|
89
93
|
|
|
90
94
|
### Crypto (Kripto Para)
|
|
91
95
|
|
|
96
|
+
**Türkiye'nin en büyük kripto borsası BtcTurk'ten anlık veriler.** 173 kripto para çiftinin fiyat, hacim ve değişim bilgilerine erişin. Bitcoin, Ethereum ve diğer kripto paraların TRY karşılığını takip etmek için en hızlı yol.
|
|
97
|
+
|
|
92
98
|
```typescript
|
|
93
99
|
import { Crypto, cryptoSymbols } from 'borsajs';
|
|
94
100
|
|
|
@@ -118,6 +124,8 @@ const current = await btc.getCurrent();
|
|
|
118
124
|
|
|
119
125
|
### Index (Endeksler)
|
|
120
126
|
|
|
127
|
+
**BIST endekslerini gerçek zamanlı izleyin.** XU100, XU030, XBANK gibi sektör ve piyasa endekslerinin güncel değerleri ve yüzdesel değişimlerini alın. Piyasa trendlerini analiz etmek ve sektörel performansı karşılaştırmak için vazgeçilmez.
|
|
128
|
+
|
|
121
129
|
```typescript
|
|
122
130
|
import { Index, indexSymbols } from 'borsajs';
|
|
123
131
|
|
|
@@ -145,6 +153,8 @@ const info = await xu100.getInfo();
|
|
|
145
153
|
|
|
146
154
|
### Inflation (Enflasyon)
|
|
147
155
|
|
|
156
|
+
**TCMB'nin resmi enflasyon verilerine doğrudan erişin.** Aylık ve yıllık TÜFE oranlarını sorgulayın veya geçmiş tarihler arasında enflasyon hesaplayın. Yatırım kararlarınızı reel getiri bazında değerlendirmek için kritik.
|
|
157
|
+
|
|
148
158
|
```typescript
|
|
149
159
|
import { Inflation } from 'borsajs';
|
|
150
160
|
|
|
@@ -179,6 +189,14 @@ const calc = await inflation.calculate(100000, '2020-01', '2024-01');
|
|
|
179
189
|
|
|
180
190
|
### KAP (Kamu Aydınlatma Platformu)
|
|
181
191
|
|
|
192
|
+
**Şirketlerin resmi açıklamalarına ve bildirimlerine tek noktadan ulaşın.** KAP API ile 731 BIST şirketinin bildirimlerini, beklenen rapor takvimlerini ve kurumsal bilgilerini sorgulayabilirsiniz. Yatırım kararlarınızı şirketlerin resmi açıklamaları ışığında alın.
|
|
193
|
+
|
|
194
|
+
**Özellikler:**
|
|
195
|
+
- 🏢 **731 BIST şirketi** - Tüm halka açık şirketlerin listesi ve bilgileri
|
|
196
|
+
- 📢 **Anlık Bildirimler** - Şirketlerin KAP'a yaptığı tüm açıklamalar
|
|
197
|
+
- 📅 **Bildirim Takvimi** - Finansal rapor ve açıklama tarihleri
|
|
198
|
+
- 🏛️ **Kurumsal Bilgiler** - Sektör, pazar, web sitesi bilgileri
|
|
199
|
+
|
|
182
200
|
```typescript
|
|
183
201
|
import { getKapProvider } from 'borsajs';
|
|
184
202
|
|
|
@@ -258,8 +276,54 @@ const details = await kap.getCompanyDetails('THYAO');
|
|
|
258
276
|
}
|
|
259
277
|
```
|
|
260
278
|
|
|
279
|
+
### VIOP (Vadeli İşlem ve Opsiyon Piyasası)
|
|
280
|
+
|
|
281
|
+
**Türk türev piyasasını gerçek zamanlı takip edin.** Hisse senedi vadeli işlemleri, endeks vadeli işlemleri, döviz ve emtia kontratlarına anında erişin. Riskten korunma (hedging) stratejileri ve türev ürün ticareti için vazgeçilmez.
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
import { VIOP } from 'borsajs';
|
|
285
|
+
|
|
286
|
+
const viop = new VIOP();
|
|
287
|
+
|
|
288
|
+
// Tüm vadeli işlemleri al
|
|
289
|
+
const futures = await viop.getFutures();
|
|
290
|
+
|
|
291
|
+
// Hisse senedi vadeli işlemleri
|
|
292
|
+
const stockFutures = await viop.getStockFutures();
|
|
293
|
+
|
|
294
|
+
// Endeks vadeli işlemleri
|
|
295
|
+
const indexFutures = await viop.getIndexFutures();
|
|
296
|
+
|
|
297
|
+
// Döviz vadeli işlemleri
|
|
298
|
+
const currencyFutures = await viop.getCurrencyFutures();
|
|
299
|
+
|
|
300
|
+
// Emtia vadeli işlemleri
|
|
301
|
+
const commodityFutures = await viop.getCommodityFutures();
|
|
302
|
+
|
|
303
|
+
// Opsiyonlar
|
|
304
|
+
const options = await viop.getOptions();
|
|
305
|
+
|
|
306
|
+
// Belirli bir hisse için kontratlar
|
|
307
|
+
const thyaoContracts = await viop.getBySymbol('THYAO');
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Response (Contract Data):**
|
|
311
|
+
```json
|
|
312
|
+
{
|
|
313
|
+
"code": "THYAO",
|
|
314
|
+
"contract": "THYAO0226",
|
|
315
|
+
"price": 275.5,
|
|
316
|
+
"change": 1.25,
|
|
317
|
+
"volumeTl": 15420000,
|
|
318
|
+
"volumeQty": 56000,
|
|
319
|
+
"category": "stock"
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
261
323
|
### Symbols (Sembol Listeleri)
|
|
262
324
|
|
|
325
|
+
**Tüm piyasa sembollerine tek çağrıda erişin.** Hisse senetleri, kripto paralar, dövizler ve endekslerin sembol listelerini alın. Otomatik veri çekme veya tarama algoritmaları için mükemmel başlangıç noktası.
|
|
326
|
+
|
|
263
327
|
```typescript
|
|
264
328
|
import { symbols, searchSymbols, cryptoSymbols, fxSymbols, indexSymbols } from 'borsajs';
|
|
265
329
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "borsajs",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Türkiye financial markets data library, BIST stocks, KAP,VIOP, forex, crypto, investment funds, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
package/test/demo.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Inflation } from '../src/inflation.js';
|
|
|
10
10
|
import { Ticker } from '../src/ticker.js';
|
|
11
11
|
import { symbols, searchSymbols, cryptoSymbols, fxSymbols, indexSymbols } from '../src/market.js';
|
|
12
12
|
import { getKapProvider } from '../src/providers/kap.js';
|
|
13
|
+
import { VIOP } from '../src/viop.js';
|
|
13
14
|
|
|
14
15
|
async function testCrypto() {
|
|
15
16
|
console.log('\n🪙 CRYPTO (BtcTurk)');
|
|
@@ -152,6 +153,35 @@ async function testKap() {
|
|
|
152
153
|
} catch (error) { console.error('Error:', error); }
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
async function testViop() {
|
|
157
|
+
console.log('\n📊 VIOP (Derivatives Market)');
|
|
158
|
+
console.log('─'.repeat(60));
|
|
159
|
+
try {
|
|
160
|
+
const viop = new VIOP();
|
|
161
|
+
|
|
162
|
+
// Test stock futures
|
|
163
|
+
const stockFutures = await viop.getStockFutures();
|
|
164
|
+
console.log(`Stock Futures: ${stockFutures.length} contracts`);
|
|
165
|
+
if (stockFutures.length > 0) {
|
|
166
|
+
console.log('Sample:', JSON.stringify(stockFutures.slice(0, 2), null, 2));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Test index futures
|
|
170
|
+
const indexFutures = await viop.getIndexFutures();
|
|
171
|
+
console.log(`\nIndex Futures: ${indexFutures.length} contracts`);
|
|
172
|
+
if (indexFutures.length > 0) {
|
|
173
|
+
console.log('Sample:', JSON.stringify(indexFutures.slice(0, 2), null, 2));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Test by symbol
|
|
177
|
+
const thyaoContracts = await viop.getBySymbol('THYAO');
|
|
178
|
+
console.log(`\nTHYAO Contracts: ${thyaoContracts.length}`);
|
|
179
|
+
if (thyaoContracts.length > 0) {
|
|
180
|
+
console.log('First:', JSON.stringify(thyaoContracts[0], null, 2));
|
|
181
|
+
}
|
|
182
|
+
} catch (error) { console.error('Error:', error); }
|
|
183
|
+
}
|
|
184
|
+
|
|
155
185
|
async function main() {
|
|
156
186
|
console.log('🚀 borsajs API Test');
|
|
157
187
|
console.log('═'.repeat(60));
|
|
@@ -164,6 +194,7 @@ async function main() {
|
|
|
164
194
|
await testInflation();
|
|
165
195
|
await testSymbols();
|
|
166
196
|
await testKap();
|
|
197
|
+
await testViop();
|
|
167
198
|
|
|
168
199
|
console.log('\n' + '═'.repeat(60));
|
|
169
200
|
console.log('✅ All tests completed!');
|