@axionquant/sdk 1.0.1 → 1.0.3
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/package.json +1 -1
- package/readme.md +86 -84
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -5,19 +5,19 @@ A TypeScript/JavaScript SDK for the Axion financial data API.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install @axionquant/sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Axion } from '
|
|
14
|
+
import { Axion } from '@axionquant/sdk';
|
|
15
15
|
|
|
16
16
|
// Initialize with API key
|
|
17
17
|
const client = new Axion('your-api-key');
|
|
18
18
|
|
|
19
19
|
// Get stock price data
|
|
20
|
-
const prices = await client.
|
|
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.
|
|
46
|
+
await client.credit.search('Apple Inc');
|
|
47
47
|
|
|
48
48
|
// Get credit ratings for an entity
|
|
49
|
-
await client.
|
|
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.
|
|
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.
|
|
63
|
+
await client.etfs.fund('SPY');
|
|
64
64
|
|
|
65
65
|
// Get ETF holdings
|
|
66
|
-
await client.
|
|
66
|
+
await client.etfs.holdings('SPY');
|
|
67
67
|
|
|
68
68
|
// Get ETF exposure data
|
|
69
|
-
await client.
|
|
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.
|
|
76
|
+
await client.supplyChain.customers('AAPL');
|
|
77
77
|
|
|
78
78
|
// Get company peers
|
|
79
|
-
await client.
|
|
79
|
+
await client.supplyChain.peers('AAPL');
|
|
80
80
|
|
|
81
81
|
// Get company suppliers
|
|
82
|
-
await client.
|
|
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.
|
|
89
|
+
await client.stocks.tickers({ country: 'US', exchange: 'NASDAQ' });
|
|
90
90
|
|
|
91
91
|
// Get ticker information
|
|
92
|
-
await client.
|
|
92
|
+
await client.stocks.ticker('AAPL');
|
|
93
93
|
|
|
94
94
|
// Get historical prices
|
|
95
|
-
await client.
|
|
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.
|
|
106
|
+
await client.crypto.tickers({ type: 'coin' });
|
|
107
107
|
|
|
108
108
|
// Get crypto ticker information
|
|
109
|
-
await client.
|
|
109
|
+
await client.crypto.ticker('BTC');
|
|
110
110
|
|
|
111
111
|
// Get crypto prices
|
|
112
|
-
await client.
|
|
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.
|
|
123
|
+
await client.forex.tickers({ country: 'US' });
|
|
124
124
|
|
|
125
125
|
// Get forex ticker information
|
|
126
|
-
await client.
|
|
126
|
+
await client.forex.ticker('EURUSD');
|
|
127
127
|
|
|
128
128
|
// Get forex prices
|
|
129
|
-
await client.
|
|
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.
|
|
139
|
+
await client.futures.tickers({ exchange: 'CME' });
|
|
140
140
|
|
|
141
141
|
// Get futures ticker information
|
|
142
|
-
await client.
|
|
142
|
+
await client.futures.ticker('ES');
|
|
143
143
|
|
|
144
144
|
// Get futures prices
|
|
145
|
-
await client.
|
|
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.
|
|
155
|
+
await client.indices.tickers({ exchange: 'NYSE' });
|
|
156
156
|
|
|
157
157
|
// Get index ticker information
|
|
158
|
-
await client.
|
|
158
|
+
await client.indices.ticker('SPX');
|
|
159
159
|
|
|
160
160
|
// Get index prices
|
|
161
|
-
await client.
|
|
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.
|
|
171
|
+
await client.econ.search('unemployment rate');
|
|
172
172
|
|
|
173
173
|
// Get economic dataset
|
|
174
|
-
await client.
|
|
174
|
+
await client.econ.dataset('UNRATE');
|
|
175
175
|
|
|
176
176
|
// Get economic calendar
|
|
177
|
-
await client.
|
|
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
|
-
###
|
|
187
|
+
### News
|
|
186
188
|
|
|
187
189
|
```typescript
|
|
188
|
-
//
|
|
189
|
-
await client.
|
|
190
|
+
// Get latest general news
|
|
191
|
+
await client.news.general();
|
|
190
192
|
|
|
191
|
-
//
|
|
192
|
-
await client.
|
|
193
|
+
// Get company-specific news
|
|
194
|
+
await client.news.company('AAPL');
|
|
193
195
|
|
|
194
|
-
//
|
|
195
|
-
await client.
|
|
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
|
-
//
|
|
201
|
-
await client.
|
|
202
|
-
|
|
203
|
-
await client.getStockInfo('AAPL');
|
|
199
|
+
// Get category news
|
|
200
|
+
await client.news.category('technology');
|
|
201
|
+
```
|
|
204
202
|
|
|
205
|
-
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
await client.
|
|
214
|
-
await client.getStockTrendIndex('AAPL');
|
|
205
|
+
```typescript
|
|
206
|
+
// Get all sentiment data
|
|
207
|
+
await client.sentiment.all('AAPL');
|
|
215
208
|
|
|
216
|
-
//
|
|
217
|
-
await client.
|
|
218
|
-
await client.getStockTransactions('AAPL');
|
|
209
|
+
// Get social media sentiment
|
|
210
|
+
await client.sentiment.social('AAPL');
|
|
219
211
|
|
|
220
|
-
//
|
|
221
|
-
await client.
|
|
212
|
+
// Get news sentiment
|
|
213
|
+
await client.sentiment.news('AAPL');
|
|
222
214
|
|
|
223
|
-
//
|
|
224
|
-
await client.
|
|
215
|
+
// Get analyst sentiment
|
|
216
|
+
await client.sentiment.analyst('AAPL');
|
|
225
217
|
```
|
|
226
218
|
|
|
227
|
-
###
|
|
219
|
+
### Company Profiles
|
|
228
220
|
|
|
229
221
|
```typescript
|
|
230
|
-
//
|
|
231
|
-
await client.
|
|
222
|
+
// Asset profile
|
|
223
|
+
await client.profiles.asset('AAPL');
|
|
232
224
|
|
|
233
|
-
//
|
|
234
|
-
await client.
|
|
225
|
+
// Recommendations
|
|
226
|
+
await client.profiles.recommendation('AAPL');
|
|
235
227
|
|
|
236
|
-
//
|
|
237
|
-
await client.
|
|
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
|
-
//
|
|
240
|
-
await client.
|
|
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
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
await client.
|
|
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
|
-
//
|
|
250
|
-
await client.
|
|
250
|
+
// Insider activity
|
|
251
|
+
await client.profiles.activity('AAPL');
|
|
252
|
+
await client.profiles.transactions('AAPL');
|
|
251
253
|
|
|
252
|
-
//
|
|
253
|
-
await client.
|
|
254
|
+
// Calendar events
|
|
255
|
+
await client.profiles.calendar('AAPL');
|
|
254
256
|
|
|
255
|
-
//
|
|
256
|
-
await client.
|
|
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.
|
|
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);
|
|
@@ -274,9 +276,9 @@ try {
|
|
|
274
276
|
This SDK is written in TypeScript and includes type definitions. Import types as needed:
|
|
275
277
|
|
|
276
278
|
```typescript
|
|
277
|
-
import { Axion, ApiResponse } from '
|
|
279
|
+
import { Axion, ApiResponse } from '@axionquant/sdk';
|
|
278
280
|
```
|
|
279
281
|
|
|
280
282
|
## Base URL
|
|
281
283
|
|
|
282
|
-
By default, the SDK connects to `
|
|
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.
|