ForHosting KIT · Developer Utilities

Generate README badge Markdown with alt text

Create a ready-to-paste README badge from a label, message, and color without remembering the Shields path syntax.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

The generator returns complete Markdown, the underlying image URL, and the human-readable alt text as separate fields. It safely handles spaces, hyphens, underscores, punctuation, and Markdown-sensitive brackets, so the result remains structurally correct when labels describe real build jobs or release channels. Use the browser tool for a quick badge or call the deterministic API when documentation is assembled automatically.

Choose concise badge text that communicates status

A useful badge answers a small, specific question at a glance. Put the category on the left as the label, then put its current value on the right as the message. For example, a label such as build paired with a message such as passing is easier to scan than a long sentence compressed into one image. The generated alt text joins those values with a colon, giving screen-reader users the same basic relationship conveyed visually. Keep both values meaningful when read without color, because color alone should never carry essential status. The generator trims surrounding whitespace but preserves intentional wording and letter case. Empty labels and empty messages are rejected instead of producing a confusing image with a blank half. When a badge represents automation, prefer stable vocabulary across releases so diffs remain readable and people learn where to look. The returned alt_text field also lets a documentation pipeline inspect or reuse the accessible description independently of the finished Markdown string.

Understand how the Shields image URL is formed

Shields static badges encode the label, message, and color in an image path. That path has special separator rules: spaces become underscores, literal underscores are doubled, and literal hyphens are doubled so they cannot be confused with the separators between badge parts. Other punctuation is percent-encoded for a valid URL. This capability applies those transformations deterministically and returns the resulting URL alongside the Markdown. A hexadecimal color may be supplied with a leading hash, which is removed before the color becomes part of the path; named Shields colors such as brightgreen can be supplied directly. The service does not contact Shields or verify how a particular color name is rendered. It only generates the conventional image reference, which keeps execution fast, private, and suitable for offline documentation builds. Because no network request occurs, a successful result means the syntax was produced correctly, not that the remote image was fetched. You can therefore store the output in a template and let the eventual README viewer request the image normally.

Insert and automate the generated Markdown safely

Copy the markdown field into a README, pull request template, package page, or any Markdown document that permits remote images. The result uses the familiar image form with accessible text in square brackets and the Shields URL in parentheses. Brackets and backslashes inside the visible text are escaped so user-provided wording does not prematurely close the alt-text section. For an automated workflow, send the three input fields whenever you render documentation and write the returned markdown value at the intended location. Since the algorithm has no clock, randomness, state, or network dependency, identical inputs always produce identical output; this makes generated files stable in source control. Consider keeping badge placement and ordering in your own template rather than concatenating an entire README in this capability. It deliberately creates one badge item per request and does not edit repositories, inspect build results, or decide what a status should say. Those boundaries make failures explicit: upstream automation supplies the truth, while this generator handles only correct encoding and presentation.

Add a build-status placeholder

Create consistent badge Markdown for a README template before a continuous integration system supplies the current message.

Document package compatibility

Turn a runtime label and supported version message into a compact badge with matching alt text.

Generate release documentation

Produce deterministic badge snippets inside a documentation build without writing custom Shields path-escaping code.

What does one request cost?

Each API request costs $0.002. The same deterministic generator can also run in the browser.

Does this check whether the Shields image is available?

No. It generates the URL and Markdown without making a network request or fetching the image.

Can I use a hexadecimal color?

Yes. Supply an RGB hexadecimal value with or without its leading hash, and the generated path will omit the hash.

Why are hyphens or underscores doubled in the URL?

Shields uses doubled characters to distinguish literal hyphens and underscores from path separators and encoded spaces.

What happens when the label or message is blank?

The request fails with an invalid input error because both halves are required for a meaningful, accessible badge.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/dev/readme-badge-markdown

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/dev/readme-badge-markdown \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"build","message":"passing","color":"brightgreen"}'
{
  "label": "build",
  "message": "passing",
  "color": "brightgreen"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.readme_badge_markdown",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →