Skip to main content

On This Page

GoBadge Dynamic: Transform Any JSON API to Universal Badge Generator

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

From Module Stats to Universal Badges

CinfiniteDev has released GoBadge v2, transitioning the tool from a niche Go module tracker to a universal badge service. The system now allows developers to generate badges from any HTTPS JSON endpoint via a single URL pattern.

Why This Matters

Traditional badge services often rely on hardcoded integrations for specific platforms, creating a bottleneck when users need to display proprietary metrics or data from emerging APIs. By implementing an open-ended dynamic endpoint that supports dot notation for nested JSON, GoBadge removes the need for custom middleware or dedicated backend services just to display simple API values in documentation.

Key Insights

  • Universal Integration (2026): Transitioned from three hardcoded endpoints (stars, imports, imported-by) to an open-ended system supporting any JSON API.
  • Nested Data Extraction: Implementation of dot notation allows users to access deep JSON paths, such as extracting ‘license.spdx_id’ from a GitHub repository object.
  • Multi-Value Aggregation: Support for repeating the ‘value’ parameter enables multiple data points within a single badge using custom separators.

Working Examples

Single value extraction from GitHub API with custom color.

![Stars](https://gobadge.vercel.app/api/dynamic?url=https://api.github.com/repos/gin-gonic/gin&value=stargazers_count&label=Stars&color=yellow)

Multiple value extraction using the ‘sep’ parameter for formatting.

![Gin](https://gobadge.vercel.app/api/dynamic?url=https://api.github.com/repos/gin-gonic/gin&value=stargazers_count&value=forks_count&label=Gin&sep=%20%E2%9C%A6%20)

Nested JSON extraction using dot notation.

![License](https://gobadge.vercel.app/api/dynamic?url=https://api.github.com/repos/gin-gonic/gin&value=license.spdx_id&label=License&color=blue)

Practical Applications

  • ، { “use_case”: “Infrastructure monitoring (Custom Metrics API + README), displaying internal health or build status via dynamic badges.”, “pitfall”: “Using non-HTTPS endpoints; the system requires HTTPS JSON endpoints for functionality.” }
  • { “use_case”: “Package Manager Tracking (npm, PyPI, Crates.io + Versioning), automating download and dependency counts on project landing pages.”, “pitfall”: “Incorrect key mapping; failing to use dot notation for nested JSON objects results in failed value extraction.” }

References:

  •   											https://dev.to/cinfinitedev_engine/gobadge-dynamic-from-module-stats-to-universal-badges-361l
  •   https://gobadge.vercel.app

Continue reading

Next article

Building a Production-Grade Async Job Queue: Engineering Resilience and Backpressure

Related Content