Search code examples
apifirefox-addonuptime

Website availability API


I'm one of the developers of TryAgain, an add-on for Firefox that keeps trying to load a webpage when the server cannot be reached.

A user recently suggested having the add-on check if the website you're trying to reach is down, or just blocked for the local machine. I was therefore hopeful that there might be a website similar to downforeveryoneorjustme.com that has some kind of API that could be used to poll a domain to see if it is accessible to the greater public.

I've tried contacting downforeveryoneorjustme.com and Uptime Auditor, but neither have responded. Does anybody have other ideas?


Solution

  • If you only need simple functionality to verify whether the site is visible to the some service (ex. http://downforeveryoneorjustme.com), I think the API is not necessary, you can simply get:

    http://downforeveryoneorjustme.com/aaa.google.com
    

    And check if in response you can find:

    <title>It's not just you!</title>
    

    or:

    <title>It's just you.</title>
    

    For example in unix-like environments you can do something like this:

    wget -q -O - http://downforeveryoneorjustme.com/aaa.google.com |grep "It's not just you" 
    

    And check exit code. Maybe you should do something similar in your code?