(bars())
- get - Get Bars V2
Get Bars V2
package hello.world;
import com.benzinga.bzclient.Bzclient;
import com.benzinga.bzclient.models.errors.BzhttpResp;
import com.benzinga.bzclient.models.operations.GetBarsV2Response;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BzhttpResp, Exception {
Bzclient sdk = Bzclient.builder()
.apiKeyAuth("<YOUR_API_KEY_HERE>")
.build();
GetBarsV2Response res = sdk.bars().get()
.symbols("<value>")
.from("<value>")
.to("<value>")
.interval("<value>")
.call();
if (res.responseBodies().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
symbols |
String | ✔️ | Symbols |
from |
String | ✔️ | From |
to |
Optional<String> | ➖ | To |
interval |
Optional<String> | ➖ | Interval |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BzhttpResp | 400, 500 | application/json |
models/errors/APIException | 4XX, 5XX | */* |