API issues, 500 error

I am continuously getting a 500 error with the below for the rest API, even when I reroll my API key.

{‘exception_id’: ‘4ie8yuh8v580’, ‘error’: ‘Internal server error’}

I assume this is an issue server side, if so any ETA for when it will be fixed?

I’m not from Companies House, just another user … but these almost always involve some “invalid” form of a URL / parameters being sent. If you’ve searched this forum / read the specifications and not found anything you can see, if you want any further help with this you could try posting the following (some is just basic information, likely not relevant but having more context is always helpful):

Is your application set to be test (sandbox) or live? For almost all purposes it’s best to just create a live application not a test one.

Are you calling from a fixed IP address (server) or is this an AJAX call (e.g. browser-based)? Nothing here should give you a 500 error but have you checked that your IP / domain was registered with Companies House for your application?

Post the exact URL you’re requesting:

e.g. https://api.company-information.service.gov.uk/company/08730224

If you’re using a language / function / library / app to do this, can you check to see the actual URL / http headers that are being sent (some libraries / tools can show you this)? That usually shows up what is going wrong. When doing so don’t post your whole API key - however sometimes the first few bytes are useful to show if e.g. the http Basic header is being composed correctly.

Obviously include any parameters you’re passing e.g. if you’re calling search the q parameter etc. Again useful if you can find out the actual data which is being sent to Companies House (perhaps the URL encoding of parameter data is incorrect etc.)

If you’re using a language / library / application to do this list what that is. If you have a (simplified, minimal) code example / a snapshot of the dialog boxes if using an app that can be helpful.

Good luck.

I am using a pretty simple python request with the below endpoint

https://api.company-information.service.gov.uk/company/15966437/

however, if I do https://api.company-information.service.gov.uk/company/15966437/officers I get a 200, so for some reason the base company ping does not work. However, it did like 1 day ago.

Any idea what is going on?

example code below

    o_response=o_request_session_individual.get("https://api.company-information.service.gov.uk/company/15966437/", auth=(TRADE_REG_UK_CH_APIKEY_REST, ''),)

Did you see this thread? Companies House is (variably) specific about trailing “/”

For a “ping” see the following thread. I’m not sure the original “official” source (presumably someone on this or the XML forum?). I would guess - but do not know - this may not affect the rate-limiting allowance either. If concerned you should check that experimentally!

1 Like