Skip to main content
GET
/
badge.json
Shields endpoint JSON
curl --request GET \
  --url https://nums.advay.ca/badge.json
{
  "schemaVersion": 1,
  "label": "views",
  "message": "73",
  "color": "blue",
  "cacheSeconds": 30
}
Return Shields.io-compatible JSON for a dynamic badge.

Example

The following example demonstrates how to use the Shields endpoint to create a badge for your project’s homepage hits:
open "https://img.shields.io/endpoint?url=https%3A%2F%2F<deployment>%2Fbadge.json%3Fid%3Dhome%26label%3Dhits%26cacheSeconds%3D30"
Replace <deployment> with your actual deployment URL. This command, when run in a terminal, will open a URL that returns a JSON response compatible with Shields.io, allowing you to display dynamic badge data.
An example of this in action with my own deployment is
https://img.shields.io/endpoint?url=https%3A%2F%2Fnums.advay.ca%2Fbadge.json%3Fid%3Dhome%26label%3Dhits
You can add this into your own github profile to view the views on your site, (must be in allowed origins in the .env of your vercel deployment)

Query Parameters

id
string
label
string
color
string
cacheSeconds
integer

Clamped to 30–3600 seconds

Response

200 - application/json

OK

schemaVersion
integer
Example:

1

label
string
Example:

"views"

message
string
Example:

"73"

color
string
Example:

"blue"

cacheSeconds
integer
Example:

30

I