Badges
Badge Generator
Make sure to check out the Badge Generator
GHCR Image Size
/ghcr/size/{owner}/{pacakge}
/ghcr/size/{owner}/{pacakge}/{tag}
Without the tag
it defaults to latest
, these are equivalent.
- https://badges.cssnr.com/ghcr/size/smashedr/node-badges
- https://badges.cssnr.com/ghcr/size/smashedr/node-badges/latest
For more options see the Query Parameters.
https://badges.cssnr.com/ghcr/size/smashedr/node-badges?labelColor=blueviolet&lucide=scale&color=seagreen&style=for-the-badge&label=node%20badges
GHCR Image Tags
/ghcr/tags/{owner}/{pacakge}/latest
/ghcr/tags/{owner}/{pacakge}
Without latest
it returns the n
most recent tags, otherwise only the latest tag.
- https://badges.cssnr.com/ghcr/tags/smashedr/node-badges
- https://badges.cssnr.com/ghcr/tags/smashedr/node-badges/latest
The n
parameter defaults to 3
, these are equivalent.
https://badges.cssnr.com/ghcr/tags/smashedr/node-badges
https://badges.cssnr.com/ghcr/tags/smashedr/node-badges?n=3
You can also change the sep
parameter, add reversed
and filter by valid semver
tags.
https://badges.cssnr.com/ghcr/tags/smashedr/node-badges?labelColor=plum&lucide=activity&iconColor=black&color=paleturquoise&style=for-the-badge&label=last%20four&n=4&sep=-&reversed&semver
VirusTotal Release and Files
/vt/id/{id}
/vt/{owner}/{repo}/{asset}
/vt/{owner}/{repo}/{asset}/{tag}
WARNING
Going forward you need to use the file hash: SHA-256
, SHA-1
or MD5
.
File ID's (which end with ==
) consume API calls where hashes do not.
You MUST also update the endpoint to: /vt/id/{hash}
File ID's will continue to work for existing badges; however, DO NOT ADD MORE!
- https://badges.cssnr.com/vt/id/sha256:d54fd9a93f2aa25b5c95128f84de1a624783ded6e66554c12a5ffd07546146e4
- https://badges.cssnr.com/vt/cssnr/zipline-android/app-release.apk
- https://badges.cssnr.com/vt/cssnr/zipline-android/app-release.apk/1.0.29
The hash
is the file's SHA-256
, SHA-1
or MD5
. The prefix is optional and can be sha256:xxxx
or just xxxx
.
The owner/repo/asset
endpoints use the latest/tagged release asset for the repository.
If the tag
parameter is omitted, the release tagged as latest
in GitHub is used.
For the repo cssnr/zipline-android and the release asset app-release.apk
the URL would be:
https://badges.cssnr.com/vt/cssnr/zipline-android/app-release.apk
The color of the badge is automatically determined based on the number of malicious+suspicious reports.
The default is #44cc11
(brightgreen) to #e05d44
(red) with 8
colors. Meaning 0 detections will be brightgreen and 8+ red. But 1-7
would be a color somewhere between brightgreen and red.
The start
color end
color and total n
number of colors can be specified with query parameters.
This uses gka/chroma.js which accepts hex codes or css colors, but not badge-maker named colors.
There is currently a color tester at /color/N
. This will produce a color between red and green.
https://badges.cssnr.com/colors/4?start=green&end=red&n=8
View Color Generation Code
function getRangedColor(req, index, options = {}) {
const opts = { total: 8, start: '#44cc11', end: '#e05d44', ...options }
opts.total = Number.parseInt(req.query.n || opts.total)
opts.start = req.query.start || opts.start
opts.end = req.query.end || opts.end
const colors = chroma
.scale([opts.start, opts.end])
.mode('lab')
.colors(opts.total + 1)
const idx = Math.max(0, Math.min(opts.total, index))
return colors[idx]
}
NOTE
This service does not upload the file to VirusTotal for analysis, it only fetches the result.
You can do this automatically with the cssnr/virustotal-action GitHub action.
JSON/YAML JSONPath
/json/{url}/{path}
/yaml/{url}/{path}
Both url
and path
are both URL Encoded.
The path
is a JSONPath.
This endpoint accepts split
and index
.
Example showing the redis version from this docker-compose-swarm.yaml.
https://badges.cssnr.com/yaml/https%3A%2F%2Fraw.githubusercontent.com%2Fsmashedr%2Fnode-badges%2Frefs%2Fheads%2Fmaster%2Fdocker-compose-swarm.yaml/%24.services.redis.image?split=:&index=1&lucide=database&label=redis
Note: the badge at the top is also from this docker-compose-swarm.yaml file.
Static Badge
/static/{message}
/static/{message}/{label}
Create a static badge with a custom message
. The label
can be optionally added after the message or in the query params.
Work in Progress
These docs are not yet complete. See the README.md on GitHub for more details.