@axionquant/sdk 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +84 -82
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axionquant/sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Axion SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -5,7 +5,7 @@ A TypeScript/JavaScript SDK for the Axion financial data API.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install axion-sdk
8
+ npm install @axionquant/sdk
9
9
  ```
10
10
 
11
11
  ## Quick Start
@@ -17,7 +17,7 @@ import { Axion } from 'axion-sdk';
17
17
  const client = new Axion('your-api-key');
18
18
 
19
19
  // Get stock price data
20
- const prices = await client.getStockPrices('AAPL', {
20
+ const prices = await client.stocks.prices('AAPL', {
21
21
  from: '2024-01-01',
22
22
  to: '2024-12-31'
23
23
  });
@@ -43,56 +43,56 @@ const client = new Axion();
43
43
 
44
44
  ```typescript
45
45
  // Search for credit entities
46
- await client.searchCredit('Apple Inc');
46
+ await client.credit.search('Apple Inc');
47
47
 
48
48
  // Get credit ratings for an entity
49
- await client.getCreditRatings('entity-id');
49
+ await client.credit.ratings('entity-id');
50
50
  ```
51
51
 
52
52
  ### ESG
53
53
 
54
54
  ```typescript
55
55
  // Get ESG data for a stock
56
- await client.getEsgData('AAPL');
56
+ await client.esg.data('AAPL');
57
57
  ```
58
58
 
59
59
  ### ETFs
60
60
 
61
61
  ```typescript
62
62
  // Get ETF fund data
63
- await client.getEtfFundData('SPY');
63
+ await client.etfs.fund('SPY');
64
64
 
65
65
  // Get ETF holdings
66
- await client.getEtfHoldings('SPY');
66
+ await client.etfs.holdings('SPY');
67
67
 
68
68
  // Get ETF exposure data
69
- await client.getEtfExposure('SPY');
69
+ await client.etfs.exposure('SPY');
70
70
  ```
71
71
 
72
72
  ### Supply Chain
73
73
 
74
74
  ```typescript
75
75
  // Get company customers
76
- await client.getSupplyChainCustomers('AAPL');
76
+ await client.supplyChain.customers('AAPL');
77
77
 
78
78
  // Get company peers
79
- await client.getSupplyChainPeers('AAPL');
79
+ await client.supplyChain.peers('AAPL');
80
80
 
81
81
  // Get company suppliers
82
- await client.getSupplyChainSuppliers('AAPL');
82
+ await client.supplyChain.suppliers('AAPL');
83
83
  ```
84
84
 
85
85
  ### Stocks
86
86
 
87
87
  ```typescript
88
88
  // Get all stock tickers
89
- await client.getStockTickers({ country: 'US', exchange: 'NASDAQ' });
89
+ await client.stocks.tickers({ country: 'US', exchange: 'NASDAQ' });
90
90
 
91
91
  // Get ticker information
92
- await client.getStockTickerBySymbol('AAPL');
92
+ await client.stocks.ticker('AAPL');
93
93
 
94
94
  // Get historical prices
