Skip to content
GET /v1/generate

SRI hashes + tag for an asset

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/sri-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/sri-api/v1/generate" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/sri-api/v1/generate", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/sri-api/v1/generate");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/sri-api/v1/generate",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "url": "https://example.com/",
        "html": {
            "script": "<script src=\"https://example.com/\" integrity=\"sha384-EUZfMlUFsH9OvEhNQdUYTotKnWJBzc1rEyZ486Wt8faO3LCu9bFskk2U1TtVUGNf\" crossorigin=\"anonymous\"></script>"
        },
        "hashes": {
            "sha256": "sha256-+5HXWmu0MHh6YbCuxeN09YADDyh44WE+q1ymMQ97u5o=",
            "sha384": "sha384-EUZfMlUFsH9OvEhNQdUYTotKnWJBzc1rEyZ486Wt8faO3LCu9bFskk2U1TtVUGNf",
            "sha512": "sha512-jhVrrTWMkaPdWTEr++g2+LUrutETjBntwr8rBlzD0dA66sYL2PRjAzPLvbCTm7kPRTX+kPcOBCekP96TyPBW/g=="
        },
        "algorithm": "sha384",
        "final_url": "https://example.com/",
        "integrity": "sha384-EUZfMlUFsH9OvEhNQdUYTotKnWJBzc1rEyZ486Wt8faO3LCu9bFskk2U1TtVUGNf",
        "size_bytes": 528,
        "content_type": "text/html"
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:48.598Z",
        "request_id": "3a8b92bd-a607-4ce0-b710-fbbdf0af2046"
    },
    "status": "ok",
    "message": "SRI generated",
    "success": true
}