Skip to content

Commit

Permalink
Update Data API in read me (#259)
Browse files Browse the repository at this point in the history
* Update Data API

* update

* Update README.md

Add options and corporate actions
  • Loading branch information
noramehesz authored Jul 2, 2024
1 parent 003c0ff commit 2388264
Showing 1 changed file with 59 additions and 48 deletions.
107 changes: 59 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm install --save @alpacahq/alpaca-trade-api

## Runtime Dependencies

- Node.js v14.x or newer
- Node.js v16.9 or newer
- npm version 6 and above


Expand Down Expand Up @@ -345,7 +345,7 @@ alpaca.deleteFromWatchlist('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', "AAPL").then(
})
```

### Data API
### Data API - Stocks

#### Trades
```ts
Expand Down Expand Up @@ -412,7 +412,7 @@ getMultiQuotesV2(
symbols: Array<string>,
options: GetQuotesParams,
config?: any,
): Promise<Map<string, any[]>>;
): Promise<Map<string, AlpacaQuote[]>>;
```
```ts
getMultiQuotesAsyncV2(
Expand Down Expand Up @@ -485,7 +485,7 @@ getMultiBarsV2(
symbols: Array<string>,
options: GetBarsParams,
config?: any,
): Promise<Map<string, any[]>>;
): Promise<Map<string, AlpacaBar[]>>;
```
```ts
getMultiBarsAsyncV2(
Expand Down Expand Up @@ -655,98 +655,109 @@ All the functions are similar to the stock ones.
#### Trades
* ```ts
getCryptoTrades(
symbol: string,
symbols: Array<string>,
options: GetCryptoTradesParams,
config?: any,
): AsyncGenerator<CryptoTrade, void, unknown>;
```
* ```ts
getLatestCryptoTrade(
symbol: string,
options: {exchange: string},
config?: any
): Promise<CryptoTrade>;
```
* ```ts
getLatestCryptoTrades(
symbols: Array<string>,
options: { exchange: string },
config?: any
): Promise<Map<string, CryptoTrade>>;
```

#### Quotes
* ```ts
getCryptoQuotes(
symbol: string,
symbols: Array<string>,
options: GetCryptoQuotesParams,
config?: any,
): AsyncGenerator<CryptoQuote, void, unknown>;
```
* ```ts
getLatestCryptoQuote(
symbol: string,
options: { exchange: string },
config?: any,
): Promise<CryptoQuote>;
```
* ```ts
getLatestCryptoQuotes(
symbols: Array<string>,
options: { exchange: string },
config?: any,
): Promise<Map<string, CryptoQuote>>;
```

#### Bars
* ```ts
getCryptoBars(
symbol: string,
symbols: Array<string>,
options: GetCryptoBarsParams,
config?: any,
): AsyncGenerator<CryptoBar, void, unknown>;
```
* ```ts
getLatestCryptoBar(
symbol: string,
options: { exchange: string },
config?: any,
): Promise<CryptoBar>;
```
* ```ts
getLatestCryptoBars(
symbols: Array<string>,
options: { exchange: string },
config?: any,
): Promise<Map<string, CryptoBar>>;
```

#### XBBOs
#### Snapshots
* ```ts
getLatestCryptoXBBO(
symbol: string,
options: { exchanges?: Array<string> },
getCryptoSnapshots(
symbol: Array<string>,
config?: any,
): Promise<CryptoXBBO>;
): Promise<CryptoSnapshot>;
```
* ```ts
getLatestCryptoXBBOs(
symbols: Array<string>,
options: { exchanges?: Array<string> },

### Data API - Options
#### Bars
* ```ts
getOptionBars(
symbols: Array<stirng>,
options: GetOptionBarsParams,
config?: any,
): Promise<Map<string, CryptoXBBO>>;
): Promise<Map<string, AlpacaOptionBar[]>>;
```
#### Trades
* ```ts
getOptionTrades(
symbols: Array<stirng>,
options: GetOptionTradesParams,
config = any,
): Promise<Map<string, AlpacaOptionTrade[]>>;
```
* ```ts
getOptionLatestTrades(
symbols: Array<stirng>,
config = any,
): Promise<Map<string, AlpacaOptionTrade>>;
```
#### Quotes
* ```ts
getOptionLatestQuotes(
symbols: Array<stirng>,
config = any,
): Promise<Map<string, AlpacaOptionQuote>>;
```

#### Snapshots
* ```ts
getCryptoSnapshot(
symbol: string,
options: { exchange: string },
config?: any,
): Promise<CryptoSnapshot>;
getOptionSnapshots(
symbols: Array<stirng>,
config = any,
): Promise<AlpacaOptionSnapshot[]>;
```
* ```ts
getOptionChain(
underlyingSymbols: string,
options: GetOptionChainParams,
config = any,
): Promise<AlpacaOptionSnapshot[]>;
```


### Data API - Corporate Actions
* ```ts
getCorporateActions(
symbols: Array<stirng>,
options: GetCorporateActionParams,
config = any
): Promise<CorporateActions | undefined>;
```

### Websockets
You can use data websocket with or without a funded account.
Expand Down

0 comments on commit 2388264

Please sign in to comment.