WojciechZankowski / iextrading4j

IEX Cloud open source API wrapper
Apache License 2.0
122 stars 46 forks source link

Batch API #17

Closed hpdrago closed 6 years ago

hpdrago commented 6 years ago

Summary

Hi Wojciech,

Is the market/batch IEXTrading API implemented? It doesn't seem to be there.

I want to do: /stock/market/batch?symbols=aapl,fb,tsla&types=price

Thanks!!!!

Mike (hpdrago)

Details

Date/time of issue

What you expected to happen

What actually happened

Other Information (sample code, links, etc.)

WojciechZankowski commented 6 years ago

Hey!

So batch endpoint is not supported yet, but you can access all data from batch using specific endpoint, look how to call each of them:

https://github.com/WojciechZankowski/iextrading4j/wiki/Stocks

The difference is that in the batch you would do one call and get all data, with separate endpoint you need to do multiple calls.

Can be used as a workaround untill batch endpoint is done.

Cheers,

Wojtek!

hpdrago commented 6 years ago

HI Wojtek, Good to hear back from you. I'll take a look at the link and see what I can find.
Talk to you later.

Thanks, Mike.

WojciechZankowski commented 6 years ago

Hello,

I introduced implementation for Batch and Market Batch endpoints:

Batch request:

final BatchStocks batchStocks = iexTradingClient.executeRequest(new BatchStocksRequestBuilder()
                .withSymbol("AAPL")
                .addType(BatchStocksType.BOOK)
                .addType(BatchStocksType.COMPANY)
                .addType(BatchStocksType.EARNINGS)
                .build());

Market Batch request:

final Map<String, BatchStocks> batchStocksMap = iexTradingClient.executeRequest(new BatchMarketStocksRequestBuilder()
                .withSymbol("AAPL")
                .withSymbol("SNAP")
                .addType(BatchStocksType.COMPANY)
                .addType(BatchStocksType.EARNINGS)
                .build());

Change is available in version 2.1.6

<dependency>
    <groupId>pl.zankowski</groupId>
    <artifactId>iextrading4j-all</artifactId>
    <version>2.1.6</version>
</dependency>

Have fun,

Wojtek

hpdrago commented 6 years ago

Thanks Wojtek! That will help a lot.

Mke.

On Sun, May 27, 2018 at 4:57 AM Wojciech Zankowski notifications@github.com wrote:

Hello,

I introduced implementation for Batch and Market Batch endpoints:

Batch request:

final BatchStocks batchStocks = iexTradingClient.executeRequest(new BatchStocksRequestBuilder() .withSymbol("AAPL") .addType(BatchStocksType.BOOK) .addType(BatchStocksType.COMPANY) .addType(BatchStocksType.EARNINGS) .build());

Market Batch request:

final Map<String, BatchStocks> batchStocksMap = iexTradingClient.executeRequest(new BatchMarketStocksRequestBuilder() .withSymbol("AAPL") .withSymbol("SNAP") .addType(BatchStocksType.COMPANY) .addType(BatchStocksType.EARNINGS) .build());

Change is available in version 2.1.6

pl.zankowski iextrading4j-all 2.1.6

Have fun,

Wojtek

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WojciechZankowski/iextrading4j/issues/17#issuecomment-392325629, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfQqOVzqgIx24_dUwQiGr00nMxDv_maks5t2pSWgaJpZM4TC5lk .

hpdrago commented 6 years ago

Hi Wojtek,

What's the difference between these two calls?

Thanks, Mike.

On Sun, May 27, 2018 at 10:58 AM Michael Earl michael.earl.65@gmail.com wrote:

Thanks Wojtek! That will help a lot.

Mke.

On Sun, May 27, 2018 at 4:57 AM Wojciech Zankowski < notifications@github.com> wrote:

Hello,

I introduced implementation for Batch and Market Batch endpoints:

Batch request:

final BatchStocks batchStocks = iexTradingClient.executeRequest(new BatchStocksRequestBuilder() .withSymbol("AAPL") .addType(BatchStocksType.BOOK) .addType(BatchStocksType.COMPANY) .addType(BatchStocksType.EARNINGS) .build());

Market Batch request:

final Map<String, BatchStocks> batchStocksMap = iexTradingClient.executeRequest(new BatchMarketStocksRequestBuilder() .withSymbol("AAPL") .withSymbol("SNAP") .addType(BatchStocksType.COMPANY) .addType(BatchStocksType.EARNINGS) .build());

Change is available in version 2.1.6

pl.zankowski iextrading4j-all 2.1.6

Have fun,

Wojtek

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WojciechZankowski/iextrading4j/issues/17#issuecomment-392325629, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfQqOVzqgIx24_dUwQiGr00nMxDv_maks5t2pSWgaJpZM4TC5lk .

WojciechZankowski commented 6 years ago

Simple Batch Request is sent only for single symbol. Market Batch request can be send for multiple symbols. Thats why in response to the first call you have single BatchSymbols object and in the second request you get map where key is symbol and value is BatchSymbols.

Hope it explains this a bit.

The difference is also described here: https://iextrading.com/developer/docs/#batch-requests

hpdrago commented 6 years ago

That's what I thought, thanks, i am using it now

On Wed, Jun 6, 2018, 1:55 PM Wojciech Zankowski notifications@github.com wrote:

Simple Batch Request is sent only for single symbol. Market Batch request can be send for multiple symbols. Thats why in response to the first call you have single BatchSymbols object and in the second request you get map where key is symbol and value is BatchSymbols.

Hope it explains this a bit.

The difference is also described here: https://iextrading.com/developer/docs/#batch-requests

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/WojciechZankowski/iextrading4j/issues/17#issuecomment-395210828, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfQqB4apDmOvQwnqVOSmLt9zljCktqTks5t6EHQgaJpZM4TC5lk .