1. Home
  2. Docs
  3. Examples
  4. Get all websites down

Get all websites down

The example below returns all websites that are down in your account.

GraphQL query

query {
    websites(up: false) {
        domain
        up
    }
}

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://app.mywebsiteisonline.com/graphql',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"query":"query {\\n    websites(up: false) {\\n        domain\\n        up\\n    }\\n}","variables":{}}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer API_KEY',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Response

{
    "data": {
        "websites": [
            {
                "domain": "santerref.net",
                "up": false
            }
        ]
    }
}
Was this article helpful to you? No Yes

How can we help?