[GH-ISSUE #552] Get project badges #402

Closed
opened 2026-02-25 23:42:19 +03:00 by kerem · 8 comments
Owner

Originally created by @rodskin on GitHub (Aug 12, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/552

Hi everyone, is there a way to get a list of project badges?

I can add my badge with:
like https://myhealthcheck.local/badge/{UUID}/{RAND}/mybadge.svg

But can't find a way to get a list of all badges available.

Thanks for reading :)

Originally created by @rodskin on GitHub (Aug 12, 2021). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/552 Hi everyone, is there a way to get a list of project badges? I can add my badge with: like https://myhealthcheck.local/badge/{UUID}/{RAND}/mybadge.svg But can't find a way to get a list of all badges available. Thanks for reading :)
kerem closed this issue 2026-02-25 23:42:19 +03:00
Author
Owner

@cuu508 commented on GitHub (Aug 12, 2021):

Hi @rodskin, are you looking for a way to get the list of badges via API?

<!-- gh-comment-id:897684037 --> @cuu508 commented on GitHub (Aug 12, 2021): Hi @rodskin, are you looking for a way to get the list of badges via API?
Author
Owner

@rodskin commented on GitHub (Aug 12, 2021):

Hi @cuu508 , indeed I am looking for a way to get my badge list via API

<!-- gh-comment-id:897687546 --> @rodskin commented on GitHub (Aug 12, 2021): Hi @cuu508 , indeed I am looking for a way to get my badge list via API
Author
Owner

@cuu508 commented on GitHub (Aug 12, 2021):

Currently there isn't an API call for that. It's possible to add but first I'd like to know more about the use case. Are you building a custom dashboard?

<!-- gh-comment-id:897694788 --> @cuu508 commented on GitHub (Aug 12, 2021): Currently there isn't an API call for that. It's possible to add but first I'd like to know more about the use case. Are you building a custom dashboard?
Author
Owner

@rodskin commented on GitHub (Aug 12, 2021):

I am making a builder that automatically creates my healthcheck project with specific tags on my server.
I then want to be able to get my badge {MY_APP_NAME} to be visible in my gitlab repository. Problem is I can't retreive the {RANDOM} string in the URL :(

<!-- gh-comment-id:897697753 --> @rodskin commented on GitHub (Aug 12, 2021): I am making a builder that automatically creates my healthcheck project with specific tags on my server. I then want to be able to get my badge {MY_APP_NAME} to be visible in my gitlab repository. Problem is I can't retreive the {RANDOM} string in the URL :(
Author
Owner

@rodskin commented on GitHub (Aug 12, 2021):

(woops missclick)

<!-- gh-comment-id:897698128 --> @rodskin commented on GitHub (Aug 12, 2021): (woops missclick)
Author
Owner

@cuu508 commented on GitHub (Aug 12, 2021):

OK, the builder would

  • use Healthchecks API to populate checks in a project
  • add a badge URL to a README file and commit it to Gitlab

Something like that?

Would you be doing this often? i.e., are we talking 1-5 projects, or potentially dozens and more? (depending on the number, it may or may not make sense to automate)

<!-- gh-comment-id:897708511 --> @cuu508 commented on GitHub (Aug 12, 2021): OK, the builder would - use Healthchecks API to populate checks in a project - add a badge URL to a README file and commit it to Gitlab Something like that? Would you be doing this often? i.e., are we talking 1-5 projects, or potentially dozens and more? (depending on the number, it may or may not make sense to automate)
Author
Owner

@rodskin commented on GitHub (Aug 12, 2021):

OK, the builder would

* use Healthchecks API to populate checks in a project

* add a badge URL to a README file and commit it to Gitlab

Something like that?

Would you be doing this often? i.e., are we talking 1-5 projects, or potentially dozens and more? (depending on the number, it may or may not make sense to automate)

Absolutely, this is the purpose.
I will have ao auto build around 100 projects and more are coming...
If it would have been 1-5 projects I know I could use the link given in my healthcheck BO but it would really be helpful to be able to get the badge url programmatically :)

<!-- gh-comment-id:897734094 --> @rodskin commented on GitHub (Aug 12, 2021): > OK, the builder would > > * use Healthchecks API to populate checks in a project > > * add a badge URL to a README file and commit it to Gitlab > > > Something like that? > > Would you be doing this often? i.e., are we talking 1-5 projects, or potentially dozens and more? (depending on the number, it may or may not make sense to automate) Absolutely, this is the purpose. I will have ao auto build around 100 projects and more are coming... If it would have been 1-5 projects I know I could use the link given in my healthcheck BO but it would really be helpful to be able to get the badge url programmatically :)
Author
Owner

@cuu508 commented on GitHub (Aug 18, 2021):

@rodskin I just pushed an experimental first implementation.

API endpoint: /api/v1/badges/

Example response body:

{
  "badges": {
    "backup": {
      "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M-2/backup.svg",
      "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M/backup.svg",
      "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M-2/backup.json",
      "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M/backup.json",
      "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M-2/backup.shields",
      "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M/backup.shields"
    },
    "db": {
      "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm-2/db.svg",
      "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm/db.svg",
      "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm-2/db.json",
      "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm/db.json",
      "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm-2/db.shields",
      "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm/db.shields"
    },
    "production": {
      "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8-2/production.svg",
      "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8/production.svg",
      "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8-2/production.json",
      "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8/production.json",
      "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8-2/production.shields",
      "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8/production.shields"
    },
    "*": {
      "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe-2.svg",
      "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe.svg",
      "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe-2.json",
      "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe.json",
      "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe-2.shields",
      "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe.shields"
    }
  }
}

API documentation is barebones at the moment and needs more work, but I wanted to get this out to see if it solves your use case.

The SVG, JSON and Shields.io URLs each has a regular and a "3" variation. The regular badges report only "up" or "down" states ("late" is reported as "up"). The svg3, json3 and shields3 report three states: "up", "late", "down".

<!-- gh-comment-id:901182999 --> @cuu508 commented on GitHub (Aug 18, 2021): @rodskin I just pushed an experimental first implementation. API endpoint: `/api/v1/badges/` Example response body: ```json { "badges": { "backup": { "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M-2/backup.svg", "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M/backup.svg", "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M-2/backup.json", "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M/backup.json", "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M-2/backup.shields", "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/LOegDs5M/backup.shields" }, "db": { "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm-2/db.svg", "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm/db.svg", "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm-2/db.json", "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm/db.json", "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm-2/db.shields", "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/99MuQaKm/db.shields" }, "production": { "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8-2/production.svg", "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8/production.svg", "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8-2/production.json", "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8/production.json", "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8-2/production.shields", "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/1TEhqie8/production.shields" }, "*": { "svg": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe-2.svg", "svg3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe.svg", "json": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe-2.json", "json3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe.json", "shields": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe-2.shields", "shields3": "https://yourdomain/badge/67541b37-8b9c-4d17-b952-690eae/9X7kcZoe.shields" } } } ``` API documentation is barebones at the moment and needs more work, but I wanted to get this out to see if it solves your use case. The SVG, JSON and Shields.io URLs each has a regular and a "3" variation. The regular badges report only "up" or "down" states ("late" is reported as "up"). The svg3, json3 and shields3 report three states: "up", "late", "down".
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#402
No description provided.