# 500 error advanced-search using start\_index

**URL:** <http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095>\
**Category:** API Question\
**Created:** [May 18, 2022, 10:41am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095 "2022-05-18T10:41:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan.bentham](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@ryan.bentham](http://forum.companieshouse.gov.uk/u/ryan.bentham)\
**Post date:** [May 18, 2022, 10:41am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/1 "2022-05-18T10:41:32Z")

</div>

I’m trying to run this query:

[https://api.company-information.service.gov.uk/advanced-search/companies?company\_status=active&size=5000&start\_index=10000](https://api.company-information.service.gov.uk/advanced-search/companies?company_status=active&size=5000&start_index=10000)

I assumed this would effectively provide the 3rd page of results. Previous I ran this with a start\_index of 0 and 5000 with no issues.

Am I doing this wrong?

---

<div class="post-metadata">

**Author:** ![marcell.toth](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@marcell.toth](http://forum.companieshouse.gov.uk/u/marcell.toth)\
**Post date:** [May 30, 2022, 9:25am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/2 "2022-05-30T09:25:51Z")

</div>

Ran into the very same issue, thanks for starting the thread, @ryan.bentham. Tagging @MArkWilliams as I see him replying to many of the posts.

I am using the advanced search for checking daily dissolutions, running:  
[https://api.company-information.service.gov.uk/advanced-search/companies?dissolved\_from=2022-01-04&dissolved\_to=2022-01-04](https://api.company-information.service.gov.uk/advanced-search/companies?dissolved_from=2022-01-04&dissolved_to=2022-01-04)

From the response, I can see that 21408 companies were struck off the register that day. Now I execute the very same query, with &size=5000 and &start\_index=0, 5000, 10000, 15000, 20000 to get chunks of data. The first two cases, 0 and 5000 works as intended, but the remaining gives “Failed with error code: 500 | Reason: Internal Server Error”

Any help is much appreciated!

---

<div class="post-metadata">

**Author:** ![ryan.bentham](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/r/3be4f8/32.png) [@ryan.bentham](http://forum.companieshouse.gov.uk/u/ryan.bentham)\
**Post date:** [May 30, 2022, 9:43am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/3 "2022-05-30T09:43:26Z")

</div>

Hopefully someone can shed some light on this. I had to cancel the project I was working on as I just couldn’t seem to get the data I needed (unless we’re approaching it the wrong way)

---

<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:** [May 30, 2022, 9:54am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/4 "2022-05-30T09:54:41Z")

</div>

I don’t know, but I suspect it depends what you actually want to do (e.g. what data you need and why). For their normal search there used to be much lower limits on a) how much data you could request and b) the maximum number of results. (Search this forum for details). I think that then threw an error (EDIT see post here):

> **[Search company officers returns HTTP 416 when start\_index over 300](https://forum.aws.chdev.org/t/search-company-officers-returns-http-416-when-start-index-over-300/897)**
>
> The following reqest to search company officers returns response with HTTP status 416 (Request Range Not Satisfiable). GET /search/officers?q=John+Smith&items\_per\_page=100&start\_index=301 The same request with start\_index \<= 300...

Enquiries to Companies House got the reply that “this system is not designed for extracting large chunks of data but for more targetted searches”. They were very keen to spread the load over time and avoid anything that looked like scraping the dataset via the API. (Part of the reason for the streaming API I think). For use cases needing a lot of data like “I want to find all companies of type x” they have directed people to use the [bulk data](https://www.gov.uk/guidance/companies-house-data-products). (Some available here, some datasets e.g. officers available by making a request on one of the threads on this forum).

It seems like they’ve raised the limit - at least for the advanced search. However I’d be tempted to set the start\_index to just below 5000 and creep over it in smaller increments, just to see if a hardwired limit was indeed the issue.

Could be a bug of course but seems an unlikely number.

---

<div class="post-metadata">

**Author:** ![marcell.toth](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@marcell.toth](http://forum.companieshouse.gov.uk/u/marcell.toth)\
**Post date:** [June 1, 2022, 10:15am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/5 "2022-06-01T10:15:47Z")

</div>

@voracityemail , thanks for the reply! 🙂

> [@voracityemail](#):
>
> However I’d be tempted to set the start\_index to just below 5000 and creep over it in smaller increments, just to see if a hardwired limit was indeed the issue.

I went through these, the limit is 10K, which is hardwired. If x is the query size and y is the start index, then x + y \<= 10000.

Currently, I am “hacking” my way around using incorporation dates to fragment the response size, but I think that’s hardly an acceptable solution.

---

<div class="post-metadata">

**Author:** ![MArkWilliams](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/markwilliams/32/194_2.png) [@MArkWilliams](http://forum.companieshouse.gov.uk/u/MArkWilliams)\
**Post date:** [June 1, 2022, 12:20pm UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/6 "2022-06-01T12:20:04Z")

</div>

Have you considered using our free data snapshot product?  
[http://download.companieshouse.gov.uk/en\_output.html](http://download.companieshouse.gov.uk/en_output.html)

---

<div class="post-metadata">

**Author:** ![marcell.toth](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@marcell.toth](http://forum.companieshouse.gov.uk/u/marcell.toth)\
**Post date:** [June 2, 2022, 9:14am UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/7 "2022-06-02T09:14:21Z")

</div>

Thank you, Mark, for replying.

Yes, I already have checked-downloaded all the free data products (companies, accounts, psc). I even went for a bonus round to get some of the snapshot files (companies, psc) historically from the National Archives. Regarding the opening question, I think this might be a solution, @ryan.bentham.

However, for dissolutions, I don’t see the way clear cut from the companies data product. Can you elaborate?

---

<div class="post-metadata">

**Author:** ![ernesto.monroy](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/e/8e8cbc/32.png) [@ernesto.monroy](http://forum.companieshouse.gov.uk/u/ernesto.monroy)\
**Post date:** [September 5, 2025, 1:21pm UTC](http://forum.companieshouse.gov.uk/t/500-error-advanced-search-using-start-index/5095/8 "2025-09-05T13:21:58Z")

</div>

I experienced the same issue, and whilst I understand bulk downloads should go through their bulk service. It would be very helpful if you could at least return a valid error (400) or if you could put a message on the docs to say this is obviously not going to work beyond 10k
