feat: add Polymarket and Kalshi prediction market extractors #66
Reference in New Issue
Block a user
Delete Branch "feat/prediction-markets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add Polymarket site extractor using the public Gamma REST API (no browser/Playwright needed)
Search()- text search via/public-searchendpointGetEvent()/GetMarket()- lookup by slug or numeric IDGetEventFromURL()- parsepolymarket.com/event/...URLsAdd Kalshi site extractor using the public trade API (no auth needed for reads)
Search()- fetches open events and filters client-side (Kalshi has no text search API)GetMarket()/GetEvent()- lookup by tickerGetMarketFromURL()/GetEventFromURL()- parsekalshi.com/markets/...URLsBoth include CLI tools (
sites/*/cmd/*/main.go) withsearch,event, andmarketsubcommandsBoth include comprehensive test suites using
net/http/httptest(27 tests total, all passing)Design Notes
These extractors use direct HTTP (
net/http+encoding/json) rather than the Browser interface since both platforms have free, public REST APIs. This is faster, more reliable, and doesn't require Playwright.Test plan
go build ./...compiles cleanlygo test ./sites/polymarket/...- 14 tests passgo test ./sites/kalshi/...- 13 tests passgo run ./sites/polymarket/cmd/polymarket search "olympic hockey"go run ./sites/kalshi/cmd/kalshi search "olympic hockey"🤖 Generated with Claude Code
Pull request closed