{"openapi":"3.1.0","info":{"title":"Gemfinder API","version":"1.0.0","description":"Public HTTP API for Gemfinder’s collected gems, star history, and collector status. Reads are unauthenticated (the same data the UI already loads). Writes (save/hide) require `GEMFINDER_API_KEY` when that env var is set."},"servers":[{"url":"/api/v1","description":"This deployment"}],"tags":[{"name":"gems","description":"Curated collector results"},{"name":"meta","description":"Status and discovery"},{"name":"search","description":"Live GitHub search proxy"},{"name":"lane","description":"Africa / West Africa payments lane"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"GEMFINDER_API_KEY. Also accepted as X-Api-Key."}},"schemas":{"Error":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string","enum":["bad_request","unauthorized","not_found","rate_limited","upstream","misconfigured"]},"retry_after_sec":{"type":"integer"}}},"Gem":{"type":"object","properties":{"repo_id":{"type":"integer"},"github_id":{"type":"integer"},"owner":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"stars":{"type":"integer"},"forks":{"type":"integer"},"issues":{"type":"integer"},"score":{"type":"number"},"created_at":{"type":"string","format":"date-time","nullable":true},"stars_growth":{"type":"integer"},"forks_growth":{"type":"integer"},"owner_followers":{"type":"integer"},"owner_repo_count":{"type":"integer"},"velocity_badge":{"type":"string"},"prev_stars_growth":{"type":"integer"},"acceleration":{"type":"integer"},"times_seen":{"type":"integer"},"first_seen_at":{"type":"string","format":"date-time","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true},"is_saved":{"type":"boolean"},"is_hidden":{"type":"boolean"}}},"LaneRepo":{"type":"object","properties":{"github_id":{"type":"integer"},"full_name":{"type":"string"},"source_url":{"type":"string"},"velocity_badge":{"type":"string"},"first_seen_at":{"type":"string","format":"date-time","nullable":true},"last_seen_at":{"type":"string","format":"date-time","nullable":true},"last_scanned_at":{"type":"string","format":"date-time","nullable":true},"times_seen":{"type":"integer"},"country":{"type":"string","nullable":true},"country_signal":{"type":"string","nullable":true,"enum":["owner_location","company_domain_tld",null]},"tags":{"type":"array","items":{"type":"string"}},"owner_type":{"type":"string","nullable":true,"enum":["organization","individual",null]},"payment_gap":{"type":"boolean"},"why_it_matters":{"type":"string"}}}}},"paths":{"/":{"get":{"tags":["meta"],"summary":"API catalog","responses":{"200":{"description":"Endpoint index"}}}},"/openapi.json":{"get":{"tags":["meta"],"summary":"OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 spec"}}}},"/status":{"get":{"tags":["meta"],"summary":"Collector last scan, live table size, languages","description":"`last_run_at` and `last_scanned_at` are the same instant: MAX(repositories.last_scanned_at). Both names are returned so agents do not have to guess the column vs RPC name.","responses":{"200":{"description":"Status. last_run_at and last_scanned_at are identical (ISO-8601 or null)."},"429":{"description":"Rate limited"}}}},"/gems":{"get":{"tags":["gems"],"summary":"List scored gems from the collector","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Search owner, name, or description"},{"name":"lang","in":"query","schema":{"type":"string"},"description":"Language filter; omit or All for any"},{"name":"period_days","in":"query","schema":{"type":"integer","default":30}},{"name":"min_score","in":"query","schema":{"type":"integer","default":0}},{"name":"sort_by","in":"query","schema":{"type":"string","enum":["score","stars","growth","velocity","acceleration","durability","created_desc","created_asc"],"description":"`velocity` is an alias of `growth` (stars_growth from stored snapshots). Period window is period_days."}},{"name":"flag_filter","in":"query","schema":{"type":"string","enum":["default","saved","hidden","all"]}},{"name":"stars","in":"query","schema":{"type":"string","enum":["any","lt500","500-2k","2k-10k","10k+"]}},{"name":"min_stars","in":"query","schema":{"type":"integer"}},{"name":"max_stars","in":"query","schema":{"type":"integer"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"page_size","in":"query","schema":{"type":"integer","default":50,"maximum":100}}],"responses":{"200":{"description":"Page of gems"},"429":{"description":"Rate limited"},"502":{"description":"Supabase RPC failed"}}}},"/gems/{githubId}/history":{"get":{"tags":["gems"],"summary":"Star/fork snapshots for one repo","parameters":[{"name":"githubId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Time series"},"400":{"description":"Invalid id"}}}},"/gems/{githubId}/flags":{"put":{"tags":["gems"],"summary":"Save or hide a gem (global flags)","security":[{"apiKey":[]}],"parameters":[{"name":"githubId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["flag","on"],"properties":{"flag":{"type":"string","enum":["saved","hidden"]},"on":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated"},"401":{"description":"API key required"}}}},"/search":{"get":{"tags":["search"],"summary":"Live GitHub repository search (same as /api/github/search)","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"per_page","in":"query","schema":{"type":"integer"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["stars","forks","updated"]}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"GitHub search results"}}}},"/repos":{"get":{"tags":["lane"],"summary":"Search collector repos (country, tags, payment_gap)","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"country","in":"query","schema":{"type":"string"},"description":"ISO 3166-1 alpha-2 (CI, SN, NG, GH, …)"},{"name":"tags","in":"query","schema":{"type":"string"},"description":"Comma-separated lane tags: payments, fintech, dev-tool, plus rails (cinetpay, wave, paystack, …)"},{"name":"owner_type","in":"query","schema":{"type":"string","enum":["organization","individual"]},"description":"CRM filter: companies vs people"},{"name":"topics","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"min_score","in":"query","schema":{"type":"number"}},{"name":"limit","in":"query","schema":{"type":"integer","default":25,"maximum":100}},{"name":"payment_gap","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Each item has github_id, source_url, why_it_matters, country_signal, owner_type, velocity_badge, first_seen_at, last_seen_at"}}}},"/repos/{owner}/{name}":{"get":{"tags":["lane"],"summary":"One collector repo by owner/name","parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"license, last_commit, created_at, stars_forks_over_time, why_it_matters"},"404":{"description":"Not in the collector DB"}}}}}}