# API Charge Search Limit

**URL:** <http://forum.companieshouse.gov.uk/t/api-charge-search-limit/1014>\
**Category:** Information\
**Created:** [March 3, 2017, 4:03pm UTC](http://forum.companieshouse.gov.uk/t/api-charge-search-limit/1014 "2017-03-03T16:03:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [March 6, 2017, 11:03am UTC](http://forum.companieshouse.gov.uk/t/api-charge-search-limit/1014/4 "2017-03-06T11:03:11Z")

</div>

I don’t quite follow - you’re just calling the api with [https://api.companieshouse.gov.uk/company/03034606/charges](https://api.companieshouse.gov.uk/company/03034606/charges) yes? In which case as you’ve said you’ll get back some subset of the charges (e.g. 25 if that’s what you find, ordered most - least recent). Charge list is one of the “paged lists” where you may need to call repeatedly setting the `start_index` and `items_per_page` parameters as appropriate (note \*).

The [charge list documentation](https://developer.companieshouse.gov.uk/api/docs/company/company_number/charges/getChargeList.html) doesn’t guarantee that it will return all the charges, or a particular category (satisfied / unsatisfied) (although I wish it would…) or that it’ll give you them in any particular order. Along with any charge items it returns it should give you three fields:

- `total_count`
- `part_satisfied_count`
- `satisfied_count`

So (forgive labouring the point) in the case of 03034606 - EASYJET AIRLINE COMPANY LIMITED if I get back 25 charge items from calling the API and I see that `total_count` is 209 I’ll call again but setting e.g. `start_index` to 25 (and `items_per_page` to 25) to get the next set of results. If you just want the outstanding ones, keep a count of them and as soon as it matches ( `total_count` - `part_satisfied_count` - `satisfied_count` ) you’re done.

[Managing these paged lists](http://forum.aws.chdev.org/t/search-api-results-starting-at-incorrect-index/339/3):

> [@Search API Results Starting at Incorrect Index](http://forum.aws.chdev.org/t/search-api-results-starting-at-incorrect-index/339/4):
>
> I have found that to make it work, as previously mentioned, you have to use a multiple of number of items per page.I maintain a page\_no (starting at 0) and items\_per\_page variables.I calculate the start\_index as page\_no \* items\_per\_page so the 4th standard page has a start\_index of 60 (3 \* 20)

Note \*: if you’re searching with `start_index` \> 300 you might not get the expected response: [http://forum.aws.chdev.org/t/search-company-officers-returns-http-416-when-start-index-over-300/897](http://forum.aws.chdev.org/t/search-company-officers-returns-http-416-when-start-index-over-300/897)

---

_[View the full topic](http://forum.companieshouse.gov.uk/t/api-charge-search-limit/1014)._
