Skip to content

Market operations

from ig_trading_lib.operations.markets import CategoryInstrumentsQuery

with IG(config) as ig:
    matches = ig.operations.markets.search("EUR/USD")
    market = ig.operations.markets.get(matches.markets[0].epic)
    prices = ig.operations.prices.list_points(market.instrument.epic, "MINUTE", 60)
    instruments = ig.operations.categories.list_instruments(
        "FX",
        CategoryInstrumentsQuery(page_size=100),
    )

Categories, discovery, details, and prices are separate faithful namespaces. The discovery workflow adds exact-epic selection without duplicating protocol knowledge.

Python operation IG request Protocol version
ig.operations.categories.list() GET /categories 1
ig.operations.categories.list_instruments() GET /categories/{category_id}/instruments 1
ig.operations.markets.list() GET /markets 2
ig.operations.markets.search() GET /markets 1
ig.operations.markets.get() GET /markets/{epic} 4
ig.operations.prices.list() GET /prices/{epic} 3
ig.operations.prices.list_points() GET /prices/{epic}/{resolution}/{num_points} 2
ig.operations.prices.list_date_range() GET /prices/{epic}/{resolution}/{start_date}/{end_date} 2