With RunKit Endpoint Badge

https://badgen.net/runkit/cal-badge-icd0onfvrxx6/Asia/Shanghai
                          ──┬─────────────────── ──┬──────────
                            └─ endpoint-id         └─ path-args (optional)

RunKit Endpoint

https://runkit.com/home#endpoint

If you are not familiar with RunKit endpoint, this guide would help.

Use Badgen with RunKit Endpoint

  1. Create a RunKit notebook (e.g. https://runkit.com/amio/cal-badge), which gives you an endpoint:

    https://cal-badge-icd0onfvrxx6.runkit.sh

    it returns a JSON like:

    {
      "subject": "2019",
      "status": "6-1",
      "color": "blue"
    }
  2. Click endpoint on notebook page for the endpoint address, then you have endpoint-id from it's subdomain:

    cal-badge-icd0onfvrxx6
  3. Use endpoint-id within badgen url:

    https://badgen.net/runkit/cal-badge-icd0onfvrxx6

    That's it:

Furthermore, you can append arbitrary path args (e.g. /Asia/Shanghai) to the end of badgen url, Badgen will request RunKit endpoint with that. This badge:

https://badgen.net/runkit/cal-badge-icd0onfvrxx6/Asia/Shanghai

represents data from:

https://cal-badge-icd0onfvrxx6.runkit.sh/Asia/Shanghai

Examples

/runkit/:endpoint-id/:path*