Query for a single domain

The Greencheck API provides endpoints that allow developers to query The Green Web Foundation's dataset of green domains.

The endpoint allows you to check if a single website domain is served from a green web host.

Request method

Use the GET method for this request.

Endpoint

The request should be sent to https://api.thegreenwebfoundation.org/api/v3/greencheck/{hostname}.

The {hostname} parameter should be replaced with the website domain you want to query for.

Parameters

{hostname}

A valid hostname should be passed to the endpoint. This parameter must not include any protocol, port, or path information.

  • climateaction.tech Accepted
  • https://climateaction.tech Incorrect
  • climateaction.tech/events Incorrect

Sample request

  1. JavaScript
  2. cURL
fetch("https://api.thegreenwebfoundation.org/api/v3/greencheck/climateaction.tech", {
  method: "GET",
}).then((response) => response.json());
curl -X 'GET' \
 'https://api.thegreenwebfoundation.org/api/v3/greencheck/climateaction.tech' \
 -H 'accept: application/json'

Response

{
  "url": "climateaction.tech",
  "hosted_by": "Cloudflare",
  "hosted_by_website": "www.cloudflare.com",
  "partner": null,
  "green": true,
  "hosted_by_id": 779,
  "modified": "2022-10-20T02:41:43",
  "supporting_documents": [
    {
      "id": 18,
      "title": "Blog post - The Climate and Cloudflare",
      "link": "https://blog.cloudflare.com/the-climate-and-cloudflare/"
    },
    {
      "id": 21,
      "title": "Cloudflare 2020 Emissions Inventory",
      "link": "https://s3.nl-ams.scw.cloud/tgwf-web-app-live/uploads/Cloudflare_Emissions_Inventory_-_2020.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=SCWK7542V4RH19SJV0RG%2F20221020%2Fnl-ams%2Fs3%2Faws4_request&X-Amz-Date=20221020T025244Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=9bf0a61ed3c50f2438d58f72d841457189d24cfcec5a122449272348d5bf3014"
    }
  ]
}

Response object

The response is returned as a JSON object. The content of the returned object depends on if the URL that was queried for is green.

  1. Green URL
  2. Not green URL
{
  "url": string,
  "hosted_by": string,
  "hosted_by_website": string,
  "partner": string || null,
  "green": true,
  "hosted_by_id": number,
  "modified": ISO 8601 formatted date string,
  "supporting_documents": array[
   object{
      "id": number,
      "title": string
      "link": string
   },
  ]
}
{
    "green": false,
    "url": string,
    "data": false
}

Troubleshooting

Why is a domain being returned as not green?

When a green hosting check is performed for a domain, we will return either green: true (it's a green host) or green: false (not a green host).

If you're expecting a green result, but not getting it, there are a few reasons why this might be happening. We've covered these in our FAQ - Why does my website show up as grey in the Green Web Checker?.

Do you see a bug? Open an issue on GitHub
Do you like Greencheck API? Star it on GitHub!