{"openapi":"3.1.0","info":{"title":"ghfind API","version":"1.3.0","description":"Score any GitHub account 0-100 for value and trustworthiness with a deterministic engine, plus open-source project evaluations, roasts, head-to-head battles, leaderboards, and developer discovery. Official SDKs: `@hikariming\/ghfind` on npm and `ghfind` on PyPI.\n\n## Errors\nAll errors return `application\/json` shaped as `{ error, message, hint }` \u2014 `error` is a stable machine code, `message`\/`hint` are human-readable. See the `Error` schema.\n\n## Rate limits\nResponses carry `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` headers; a `429` and temporary request-protection `503` responses carry `Retry-After`. Write calls accept an `Idempotency-Key` request header (scans are idempotent per username).\n\n## Versioning & stability\nThe API is unversioned (`\/api\/*`) and evolves additively: new fields may be added, but existing fields are not removed or repurposed without notice. Any breaking change is announced at least 90 days in advance via the \/blog and signalled with `Deprecation` and `Sunset` response headers on affected endpoints.","termsOfService":"https:\/\/ghfind.com\/privacy","contact":{"name":"ghfind","url":"https:\/\/ghfind.com\/contact"},"license":{"name":"AGPL-3.0-or-later","url":"https:\/\/www.gnu.org\/licenses\/agpl-3.0.html"}},"servers":[{"url":"https:\/\/ghfind.com"}],"externalDocs":{"description":"llms.txt","url":"https:\/\/ghfind.com\/llms.txt"},"tags":[{"name":"scoring","description":"Deterministic 0-100 scoring (no LLM)"},{"name":"roast","description":"LLM-written roast report (bring-your-own key supported)"},{"name":"battle","description":"Head-to-head PK; deterministic winner, optional LLM commentary"},{"name":"discovery","description":"Leaderboards, developer directory, search, stats"},{"name":"projects","description":"Asynchronous Mosoo Cattle Agent evaluation of open-source projects"},{"name":"feed","description":"OAuth-only personalized feed of evaluated GitHub projects"},{"name":"images","description":"SVG badge and OG card images"}],"paths":{"\/api\/score\/{username}":{"get":{"tags":["scoring"],"operationId":"getScore","summary":"Get the deterministic score for a GitHub account","description":"Read-only, no auth, cacheable, never calls an LLM. Returns the deterministic score, tier, sub-scores, and percentile. If the account is already indexed you get the stored payload (`source: \"indexed\"`, with tags\/roast_line). Otherwise a synchronous quick scan collects and persists the result (`source: \"quick\"`, `coverage: \"complete_public\"`, includes red_flags, no LLM copy). When only an old compatible stored score exists, the response may be `source: \"legacy_v5_v5_v3\"`, `coverage: \"legacy\"`, `stale: true`. The only 404 is a GitHub login that does not exist. Rate limited per IP.","parameters":[{"name":"username","in":"path","required":true,"description":"GitHub login (case-insensitive)","schema":{"type":"string"}}],"responses":{"200":{"description":"Score payload (indexed, quick-worker scored, or legacy fallback)","headers":{"RateLimit-Limit":{"$ref":"#\/components\/headers\/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#\/components\/headers\/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#\/components\/headers\/RateLimit-Reset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ScorePayload"}}}},"400":{"description":"Invalid username","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"GitHub account does not exist","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited (quick scoring path)","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"GitHub or request protection temporarily unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/scan":{"post":{"tags":["scoring"],"operationId":"scan","summary":"Run a bounded GitHub scan and compute the deterministic score","description":"Bounded factual payload: metrics, repo\/PR signals, sub_scores, red_flags, and final_score. Deterministic \u2014 no LLM. Cached snapshots and verified indexed v10 rows replay instantly as 200; `?force=1` bypasses the cache for a rescan. A cold GitHub collect that needs more than the interactive deadline returns 202 `scan_pending` with `Retry-After` and `Location: \/api\/scan?username=\u2026` \u2014 poll GET until 200. The admitted owner keeps collecting in the background (ScanSlot alarm, not waitUntil). When GitHub is busy or unavailable the route may return HTTP 200 with `stale: true` from a previous snapshot. In production, machine callers send `Authorization: Bearer <api-key>`; browser callers pass a Cloudflare Turnstile token.","security":[{"bearerAuth":[]},{}],"parameters":[{"$ref":"#\/components\/parameters\/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["username"],"properties":{"username":{"type":"string","description":"GitHub login"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token (browser callers)"}}}}}},"responses":{"200":{"description":"Full scan result","headers":{"RateLimit-Limit":{"$ref":"#\/components\/headers\/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#\/components\/headers\/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#\/components\/headers\/RateLimit-Reset"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ScanResult"}}}},"202":{"description":"Cold GitHub collect still running (`scan_pending`). Poll `Location` or GET `\/api\/scan?username=` until 200.","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"},"Location":{"description":"GET URL to poll for the finished scan","schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"400":{"description":"Invalid body or username","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"401":{"description":"Invalid API key","headers":{"WWW-Authenticate":{"description":"Bearer challenge pointing at protected-resource metadata","schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"403":{"description":"Turnstile verification failed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"GitHub account not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"Scan busy, GitHub unavailable, leftover collect deadline, or request protection temporarily unavailable (`scan_busy`, `github_unavailable`, `github_collect_deadline`)","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"get":{"tags":["scoring"],"operationId":"scanStatus","summary":"Poll a deferred scan without starting a new GitHub collect","description":"Read-only. Returns the cached or indexed snapshot as 200, 202 `scan_pending` while the admitted owner is still collecting, a terminal scan error after a failed collect, or 404 `not_scored` when nothing is in flight.","parameters":[{"name":"username","in":"query","required":true,"schema":{"type":"string"},"description":"GitHub login"}],"responses":{"200":{"description":"Full scan result","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ScanResult"}}}},"202":{"description":"`scan_pending` \u2014 poll again after Retry-After","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"No snapshot and no in-flight collect","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/project-analyses":{"post":{"tags":["projects"],"operationId":"createProjectAnalysis","summary":"Reuse or start an evidence-backed open-source project evaluation","description":"Returns a matching persisted result before creating an asynchronous Mosoo Cattle Agent task. Product value is scored independently from Stars, company backing, code volume, and contributor count. Unknown public repositories receive source inspection only; code execution is restricted to a server allowlist.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["repositoryUrl"],"properties":{"repositoryUrl":{"type":"string","description":"Public GitHub URL or owner\/repository"},"ref":{"type":["string","null"],"description":"Optional branch, tag, or commit"}}}}}},"responses":{"200":{"description":"Matching completed result loaded from durable persistence","headers":{"Location":{"description":"Endpoint for the persisted analysis","schema":{"type":"string"}},"Idempotency-Key":{"description":"Stable analysis task key","schema":{"type":"string"}},"X-Project-Analysis-Reused":{"description":"Always true for a persisted replay","schema":{"type":"string","enum":["true"]}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectAnalysisAccepted"}}}},"202":{"description":"Task created or deduplicated against an active task","headers":{"Location":{"description":"Polling endpoint for this analysis","schema":{"type":"string"}},"Idempotency-Key":{"description":"Stable Mosoo task key","schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectAnalysisAccepted"}}}},"400":{"description":"Invalid repository, ref, or request body","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Per-IP project-analysis quota exceeded","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"Persistence or Mosoo execution layer unavailable","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/project-analyses\/{analysisId}":{"get":{"tags":["projects"],"operationId":"getProjectAnalysis","summary":"Read project-evaluation progress or the persisted result","parameters":[{"name":"analysisId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Curated status; completed tasks include the current assessment and treasure history","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ProjectAnalysisView"}}}},"404":{"description":"Analysis not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/feed\/tags":{"get":{"tags":["feed"],"operationId":"getFeedTags","summary":"Get the active governed Feed taxonomy","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"Canonical tags and the optimistic-concurrency taxonomy version","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedTagsResponse"}}}},"401":{"description":"GitHub OAuth session required","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"Feed storage unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/feed\/preferences":{"get":{"tags":["feed"],"operationId":"getFeedPreferences","summary":"Get explicit preferences and a weak-profile summary","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"Current Feed profile","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedPreferencesResponse"}}}},"401":{"description":"GitHub OAuth session required"},"429":{"description":"Rate limited","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}},"503":{"description":"Feed storage unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}}}},"put":{"tags":["feed"],"operationId":"replaceFeedPreferences","summary":"Atomically replace at most 30 explicit tag preferences","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["taxonomyVersion","preferences"],"properties":{"taxonomyVersion":{"type":"integer"},"preferences":{"type":"array","maxItems":30,"items":{"$ref":"#\/components\/schemas\/FeedPreferenceInput"}}}}}}},"responses":{"200":{"description":"Updated Feed profile","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedPreferencesResponse"}}}},"400":{"description":"Invalid or non-canonical tags"},"401":{"description":"GitHub OAuth session required"},"409":{"description":"Taxonomy version changed; refetch tags"},"429":{"description":"Rate limited"},"503":{"description":"Feed storage unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}}}}},"\/api\/feed\/tags\/proposals":{"post":{"tags":["feed"],"operationId":"proposeFeedTag","summary":"Propose a governed project tag for review","description":"Requires the independent Feed runtime. A proposal never creates a canonical tag or grants moderation authority. Replaying the same id and content returns its current moderation status.","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedTagProposalInput"}}}},"responses":{"202":{"description":"Proposal persisted for review","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedTagProposalResult"}}}},"400":{"description":"Invalid proposal or unknown fields"},"401":{"description":"GitHub OAuth session required"},"404":{"description":"Project not in Feed catalog"},"409":{"description":"Proposal ID reused with different content"},"503":{"description":"Feed unavailable"}}}},"\/api\/feed\/projects":{"get":{"tags":["feed"],"operationId":"getProjectFeed","summary":"Get one deterministic personalized Feed page","description":"The signed cursor pins a 30-minute, profile-versioned deterministic candidate sequence. Every item carries a principal-bound impression token required for behavior events.","security":[{"sessionCookie":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque signed cursor from nextCursor"}],"responses":{"200":{"description":"Personalized Feed page","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedProjectsResponse"}}}},"401":{"description":"GitHub OAuth session required"},"410":{"description":"Cursor expired; start a new stream"},"503":{"description":"Feed D1 storage unavailable; unrelated APIs remain available","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}}}}},"\/api\/feed\/projects\/{owner}\/{repo}\/state":{"put":{"tags":["feed"],"operationId":"updateFeedProjectState","summary":"Idempotently update saved or not-interested state","security":[{"sessionCookie":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","description":"Exactly one of saved\/notInterested may be present","properties":{"saved":{"type":"boolean"},"notInterested":{"type":"boolean"},"impressionToken":{"type":"string"}}}}}},"responses":{"200":{"description":"Durable current state","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedProjectState"}}}},"400":{"description":"Invalid one-field patch or impression token"},"401":{"description":"GitHub OAuth session required"},"404":{"description":"Project not in Feed catalog"},"429":{"description":"Rate limited"},"503":{"description":"Feed storage unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}}}}},"\/api\/feed\/events":{"post":{"tags":["feed"],"operationId":"appendFeedEvents","summary":"Append an idempotent batch of impression and engagement facts","description":"Clients emit impression only after at least 50% visibility for one second. Event UUIDs are globally idempotent; arbitrary metadata is not accepted.","security":[{"sessionCookie":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#\/components\/schemas\/FeedEventInput"}}}}}}},"responses":{"202":{"description":"Immutable event facts committed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedEventAppendResult"}}}},"400":{"description":"Invalid event, time, type, or impression token"},"401":{"description":"GitHub OAuth session required"},"429":{"description":"Rate limited"},"503":{"description":"Event storage unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}}}}},"\/api\/feed\/profile":{"delete":{"tags":["feed"],"operationId":"deleteFeedProfile","summary":"Fence a Feed profile and request durable cleanup","description":"The independent runtime invalidates previous sessions and writes before cleanup. Poll the caller-owned deletion status; queued does not mean archives or indexes are already erased.","security":[{"sessionCookie":[]}],"responses":{"200":{"description":"Legacy runtime synchronous deletion","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedProfileDeletion"}}}},"202":{"description":"Deletion fenced and cleanup queued","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedProfileDeletion"}}}},"401":{"description":"GitHub OAuth session required"},"503":{"description":"Feed storage unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}}}}}},"\/api\/feed\/profile\/deletions\/{id}":{"get":{"tags":["feed"],"operationId":"getFeedDeletion","summary":"Read your Feed deletion progress","security":[{"sessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Durable cleanup state across all required sinks","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FeedProfileDeletion"}}}},"401":{"description":"GitHub OAuth session required"},"404":{"description":"Unknown or another user's deletion"},"503":{"description":"Deletion status storage unavailable"}}}},"\/api\/roast":{"post":{"tags":["roast"],"operationId":"roast","summary":"Generate the human-facing roast report + AI-adjusted score (streaming)","description":"Takes a scan (or a username to reuse a cached scan) and streams a markdown roast report plus meta (final_score, tier, delta, percentile, tags, roast_line). The only LLM endpoint for scoring: the model may adjust the deterministic score by a bounded \u00b110. Pass `byoKey` to use your own OpenAI-compatible provider instead of the server model. Response is a text\/plain stream using an in-band frame protocol (0x1f prefix: T=progress, M=base64 meta, E=error); meta is also returned in the `X-Roast-Meta` header (base64 JSON).","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"scan":{"$ref":"#\/components\/schemas\/ScanResult"},"username":{"type":"string","description":"Use a server-cached scan instead of passing `scan`"},"lang":{"type":"string","enum":["zh","en"]},"byoKey":{"type":"object","description":"Bring-your-own OpenAI-compatible LLM provider","properties":{"baseURL":{"type":"string"},"apiKey":{"type":"string"},"model":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Streamed roast report","content":{"text\/plain":{"schema":{"type":"string"}}}},"400":{"description":"Missing scan \/ no LLM configured","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"409":{"description":"The supplied scan does not match a persisted current score","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"503":{"description":"Request protection temporarily unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/vs-verdict":{"post":{"tags":["battle"],"operationId":"vsVerdict","summary":"Head-to-head verdict for two scored accounts","description":"Both accounts must already be scored. The winner and gap bucket are deterministic; a bilingual savage verdict + self-improvement advice are added by the LLM only when both sides clear the floor and the pairing is not cached.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string"},"b":{"type":"string"}}}}}},"responses":{"200":{"description":"Verdict (verdict may be null when below the LLM floor or cached)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VsVerdictResponse"}}}},"400":{"description":"Invalid pair","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"One or both accounts not scored","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Verdict generation rate limited","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VsVerdictResponse"}}}},"503":{"description":"Request protection temporarily unavailable","headers":{"Retry-After":{"$ref":"#\/components\/headers\/Retry-After"}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VsVerdictResponse"}}}}}}},"\/api\/leaderboard":{"get":{"tags":["discovery"],"operationId":"leaderboard","summary":"Ranked public profiles (Hall of Fame \/ trending \/ heat \/ progress)","parameters":[{"name":"view","in":"query","schema":{"type":"string","enum":["trending","score","heat","progress"]}},{"name":"window","in":"query","schema":{"type":"string","enum":["all","24h","7d","30d"]}},{"$ref":"#\/components\/parameters\/Limit"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"description":"Ranked entries","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LeaderboardResponse"}}}}}}},"\/api\/developers":{"get":{"tags":["discovery"],"operationId":"developers","summary":"Discover developers by language, organization, or contributed repo","parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["language","org","repo"]}},{"name":"value","in":"query","schema":{"type":"string"},"description":"Facet value; omit to list categories"},{"$ref":"#\/components\/parameters\/Limit"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"description":"Facet categories or entries","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DevelopersResponse"}}}},"400":{"description":"Invalid type","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/search-users":{"get":{"tags":["discovery"],"operationId":"searchUsers","summary":"Prefix autocomplete over scored accounts","parameters":[{"name":"q","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Up to 6 matching users","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SearchResponse"}}}}}}},"\/api\/stats":{"get":{"tags":["discovery"],"operationId":"stats","summary":"Platform totals (number of scored accounts)","responses":{"200":{"description":"Aggregate counts","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/StatsResponse"}}}}}}},"\/api\/badge\/{username}":{"get":{"tags":["images"],"operationId":"badge","summary":"SVG score badge for a README","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string"}},{"name":"lang","in":"query","schema":{"type":"string","enum":["zh","en"]}}],"responses":{"200":{"description":"SVG image","content":{"image\/svg+xml":{}}}}}},"\/api\/card\/{username}":{"get":{"tags":["images"],"operationId":"card","summary":"1200x630 OG PNG card for an account","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string"}},{"name":"theme","in":"query","schema":{"type":"string","enum":["dark","light"]}},{"name":"variant","in":"query","description":"Specialty brag card; omit for the score card.","schema":{"type":"string","enum":["score","contrib","pr","path","work"]}},{"name":"qr","in":"query","description":"Set to 1 for a scannable QR.","schema":{"type":"string"}}],"responses":{"200":{"description":"PNG image","content":{"image\/png":{}}}}}},"\/api\/card\/mini\/{username}":{"get":{"tags":["images"],"operationId":"miniCard","summary":"README-sized SVG card (440x215 bars, 440x200 radar, 420x88 strip)","description":"Always 200: an unrated or unknown account renders a placeholder card at the same size, so an embedded image never breaks.","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string"}},{"name":"variant","in":"query","description":"bars is 440x215, radar is 440x200, strip is 420x88.","schema":{"type":"string","enum":["bars","radar","strip"],"default":"bars"}},{"name":"theme","in":"query","description":"auto embeds a prefers-color-scheme block so one URL suits both GitHub themes.","schema":{"type":"string","enum":["auto","dark","light"],"default":"auto"}},{"name":"lang","in":"query","schema":{"type":"string","enum":["en","zh"],"default":"en"}}],"responses":{"200":{"description":"SVG image","content":{"image\/svg+xml":{}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Machine API key (GITHUB_ROAST_CLI_API_KEY)"},"sessionCookie":{"type":"apiKey","in":"cookie","name":"ghfind_session","description":"Signed GitHub OAuth session cookie"}},"parameters":{"Limit":{"name":"limit","in":"query","required":false,"description":"Page size (1-500). Defaults to the full list so legacy callers are unaffected.","schema":{"type":"integer","minimum":1,"maximum":500}},"Offset":{"name":"offset","in":"query","required":false,"description":"Zero-based index of the first entry to return. Walk pages via `nextOffset`.","schema":{"type":"integer","minimum":0,"default":0}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-supplied key echoed back on the response; scans are idempotent per username, so a retried request is safe.","schema":{"type":"string"}}},"headers":{"RateLimit-Limit":{"description":"Request quota for the window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests remaining in the window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the window resets","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying (on retryable 429\/503 responses)","schema":{"type":"integer"}}},"schemas":{"FeedTag":{"type":"object","required":["id","namespace","slug","labelZh","labelEn","taxonomyVersion"],"properties":{"id":{"type":"string","example":"domain:developer-tools"},"namespace":{"type":"string","enum":["domain","use_case","audience","artifact","stack","stage"]},"slug":{"type":"string"},"labelZh":{"type":"string"},"labelEn":{"type":"string"},"description":{"type":"string"},"taxonomyVersion":{"type":"integer"}}},"FeedTagsResponse":{"type":"object","required":["taxonomyVersion","tags"],"properties":{"taxonomyVersion":{"type":"integer"},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/FeedTag"}}}},"FeedPreferenceInput":{"type":"object","required":["tagId","value"],"properties":{"tagId":{"type":"string"},"value":{"type":"integer","enum":[-1,1]}}},"FeedPreference":{"type":"object","required":["tagId","value","source","strength","taxonomyVersion"],"properties":{"tagId":{"type":"string"},"value":{"type":"integer","enum":[-1,1]},"source":{"type":"string","enum":["explicit","graph","behavior"]},"strength":{"type":"number","minimum":0,"maximum":1},"taxonomyVersion":{"type":"integer"}}},"FeedPreferencesResponse":{"type":"object","required":["taxonomyVersion","profileVersion","preferences","weakProfile"],"properties":{"taxonomyVersion":{"type":"integer"},"profileVersion":{"type":"integer"},"preferences":{"type":"array","items":{"$ref":"#\/components\/schemas\/FeedPreference"}},"weakProfile":{"type":"object","required":["positiveTags","negativeTags","weakSignals"],"properties":{"positiveTags":{"type":"integer"},"negativeTags":{"type":"integer"},"weakSignals":{"type":"integer"}}}}},"FeedProject":{"type":"object","required":["repoKey","ownerLogin","name","canonicalUrl","summary","language","topics","projectType","lifecycle","productScore","confidence","verificationLevel","exposureBand","treasureEligible","classicEligible","analyzedAt","tags"],"properties":{"repoKey":{"type":"string","example":"owner\/repository"},"ownerLogin":{"type":"string"},"name":{"type":"string"},"canonicalUrl":{"type":"string","format":"uri"},"summary":{"type":"string"},"language":{"type":["string","null"]},"topics":{"type":"array","items":{"type":"string"}},"projectType":{"type":"string"},"lifecycle":{"type":"string"},"productScore":{"type":"number","minimum":0,"maximum":100},"confidence":{"type":"number","minimum":0,"maximum":100},"verificationLevel":{"type":"string"},"exposureBand":{"type":"string"},"treasureEligible":{"type":"boolean"},"classicEligible":{"type":"boolean"},"analyzedAt":{"type":"string","format":"date-time"},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/FeedTag"}}}},"FeedItem":{"type":"object","required":["project","reasonCodes","impressionToken"],"properties":{"project":{"$ref":"#\/components\/schemas\/FeedProject"},"reasonCodes":{"type":"array","items":{"type":"string","enum":["matches_tags","similar_to_saved","high_product_value","newly_evaluated","long_tail_discovery","catalog_discovery"]}},"impressionToken":{"type":"string"}}},"FeedProjectsResponse":{"type":"object","required":["requestId","algorithmVersion","taxonomyVersion","items","degraded"],"properties":{"requestId":{"type":"string"},"algorithmVersion":{"type":"string","example":"baseline-v1"},"taxonomyVersion":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/FeedItem"}},"nextCursor":{"type":["string","null"]},"degraded":{"type":"array","items":{"type":"string","enum":["cursor_store_unavailable","gorse_unavailable","gorse_hydration_unavailable"]}}}},"FeedEventInput":{"type":"object","additionalProperties":false,"required":["id","type","repoKey","occurredAt","impressionToken"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["impression","detail_open","dwell","github_outbound","share"]},"repoKey":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"impressionToken":{"type":"string"},"durationMs":{"type":"integer","minimum":0,"maximum":1800000}}},"FeedProjectState":{"type":"object","required":["repoKey","saved","notInterested"],"properties":{"repoKey":{"type":"string"},"saved":{"type":"boolean"},"notInterested":{"type":"boolean"}}},"FeedEventAppendResult":{"type":"object","required":["accepted","duplicate"],"properties":{"accepted":{"type":"integer","minimum":0},"duplicate":{"type":"integer","minimum":0}}},"FeedProfileDeletion":{"type":"object","required":["deletionId","status"],"properties":{"deletionId":{"type":"string"},"status":{"type":"string","enum":["queued","running","failed","completed"]}}},"FeedTagProposalInput":{"type":"object","additionalProperties":false,"required":["id","repoKey","namespace","slug","evidence"],"description":"At least one label must be non-empty; labels are bounded to 160 UTF-8 bytes and each evidence entry to 256 UTF-8 bytes.","properties":{"id":{"type":"string","format":"uuid"},"repoKey":{"type":"string"},"namespace":{"type":"string","enum":["domain","use_case","audience","artifact","stack","stage"]},"slug":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","maxLength":80},"labelZh":{"type":"string","maxLength":160},"labelEn":{"type":"string","maxLength":160},"evidence":{"type":"array","minItems":1,"maxItems":16,"items":{"type":"string","minLength":1,"maxLength":256}}}},"FeedTagProposalResult":{"type":"object","required":["proposalId","status"],"properties":{"proposalId":{"type":"string"},"status":{"type":"string","enum":["proposed","mapped","rejected","superseded"]}}},"Error":{"type":"object","required":["error"],"description":"Structured error. `error` is a stable machine code; `message`\/`hint` are human-readable.","properties":{"error":{"type":"string","description":"Machine-readable error code","enum":["invalid_body","invalid_username","turnstile_failed","rate_limited","rate_limit_unavailable","account_not_found","github_rate_limited","github_unavailable","github_collect_deadline","scan_pending","scan_busy","scan_failed","not_scored","unauthorized","invalid_type","invalid_job_id","not_found","scan_result_unavailable","invalid_repository","invalid_ref","analysis_not_found","analysis_timeout","artifact_missing","artifact_invalid","unexpected_input_request","mosoo_unavailable","authentication_required","feed_disabled","feed_not_enabled","feed_unavailable","feed_cursor_expired","invalid_cursor","invalid_pagination","invalid_impression_token","taxonomy_version_changed","invalid_preferences","invalid_state_patch","project_not_found","invalid_events","feed_events_unavailable","rate_limit_unavailable","stale_tag_proposal"]},"message":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer","description":"Present on some 429\/503 responses"}}},"LeaderboardEntry":{"type":"object","properties":{"username":{"type":"string"},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"profile_url":{"type":"string","nullable":true},"final_score":{"type":"number"},"tier":{"type":"string"}}},"LeaderboardResponse":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#\/components\/schemas\/LeaderboardEntry"}},"cached":{"type":"boolean"},"view":{"type":"string","enum":["trending","score","heat","progress"]},"window":{"type":"string","enum":["all","24h","7d","30d"]},"total":{"type":"integer","description":"Total entries across all pages"},"limit":{"type":"integer"},"offset":{"type":"integer"},"nextOffset":{"type":"integer","nullable":true,"description":"Offset for the next page, or null when exhausted"}}},"DevelopersResponse":{"type":"object","properties":{"type":{"type":"string","enum":["language","org","repo"]},"value":{"type":"string","nullable":true},"entries":{"type":"array","items":{"$ref":"#\/components\/schemas\/LeaderboardEntry"}},"categories":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer"}}}},"total":{"type":"integer","description":"Total entries (or categories) across all pages"},"limit":{"type":"integer"},"offset":{"type":"integer"},"nextOffset":{"type":"integer","nullable":true,"description":"Offset for the next page, or null when exhausted"}}},"SearchResponse":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"username":{"type":"string"},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"final_score":{"type":"number"}}}}}},"StatsResponse":{"type":"object","properties":{"total":{"type":"integer","nullable":true,"description":"Number of scored accounts"},"cached":{"type":"boolean"}}},"ProjectAnalysisAccepted":{"type":"object","required":["analysisId","repoKey","status","phase","progress","retry","statusUrl"],"properties":{"analysisId":{"type":"string","format":"uuid"},"repoKey":{"type":"string","example":"owner\/repository"},"status":{"$ref":"#\/components\/schemas\/ProjectAnalysisStatus"},"phase":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"retry":{"$ref":"#\/components\/schemas\/ProjectAnalysisRetry"},"statusUrl":{"type":"string"},"reused":{"type":"boolean","description":"True when an existing completed result was replayed"}}},"ProjectAnalysisStatus":{"type":"string","enum":["queued","creating_thread","running","finalizing","completed","failed","cancelled","expired"]},"ProjectAnalysisRetry":{"anyOf":[{"type":"object","required":["attempt","maxAttempts","nextAttemptAt"],"properties":{"attempt":{"type":"integer","minimum":1},"maxAttempts":{"type":"integer","minimum":1},"nextAttemptAt":{"type":"integer","description":"Epoch milliseconds"}}},{"type":"null"}]},"ProjectAnalysisView":{"type":"object","required":["analysisId","repoKey","canonicalUrl","status","phase","progress","retry","createdAt","updatedAt"],"properties":{"analysisId":{"type":"string","format":"uuid"},"repoKey":{"type":"string"},"canonicalUrl":{"type":"string","format":"uri"},"requestedRef":{"type":["string","null"]},"status":{"$ref":"#\/components\/schemas\/ProjectAnalysisStatus"},"phase":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"retry":{"$ref":"#\/components\/schemas\/ProjectAnalysisRetry"},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"createdAt":{"type":"integer","description":"Epoch milliseconds"},"updatedAt":{"type":"integer","description":"Epoch milliseconds"},"completedAt":{"type":["integer","null"]},"assessment":{"type":["object","null"],"description":"Validated product score, four dimensions, confidence, verification, community strength, exposure, risks, report, and exact commit identity."},"treasureHistory":{"type":"array","items":{"type":"object"}}}},"VsVerdictResponse":{"type":"object","properties":{"a":{"type":"string"},"b":{"type":"string"},"winner":{"type":"string","nullable":true},"bucket":{"type":"string"},"verdict":{"type":"object","nullable":true,"properties":{"zh":{"type":"string"},"en":{"type":"string"}}}}},"RiskEvidence":{"type":"object","properties":{"observed":{"type":"object","additionalProperties":true},"sample_size":{"type":"number"},"threshold":{"type":"object","additionalProperties":{"type":"number"}},"coverage":{"type":"object","additionalProperties":{"type":"number"}},"window":{"type":"string"}}},"RiskSignal":{"type":"object","properties":{"flag":{"type":"string"},"family":{"type":"string","enum":["footprint","contribution","social"]},"disposition":{"type":"string","enum":["penalty","note"]},"severity":{"type":"number","minimum":0,"maximum":1},"confidence":{"type":"number","minimum":0,"maximum":1},"penalty":{"type":"number","minimum":0,"maximum":40},"detail":{"type":"string"},"evidence":{"$ref":"#\/components\/schemas\/RiskEvidence"}}},"RiskAssessment":{"type":"object","properties":{"version":{"type":"string","enum":["v9","v10"]},"risk_score":{"type":"number","minimum":0,"maximum":100},"level":{"type":"string","enum":["none","review","high"]},"confidence":{"type":"number","minimum":0,"maximum":100},"applied_penalty":{"type":"number","minimum":0,"maximum":40,"description":"Flat v9 policy caps at 40; v10 policy caps at 25."},"signals":{"type":"array","items":{"$ref":"#\/components\/schemas\/RiskSignal"}},"coverage":{"type":"object","properties":{"repo":{"type":"number","minimum":0,"maximum":1},"merged_pr":{"type":"number","minimum":0,"maximum":1},"all_pr":{"type":"number","minimum":0,"maximum":1}}}}},"ScorePayload":{"type":"object","properties":{"source":{"type":"string","enum":["indexed","quick","legacy_v5_v5_v3"],"description":"indexed = current stored score; quick = current deterministic worker scan; legacy_v5_v5_v3 = compatible stale fallback"},"coverage":{"type":"string","enum":["quick","partial_public","complete_public","legacy"],"description":"Observed collection coverage; quick for historical bounded snapshots, legacy for prior-collection artifacts"},"stale":{"type":"boolean","description":"true only for compatible legacy fallback scores"},"cached":{"type":"boolean","description":"quick path only: served from the scan cache"},"red_flags":{"type":"array","description":"quick path only: deterministic penalties","items":{"type":"object","properties":{"flag":{"type":"string"},"penalty":{"type":"number"},"detail":{"type":"string"}}}},"base_score":{"type":"number","minimum":0,"maximum":100},"total_penalty":{"type":"number","minimum":0,"maximum":40},"risk_assessment":{"$ref":"#\/components\/schemas\/RiskAssessment"},"risk_notes":{"type":"array","items":{"$ref":"#\/components\/schemas\/RiskSignal"}},"username":{"type":"string"},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"profile_url":{"type":"string"},"final_score":{"type":"number","description":"0-100, 2 decimals"},"tier":{"type":"string","enum":["\u592f","\u9876\u7ea7","\u4eba\u4e0a\u4eba","NPC","\u62c9\u5b8c\u4e86"]},"tier_key":{"type":"string","enum":["god","elite","solid","npc","trash"]},"sub_scores":{"$ref":"#\/components\/schemas\/SubScores"},"tags":{"type":"object","nullable":true,"properties":{"zh":{"type":"array","items":{"type":"string"}},"en":{"type":"array","items":{"type":"string"}}}},"roast_line":{"type":"object","nullable":true,"properties":{"zh":{"type":"string"},"en":{"type":"string"}}},"percentile":{"type":"object","nullable":true,"properties":{"beat":{"type":"number","nullable":true,"description":"Percent of ranked accounts beaten"},"total":{"type":"integer"},"rank":{"type":"integer","nullable":true}}},"scanned_at":{"type":"integer","description":"Epoch ms of last score"},"profile":{"type":"string","description":"Human profile URL on ghfind.com"}}},"SubScores":{"type":"object","properties":{"account_maturity":{"type":"number"},"original_project_quality":{"type":"number"},"contribution_quality":{"type":"number"},"ecosystem_impact":{"type":"number"},"community_influence":{"type":"number"},"activity_authenticity":{"type":"number"}}},"Scoring":{"type":"object","properties":{"sub_scores":{"$ref":"#\/components\/schemas\/SubScores"},"base_score":{"type":"number"},"red_flags":{"type":"array","items":{"type":"object","properties":{"flag":{"type":"string"},"penalty":{"type":"number"},"detail":{"type":"string"}}}},"risk_assessment":{"$ref":"#\/components\/schemas\/RiskAssessment"},"risk_notes":{"type":"array","items":{"$ref":"#\/components\/schemas\/RiskSignal"}},"total_penalty":{"type":"number"},"final_score":{"type":"number"},"tier":{"type":"string"},"tier_label":{"type":"string"}}},"ScanResult":{"type":"object","description":"Full scan payload \u2014 identical shape to the open-source github-account-value skill output.","properties":{"metrics":{"type":"object","description":"Raw GitHub-derived metrics (snake_case)"},"top_repos":{"type":"array","items":{"type":"object"}},"recent_prs":{"type":"array","items":{"type":"object"}},"flood_pr_titles":{"type":"array","items":{"type":"string"}},"impact_repos":{"type":"array","items":{"type":"object"}},"scoring":{"$ref":"#\/components\/schemas\/Scoring"}}}}}}