"""Debug: what does search/issues actually return for a key-prefix dork?""" import json import requests TOKENS = [l.strip() for l in open('gh_tokens.txt', encoding='utf-8') if l.strip().startswith('ghp_')][:5] r = requests.get( "https://api.github.com/search/issues", params={"q": "sk-ant-api03-", "per_page": 5, "sort": "updated", "order": "desc"}, headers={"Authorization": f"Bearer {TOKENS[0]}", "Accept": "application/vnd.github.text-match+json", "User-Agent": "keyfarm"}, timeout=30) print("HTTP", r.status_code) data = r.json() print("total_count:", data.get("total_count")) for it in data.get("items", [])[:3]: print("---", it.get("html_url", "?")[:70]) print(" title:", (it.get("title") or "")[:60]) body = it.get("body") or "" print(" body[:200]:", body[:200].replace("\n", " ")) tm = it.get("text_matches", []) print(" text_matches:", len(tm)) for t in tm[:2]: print(" frag:", (t.get("fragment") or "")[:120].replace("\n", " "))