Docs / Developer tools

README badges API

Small SVG badges: market open or closed, the next holiday, a dataset's freshness, or your own.

Badges in the familiar two-part style, for READMEs, dashboards and status pages. The text is drawn as outlines, so any script shows the same everywhere.

Base URL https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as Markdown

A badge of your own

GET/v1/badge

The answer returns the image itself; errors are JSON as everywhere else.

ParameterDescription
labelqueryLeft part, up to 60 characters. Optional.
messagequery, requiredRight part, up to 80 characters.
colorqueryMessage colour: green, red, orange, yellow, blue, grey, purple, teal, or hex. Default blue.
labelColorqueryLabel colour, hex. Default 555.
formatquerysvg (default) or png. One of: svg, png.

curl

curl -o picture.svg "https://api.dharun.dev/v1/badge?label=made%20in&message=India&color=orange&utm_medium=docs"

HTML

<img src="https://api.dharun.dev/v1/badge?label=made%20in&amp;message=India&amp;color=orange&amp;utm_medium=docs" alt="A badge of your own">
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Result

Example: A badge of your own

Market or holiday badge

GET/v1/badge/{kind}

market: NSE open, closed or in its pre-open or closing session. holiday: the next holiday (bank by default; type and state as in /v1/holidays).

The answer returns the image itself; errors are JSON as everywhere else.

ParameterDescription
kindpath, requiredWhich badge. One of: market, holiday.
labelqueryYour own label.
typequeryholiday: bank (default), market, central.
statequeryState code or name, for example TN or Tamil Nadu.
formatquerysvg (default) or png. One of: svg, png.

curl

curl -o picture.svg "https://api.dharun.dev/v1/badge/market?utm_medium=docs"

HTML

<img src="https://api.dharun.dev/v1/badge/market?utm_medium=docs" alt="Market or holiday badge">
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Result

Example: Market or holiday badge

Dataset freshness badge

GET/v1/badge/dataset/{name}

When one of this API's datasets was last updated; orange when older than 45 days.

The answer returns the image itself; errors are JSON as everywhere else.

ParameterDescription
namepath, requiredA dataset name, as /healthz lists them.
formatquerysvg (default) or png. One of: svg, png.

curl

curl -o picture.svg "https://api.dharun.dev/v1/badge/dataset/ifsc?utm_medium=docs"

HTML

<img src="https://api.dharun.dev/v1/badge/dataset/ifsc?utm_medium=docs" alt="Dataset freshness badge">
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Result

Example: Dataset freshness badge

Using an AI assistant? Connect the MCP server and it can call this API by itself. Want every endpoint on one bench? Open the playground.