tags | libraryName | title | description | hasTabs | eleventyNavigation | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
apiMain |
Greencheck API |
v3 - Check a domain |
Use this API to check if a domain is hosted on a green web host recognised by The Green Web Foundation. |
true |
|
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.
Use the GET
method for this request.
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.
A valid hostname should be passed to the endpoint. This parameter must not include any protocol, port, or path information.
climateaction.tech
Acceptedhttps://climateaction.tech
Incorrectclimateaction.tech/events
Incorrect
{% codeSnippet code, 'js' %}
{% codeSnippet code, 'curl' %}
{
"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"
}
]
}
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.
{
"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
}
{% include 'snippets/why-not-green.md' %}