---
title: "Generate a shields.io coding-time badge for a project"
method: GET
path: "/api/v1/badge/{user_id}/{project}"
tags: ["Badges"]
---

# Generate a shields.io coding-time badge for a project

`GET /api/v1/badge/{user_id}/{project}`

Redirects (307) to an img.shields.io badge URL showing the total coding
time a user has logged on a project. The endpoint is public (no auth) but
only works for users who have not disabled public stats lookup.

`user_id` is matched, in order, against the user's Slack UID, then
username, then (only when the value is all digits) the internal numeric
ID. `project` may be a raw project name (e.g. `hackatime`) or an
`owner/repo` pair (e.g. `hackclub/hackatime`) which is resolved to a
project name via the user's repo mappings.

Any additional query parameters not consumed below (e.g. `style`, `logo`,
`logoColor`, `labelColor`) are passed straight through to shields.io.

## Path parameters

- `user_id` string, required
- `project` string, required

## Query parameters

- `label` string
- `color` string
- `aliases` string

## Other responses

- `307` — redirect to the shields.io badge image
- `400` — project has no countable coding time
- `403` — user has disabled public stats lookup
- `404` — project not found

---

[API](https://skmtc.net/hackclub/apis/hackatime-api.md) · [All operations](https://skmtc.net/hackclub/apis/hackatime-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hackclub/hackatime-api/revisions/4214f8ab061e/schema)
