Monitoring Your API’s Uptime Using the API Science API

My previous post talked about what you can do when a massive cyber attack brings down APIs (your own, or external APIs) that are critical for your product.

The API Science API includes a Monitor Reports component that lets your product’s operational software integrate your API monitoring into the ongoing creation of your product. The product you present to your customers changes depending on the status of the APIs that provide the data your product provides to your customers. You need to monitor all APIs that are critical for your product if you are to know when customers might be seeing outages.

One way to do this is to send alerts to your team whenever a critical API goes down. If the outage is not that significant, your team can address the issue and ensure that your customers know you are coping with the outage.

But, in a situation where there is a massive geographical outage, sending an endless succession of alerts to your team may be inadequate. In the massive outage case, it will be helpful if you can provide your team with, for example, aggregated and detailed results of the last hour’s calls to your critical APIs. Providing your team with these results will enable them to better assess what’s actually happened, and what’s happening right now. As the crisis continues, this will let your team better assess the results of their recent efforts to cope with the event: “Is what we’re doing making things better for our customers right now? And what else might we be able to do to make things even better, even if the outage continues?”

The API Science API’s Uptime Report provides information that can assist your team in answering these questions. The API can be called from your software (or even by a developer’s hand-typed command) like this:

curl 'https://api.apiscience.com/v1/monitors/157...
/uptime.json?preset=lastDay' 
-H 'Authorization: Bearer NN_6...'

The API returns a JSON text that provides the uptime for the queried API on an hourly basis over the past day. For example:

        {
            "uptime": 1,
            "startPeriod": "2014-09-05T17:38:36.765Z",
            "endPeriod": "2014-09-05T18:38:36.765Z"
        },

Here, the API is telling us that the uptime was 100% for the hour that elapsed between 17:38 and 18:38. This would be a very favorable result for your team during a crisis, especially if results for earlier time periods showed much lower uptimes.

Integrating the API Science API into your Workflow

Since this data is returned in standard JSON format, you can easily integrate the API Science reporting APIs into your workflow, to assist your developer and QA teams in assessing and coping with API outages that are critical for your product.

In a recent post, I described how your software can utilize the API Science API to change the frequency at which your API monitors are run. If your software monitors the API Science Uptime Report, and it notices a sudden decrease in uptime for an important API, your software could automatically increase the frequency with which the affected APIs are monitored.

If you integrate these components of the API Science platform into your software, your platform will automatically provide your developer and QA teams with the significantly more detailed moment-by-moment information they will need in order to cope with an outage.

–Kevin Farnham

Leave a Reply

Your email address will not be published. Required fields are marked *