Fetch all markets
hip4.events.fetchMarkets() returns a flat HIP4Market[] array covering all active outcomes.
Filter by type
Pass atype filter to narrow results to a specific market category.
Group by type
UsegroupBy: "type" to receive a MarketsByType object with one key per market category.
Group multi-outcome markets by question
Multi-outcome markets share a parent question. Grouping by question returns aMarketsByQuestion object keyed by question ID (or "standalone" for unclaimed outcomes).
Paginate results
Uselimit and offset to page through large result sets.
Sort results
Control the order of returned markets withsortBy.
Access typed fields on DefaultBinaryMarket
Each market type exposes fields specific to its category.DefaultBinaryMarket includes the parsed description fields you need for display and filtering.
Fetch events and categories
Markets belong to events. You can query at the event level when you need the full context-title, description, volume, status, and the markets list together.Event and outcome metadata is cached for 30 seconds. Subsequent calls within that window return the cached result without hitting the network.