Repo Stats Cards

API

The app's server function returns one JSON snapshot of a public GitHub account or repository, and makes signed live card links for READMEs. It is free and needs a SkillSafe app token for this app. Guest tokens are refused. Live card images themselves are public.

1. Get a token

Exchange your SkillSafe API key for an app token (valid 30 days).

curl -s -X POST https://api.skillsafe.ai/v1/app-api/authorize \
  -H "Authorization: Bearer YOUR_SKILLSAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"repo-stats-cards"}'
# -> {"ok":true,"data":{"token":"aut_...","expires_at":"..."}}

2. Fetch a snapshot

GET https://repo-stats-cards.skillsafe.ai/api/user?login=LOGIN or GET https://repo-stats-cards.skillsafe.ai/api/repo?repo=OWNER/NAME. Add &fresh=1 to skip the server's cache.

curl -s "https://repo-stats-cards.skillsafe.ai/api/repo?repo=pallets/flask" \
  -H "Authorization: Bearer YOUR_APP_TOKEN"

3. Make a live README card

POST https://repo-stats-cards.skillsafe.ai/api/embed with an app token and a JSON body {"kind":"user"|"repo","target":"LOGIN"|"OWNER/NAME","card":CARD,"theme":THEME,"options":{"hideBorder":false,"hideTitle":false,"langBy":"repos"}}. The server checks the account or repository on GitHub and returns {id, url, markdown, html, target, card, theme, refresh_hours}.

curl -s -X POST "https://repo-stats-cards.skillsafe.ai/api/embed" \
  -H "Authorization: Bearer YOUR_APP_TOKEN" -H "Content-Type: application/json" \
  -d '{"kind":"repo","target":"pallets/flask","card":"repo","theme":"auto"}'
# -> {"id":"eyJ2Ijox...","url":"https://repo-stats-cards.skillsafe.ai/api/card/eyJ2Ijox....svg","markdown":"[![...](...)](...)",...}

Errors

StatusMeaning
400bad_login or bad_repo: not a valid GitHub username or owner/name; bad_request or bad_json (/api/embed): an unknown kind, card, theme or option
401No token, a guest token, or an expired token
404not_found: no public account or repository with that name
429rate_limited: GitHub's hourly limit for the server is used up; reset is when it refills (Unix time)
502GitHub did not answer or answered with an error
503not_configured (/api/embed): live cards are not switched on for this server

Errors come back as {"error":{"code","message"}}. Data: GitHub REST API, public endpoints only. Not affiliated with GitHub.