# Batchsize from cryptocontext

**URL:** https://openfhe.discourse.group/t/batchsize-from-cryptocontext/462
**Category:** Library Questions
**Created:** [April 11, 2023, 7:24pm UTC](https://openfhe.discourse.group/t/batchsize-from-cryptocontext/462 "2023-04-11T19:24:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nikolaiopdan](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@nikolaiopdan](https://openfhe.discourse.group/u/nikolaiopdan)
#### Post date: [April 11, 2023, 7:24pm UTC](https://openfhe.discourse.group/t/batchsize-from-cryptocontext/462/1 "2023-04-11T19:24:49Z")

</div>

Hello,

Is there a way to get the batchsize from the cryptocontext, similar to `cc->GetEncodingParams()`?

I am aware that one may get batchsize from the parameters using `parameters.GetBatchSize()`, but I don’t know of any methods to get the parameters from the crypto context.

Thank you in advance!

---

<div class="post-metadata">

### Author: ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)
#### Post date: [April 11, 2023, 7:48pm UTC](https://openfhe.discourse.group/t/batchsize-from-cryptocontext/462/2 "2023-04-11T19:48:50Z")

</div>

I think the following should help you achieve what you want.

`cc->GetCryptoParameters()->GetEncodingParams()->GetBatchSize()`

---

<div class="post-metadata">

### Author: ![nikolaiopdan](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@nikolaiopdan](https://openfhe.discourse.group/u/nikolaiopdan)
#### Post date: [April 11, 2023, 8:24pm UTC](https://openfhe.discourse.group/t/batchsize-from-cryptocontext/462/3 "2023-04-11T20:24:07Z")

</div>

Thanks! That works great!
