> ## Documentation Index
> Fetch the complete documentation index at: https://docs.advay.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Badge (Shields endpoint)

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:

```bash theme={null}
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

```bash theme={null}
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)


## OpenAPI

````yaml GET /badge.json
openapi: 3.0.3
info:
  title: nums API
  version: 1.0.0
  description: Simple hit counter and badge service.
servers:
  - url: https://nums.advay.ca
security: []
paths:
  /badge.json:
    get:
      summary: Shields endpoint JSON
      parameters:
        - in: query
          name: id
          schema:
            type: string
        - in: query
          name: label
          schema:
            type: string
          example: views
        - in: query
          name: color
          schema:
            type: string
          example: blue
        - in: query
          name: cacheSeconds
          schema:
            type: integer
          example: 30
          description: Clamped to 30–3600 seconds
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  schemaVersion:
                    type: integer
                    example: 1
                  label:
                    type: string
                    example: views
                  message:
                    type: string
                    example: '73'
                  color:
                    type: string
                    example: blue
                  cacheSeconds:
                    type: integer
                    example: 30

````