# Ping Companies House service

**URL:** <http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573>\
**Category:** API Question\
**Created:** [January 10, 2018, 5:36am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573 "2018-01-10T05:36:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhammadadeel118](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@muhammadadeel118](http://forum.companieshouse.gov.uk/u/muhammadadeel118)\
**Post date:** [January 10, 2018, 5:36am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/1 "2018-01-10T05:36:45Z")

</div>

Best practice to ping Companies House service to check up time.

---

<div class="post-metadata">

**Author:** ![muhammadadeel118](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@muhammadadeel118](http://forum.companieshouse.gov.uk/u/muhammadadeel118)\
**Post date:** [January 16, 2018, 12:04pm UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/2 "2018-01-16T12:04:04Z")

</div>

Is there any API built to ping Companies House?

---

<div class="post-metadata">

**Author:** ![muhammadadeel118](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@muhammadadeel118](http://forum.companieshouse.gov.uk/u/muhammadadeel118)\
**Post date:** [January 30, 2018, 6:17am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/3 "2018-01-30T06:17:33Z")

</div>

I am still waiting for a response - can somebody contact me?  
@mfairhurst ??

---

<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:** [January 30, 2018, 9:59am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/4 "2018-01-30T09:59:39Z")

</div>

No, there is no ‘PING’ available through the API.

---

<div class="post-metadata">

**Author:** ![KDJones](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/kdjones/32/178_2.png) [@KDJones](http://forum.companieshouse.gov.uk/u/KDJones)\
**Post date:** [February 1, 2018, 11:43am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/5 "2018-02-01T11:43:41Z")

</div>

Just as a follow up to this.

There is a way to call the service to ensure it is available, this can be done by curling the  
API health check endpoint. An example of how this can be done is:

curl -vvv -k -X GET -H “Authorisation” -H “Cache-Control: no-cache” -H “Postman token” [https://api.companieshouse.gov.uk/healthcheck](https://api.companieshouse.gov.uk/healthcheck)

This should return a 200 status.

---

<div class="post-metadata">

**Author:** ![muhammadadeel118](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@muhammadadeel118](http://forum.companieshouse.gov.uk/u/muhammadadeel118)\
**Post date:** [February 2, 2018, 7:23am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/6 "2018-02-02T07:23:25Z")

</div>

@KDJones I tried your solution, but it is not working

---

<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:** [February 2, 2018, 10:44am UTC](http://forum.companieshouse.gov.uk/t/ping-companies-house-service/1573/7 "2018-02-02T10:44:43Z")

</div>

I think @KDJones command above should read:

```
curl -v -k -X GET -H "Authorisation" -H "Cache-Control: no-cache" -H "Postman token" https://api.companieshouse.gov.uk/healthcheck

```

…that’s just a single “-v” flag for (–verbose) not “-vvv” as the original had it. I think I still got a response using the original line however…

This produces a lot of output, a shorter response would be using:

```
curl -I -k -X GET -H "Authorisation" -H "Cache-Control: no-cache" -H "Postman token" https://api.companieshouse.gov.uk/healthcheck

```

That gives me:

```
HTTP/1.1 200 OK
Date: Fri, 02 Feb 2018 10:22:47 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Connection: keep-alive
Server: CompaniesHouse

```

So as @KDJones says this returns a 200 status.

I don’t think you need curl specifically - although it or an equivalent are likely to be available as a library in your chosen language. If you want to use it from the command line as a test (free) see the [curl homepage](https://curl.haxx.se/) or the [curl documentation](https://curl.haxx.se/docs/manpage.html).

I’ve only tested this on the command line. I haven’t yet seen any other status (good!) to verify what exactly happens when the servers are down. However it seems general and simple enough for me now.

@muhammadadeel118 _(sigh)_ It’s not my business and we’re all busy people but if you have a problem it’s almost always helpful to give more info rather than less. E.g. rather than “it’s not working” something like “I want to achieve {overall goal}. I’m trying to do this by {CH endpoint / method / algorithm / command}. The steps I took were {List of what you did with any response / errors you received}. {If something was unexpected:} I expected {x} to happen but {y} happened.”

These sites explain it better than I can:  
[Short, self-contained correct example (http://sscce.org/)](http://sscce.org/)  
[How to write a good bug report (http://noverse.com/blog/2012/06/how-to-write-a-good-bug-report/)](http://noverse.com/blog/2012/06/how-to-write-a-good-bug-report/)
