APIAPI v1Badge per Repo and BadgeId

Badges

Get SVG Badge

GET /api/v1/repositories/{repositoryUrl}/badges/{badgeID}

This endpoint returns the SVG badge for the given repository URL and badge ID.

This endpoint gets parameterized with the repository URL and the badge ID. The repository URL is the URL of the repository that should be or was already scanned. The URL must be URL encoded (https://gitlab.opencode.de/zendis-repo-scanner → https%3A%2F%2Fgitlab.opencode.de%2Fzendis-repo-scanner).

The badge ID is the title of the badge that should be returned. The available badges and therefore the badge IDs are defined in the .badge-api.yaml of the badge api instance.

Example Request

main.go
package main
 
import (
    "fmt"
    "io"
    "net/http"
)
 
func main() {
    url := "https://scanner.zend.is/api/v1/repositories/https%3A%2F%2Fgitlab.opencode.de%2Fzendis-repo-scanner/badges/MAINTAINED"
    resp, err := http.Get(url)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    defer resp.Body.Close()
 
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}