95
- await client.getStockPrices('AAPL', {
95
+ await client.stocks.prices('AAPL', {
96
96
  from: '2024-01-01',
97
97
  to: '2024-12-31',
98
98
  frame: '1d' // daily
@@ -103,13 +103,13 @@ await client.getStockPrices('AAPL', {
103
103
 
104
104
  ```typescript
105
105
  // Get all crypto tickers
106
- await client.getCryptoTickers({ type: 'coin' });
106
+ await client.crypto.tickers({ type: 'coin' });
107
107
 
108
108
  // Get crypto ticker information
109
- await client.getCryptoTickerBySymbol('BTC');
109
+ await client.crypto.ticker('BTC');
110
110
 
111
111
  // Get crypto prices
112
- await client.getCryptoPrices('BTC', {
112
+ await client.crypto.prices('BTC', {
113
113
  from: '2024-01-01',
114
114
  to: '2024-12-31',
115
115
  frame: '1h'
@@ -120,13 +120,13 @@ await client.getCryptoPrices('BTC', {
120
120
 
121
121
  ```typescript
122
122
  // Get forex tickers
123
- await client.getForexTickers({ country: 'US' });
123
+ await client.forex.tickers({ country: 'US' });
124
124
 
125
125
  // Get forex ticker information
126
- await client.getForexTickerBySymbol('EURUSD');
126
+ await client.forex.ticker('EURUSD');
127
127
 
128
128
  // Get forex prices
129
- await client.getForexPrices('EURUSD', {
129
+ await client.forex.prices('EURUSD', {
130
130
  from: '2024-01-01',
131
131
  to: '2024-12-31'
132
132
  });
@@ -136,13 +136,13 @@ await client.getForexPrices('EURUSD', {
136
136
 
137
137
  ```typescript
138
138
  // Get futures tickers
139
- await client.getFuturesTickers({ exchange: 'CME' });
139
+ await client.futures.tickers({ exchange: 'CME' });
140
140
 
141
141
  // Get futures ticker information
142
- await client.getFuturesTickerBySymbol('ES');
142
+ await client.futures.ticker('ES');
143
143
 
144
144
  // Get futures prices
145
- await client.getFuturesPrices('ES', {
145
+ await client.futures.prices('ES', {
146
146
  from: '2024-01-01',
147
147
  to: '2024-12-31'
148
148
  });
@@ -152,13 +152,13 @@ await client.getFuturesPrices('ES', {
152
152
 
153
153
  ```typescript
154
154
  // Get index tickers
155
- await client.getIndexTickers({ exchange: 'NYSE' });
155
+ await client.indices.tickers({ exchange: 'NYSE' });
156
156
 
157
157
  // Get index ticker information
158
- await client.getIndexTickerBySymbol('SPX');
158
+ await client.indices.ticker('SPX');
159
159
 
160
160
  // Get index prices
161
- await client.getIndexPrices('SPX', {
161
+ await client.indices.prices('SPX', {
162
162
  from: '2024-01-01',
163
163
  to: '2024-12-31'
164
164
  });
@@ -168,92 +168,94 @@ await client.getIndexPrices('SPX', {
168
168
 
169
169
  ```typescript
170
170
  // Search for economic datasets
171
- await client.searchEcon('unemployment rate');
171
+ await client.econ.search('unemployment rate');
172
172
 
173
173
  // Get economic dataset
174
- await client.getEconDataset('UNRATE');
174
+ await client.econ.dataset('UNRATE');
175
175
 
176
176
  // Get economic calendar
177
- await client.getEconCalendar({
177
+ await client.econ.calendar({
178
178
  from: '2024-01-01',
179
179
  to: '2024-12-31',
180
180
  country: 'US',
181
- minImportance: 3
181
+ minImportance: 3,
182
+ currency: 'USD',
183
+ category: 'employment'
182
184
  });
183
185
  ```
184
186
 
185
- ### Company Profiles
187
+ ### News
186
188
 
187
189
  ```typescript
188
- // Asset profile
189
- await client.getStockAsset('AAPL');
190
+ // Get latest general news
191
+ await client.news.general();
190
192
 
191
- // Recommendations
192
- await client.getStockRecommendation('AAPL');
193
+ // Get company-specific news
194
+ await client.news.company('AAPL');
193
195
 
194
- // Financial statements
195
- await client.getStockCashflow('AAPL');
196
- await client.getStockIncome('AAPL');
197
- await client.getStockBalancesheet('AAPL');
198
- await client.getStockFinancials('AAPL');
196
+ // Get country news
197
+ await client.news.country('US');
199
198
 
200
- // Company statistics
201
- await client.getStockStatistics('AAPL');
202
- await client.getStockSummary('AAPL');
203
- await client.getStockInfo('AAPL');
199
+ // Get category news
200
+ await client.news.category('technology');
201
+ ```
204
202
 
205
- // Ownership and holders
206
- await client.getStockFund('AAPL');
207
- await client.getStockInsiders('AAPL');
208
- await client.getStockInstitution('AAPL');
209
- await client.getStockOwnership('AAPL');
203
+ ### Sentiment
210
204
 
211
- // Earnings and trends
212
- await client.getStockEarnings('AAPL');
213
- await client.getStockTrendEarnings('AAPL');
214
- await client.getStockTrendIndex('AAPL');
205
+ ```typescript
206
+ // Get all sentiment data
207
+ await client.sentiment.all('AAPL');
215
208
 
216
- // Insider activity
217
- await client.getStockActivity('AAPL');
218
- await client.getStockTransactions('AAPL');
209
+ // Get social media sentiment
210
+ await client.sentiment.social('AAPL');
219
211
 
220
- // Calendar events
221
- await client.getStockCalendar('AAPL');
212
+ // Get news sentiment
213
+ await client.sentiment.news('AAPL');
222
214
 
223
- // Web traffic
224
- await client.getStockTraffic('AAPL');
215
+ // Get analyst sentiment
216
+ await client.sentiment.analyst('AAPL');
225
217
  ```
226
218
 
227
- ### News
219
+ ### Company Profiles
228
220
 
229
221
  ```typescript
230
- // Get latest news
231
- await client.getNews();
222
+ // Asset profile
223
+ await client.profiles.asset('AAPL');
232
224
 
233
- // Get company-specific news
234
- await client.getCompanyNews('AAPL');
225
+ // Recommendations
226
+ await client.profiles.recommendation('AAPL');
235
227
 
236
- // Get country news
237
- await client.getCountryNews('US');
228
+ // Financial statements
229
+ await client.profiles.cashflow('AAPL');
230
+ await client.profiles.income('AAPL');
231
+ await client.profiles.balancesheet('AAPL');
232
+ await client.profiles.financials('AAPL');
238
233
 
239
- // Get category news
240
- await client.getCategoryNews('technology');
241
- ```
234
+ // Company statistics
235
+ await client.profiles.statistics('AAPL');
236
+ await client.profiles.summary('AAPL');
237
+ await client.profiles.info('AAPL');
242
238
 
243
- ### Sentiment
239
+ // Ownership and holders
240
+ await client.profiles.fund('AAPL');
241
+ await client.profiles.insiders('AAPL');
242
+ await client.profiles.institutionOwnership('AAPL');
243
+ await client.profiles.ownership('AAPL');
244
244
 
245
- ```typescript
246
- // Get all sentiment data
247
- await client.getSentimentAll('AAPL');
245
+ // Earnings and trends
246
+ await client.profiles.earnings('AAPL');
247
+ await client.profiles.earningsTrend('AAPL');
248
+ await client.profiles.indexTrend('AAPL');
248
249
 
249
- // Get social media sentiment
250
- await client.getSentimentSocial('AAPL');
250
+ // Insider activity
251
+ await client.profiles.activity('AAPL');
252
+ await client.profiles.transactions('AAPL');
251
253
 
252
- // Get news sentiment
253
- await client.getSentimentNews('AAPL');
254
+ // Calendar events
255
+ await client.profiles.calendar('AAPL');
254
256
 
255
- // Get analyst sentiment
256
- await client.getSentimentAnalyst('AAPL');
257
+ // Web traffic
258
+ await client.profiles.traffic('AAPL');
257
259
  ```
258
260
 
259
261
  ## Error Handling
@@ -262,7 +264,7 @@ The SDK throws errors for failed requests. Use try-catch blocks to handle them:
262
264
 
263
265
  ```typescript
264
266
  try {
265
- const data = await client.getStockPrices('AAPL');
267
+ const data = await client.stocks.prices('AAPL');
266
268
  console.log(data);
267
269
  } catch (error) {
268
270
  console.error('Error fetching data:', error.message);
@@ -279,4 +281,4 @@ import { Axion, ApiResponse } from 'axion-sdk';
279
281
 
280
282
  ## Base URL
281
283
 
282
- By default, the SDK connects to `http://localhost:3001`. To use a different base URL, modify the `BASE_URL` constant in the source code.
284
+ By default, the SDK connects to `https://api.axionquant.com`. To use a different base URL, modify the `BASE_URL` constant in the source code.