What is it?
The Diwigo security headers API grades the HTTP security headers of a website (HTTPS, HSTS, CSP, clickjacking, MIME sniffing, referrer, permissions) from A+ to F, with advice for each.
It answers with JSON and is included in the free plan: 10,000 requests per API key and per month.
Example request
GET https://landing.diwigo.com/api/?key=YOUR_API_KEY&headers=https://landing.diwigo.com
Parameters
| Parameter | Description |
|---|---|
key | Your API key (required) |
headers | Site URL |
Example response
{
"grade": "B",
"score": 75,
"checks": [
{ "check": "Strict-Transport-Security", "result": "pass" },
{ "check": "Content-Security-Policy", "result": "fail", "advice": "Add a Content-Security-Policy…" }
]
}
Code examples
curl "https://landing.diwigo.com/api/?key=YOUR_API_KEY&headers=https://landing.diwigo.com"
const res = await fetch("https://landing.diwigo.com/api/?key=YOUR_API_KEY&headers=https://landing.diwigo.com");
const data = await res.json();
console.log(data);
<?php
$response = file_get_contents("https://landing.diwigo.com/api/?key=YOUR_API_KEY&headers=https://landing.diwigo.com");
$data = json_decode($response, true);
print_r($data);
import requests
response = requests.get("https://landing.diwigo.com/api/?key=YOUR_API_KEY&headers=https://landing.diwigo.com")
print(response.json())
Use cases
- Audit your websites in CI
- Monitor client sites for regressions
- Learn which headers to add
Security headers: questions and answers
What does the Security headers API do?
The Diwigo security headers API grades the HTTP security headers of a website (HTTPS, HSTS, CSP, clickjacking, MIME sniffing, referrer, permissions) from A+ to F, with advice for each.
How do I call the Security headers API?
Send a GET request to https://landing.diwigo.com/api/?key=YOUR_API_KEY&headers=https://landing.diwigo.com with your own API key instead of YOUR_API_KEY. It answers with JSON.
Is the Security headers API free?
Yes, it is included in the free plan: 10,000 requests per API key and per calendar month, shared by all Diwigo endpoints. Higher limits are available on request.