Unable to get all the officers data from the API

We are consuming companies house API to pull companies data into our system based on the company ID.

During our integration, we found some issues.

For, Company ID: FC020086

API End Point:

https://api.company-information.service.gov.uk//company/FC020086/officers?start_index=5&items_per_page=5

In this API end point, the officers list have totally 49 officers. However, irrespective of the start_index and items_per_page value giving in the query string, we always get 35 records as output in the items array for the officers part of the company.

This looks like a bug with the API. However, we would like to know if there is any other way of accessing the API end point to get our desired result. We would like to get the complete 49 records from the API to import into our system.

We need your advise on the same.

I just checked an our system gets all 49 officers when we call the officer’s endpoint for that company. Likewise so does the Companies House system (which uses the API: INFOSYS LIMITED people - Find and update company information - GOV.UK), so I don’t think it’s a bug in the API.

That probably doesn’t help all that much, there’s something else I’ll check in a bit, but don’t have time at the moment!

Edit: Right, here is what’s happening with us. We’re sending the request with no start_index or items_per_page, when we do this it is sending all 49 results, however the response also includes items_per_page = 35, I’m not sure why, maybe something to do with the fact that this is the default page length on the CH site (linked above).

Maybe this is a bug, but it’s one we’ve been ignoring as we ignore that field in the response and just process the array. My guess would be that your system is processing this number and then only processing that many items in the array or something like that?

I have just checked an it returns 49 officers. Have you tried:-
https://api.company-information.service.gov.uk//company/FC020086/officers?items_per_page=50

Thanks a lot. This is working fine, if we add ?items_per_page query string. However, if there are more numbers of results, is there any way to receive the delta results by any chance? like by updated the start_index field to get the second page item.

Yes, of course:-
https://api.company-information.service.gov.uk/company/FC020086/officers?start_index=1&items_per_page=20
https://api.company-information.service.gov.uk/company/FC020086/officers?start_index=20&items_per_page=20
https://api.company-information.service.gov.uk/company/FC020086/officers?start_index=40&items_per_page=20

etc