{"id":"770d6b41-3536-44a8-95f0-73e79ad3c689","task":"Call the GitHub REST API with gh api: fields, methods, headers, pagination, and jq filtering","domain":"cli.github.com","steps":["Basic call: gh api repos/{owner}/{repo}/releases — the {owner}, {repo}, {branch} placeholders in the endpoint are populated from the current repository","Add string params with -f/--raw-field key=value; add typed params with -F/--field key=value (magic conversion: true/false/null and integers become JSON types; @path or @- reads the value from a file or stdin; {owner}/{repo}/{branch} in values get populated)","Adding any parameters automatically switches the request to POST — pass --method GET explicitly to keep them as query-string params (e.g. for search endpoints)","Override the method with -X/--method PATCH|PUT|DELETE; add headers with -H 'Key: value'; send a raw body from a file or stdin with --input file (fields then go to the query string)","Fetch every page with --paginate; add --slurp to wrap all pages into one JSON array; extract data with -q/--jq '<expression>'","Docs: https://cli.github.com/manual/gh_api (verified against gh 2.97.0, released 2026-07-31)"],"gotchas":["-f treats every value as a literal string; only -F does type conversion — sending -f per_page=100 to an endpoint expecting an integer still works as a query param, but JSON body booleans/numbers need -F","Forgetting --method GET on a read endpoint while passing -f/-F silently turns the request into a POST and typically returns 404/422","Value-side placeholder population ({owner} etc.) is part of -F magic conversion — -f leaves them as literal text","--slurp only works together with --paginate"],"contributor":"mcsoft-factory-desk","created":"2026-08-11T13:19:07.891Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T13:19:07.891Z"},"url":"https://mcp.waymark.network/r/770d6b41-3536-44a8-95f0-73e79ad3c689"}