# majjha API > Public Predictions API for majjha — prediction markets for crypto, tech, esports and more. REST for requests, WebSocket for realtime order books and tickers. Base URL (live, real money): https://api.majjha.com (local dev: http://localhost:7890) Base URL (play, free play-money sandbox): https://api-play.majjha.com Environments: two sites, identical API — one login and the same user id on both, but separate balances/orders/positions. API keys are per-site. Develop against play first. Auth: Bearer token (API key prefixed `pmx_`, or a JWT). Public market data needs no auth. OpenAPI: https://docs.majjha.com/openapi.json ## Get started - [Introduction](https://docs.majjha.com/) - [Quickstart](https://docs.majjha.com/quickstart) - [Environments](https://docs.majjha.com/environments) - [Authentication](https://docs.majjha.com/authentication) ## Core concepts - [Market hierarchy](https://docs.majjha.com/concepts) - [Pagination](https://docs.majjha.com/pagination) - [Rate limits](https://docs.majjha.com/rate-limits) - [Errors](https://docs.majjha.com/errors) ## REST API - [Exchange](https://docs.majjha.com/api/exchange) - [Series](https://docs.majjha.com/api/series) - [Events](https://docs.majjha.com/api/events) - [Markets](https://docs.majjha.com/api/markets) - [Orders](https://docs.majjha.com/api/orders) - [Portfolio](https://docs.majjha.com/api/portfolio) ## Realtime - [WebSocket](https://docs.majjha.com/websocket) ## AI agents - [MCP server](https://docs.majjha.com/mcp) ## Reference - [Specifications](https://docs.majjha.com/specifications) ## Endpoints ### Exchange — Health & status - GET /api/exchange/status — Get exchange status (public) ### Series — Recurring market families - GET /api/series — List series (public) - GET /api/series/{series_ticker} — Get series (public) ### Events — Groups of related markets - GET /api/events — List events (public) - GET /api/events/{event_ticker} — Get event (public) ### Markets — Tradable YES/NO contracts - GET /api/markets — List markets (public) - GET /api/markets/{ticker} — Get market (public) - GET /api/markets/{ticker}/orderbook — Get market order book (public) - GET /api/markets/{ticker}/trades — Get market trades (public) - GET /api/markets/trades — List trades (exchange-wide) (public) - GET /api/markets/{ticker}/price-history — Get price history (public) - GET /api/markets/{ticker}/analyze — Analyze market (AI) (public) ### Orders — Place, amend & cancel - POST /api/portfolio/orders — Create order (auth) - GET /api/portfolio/orders — List orders (auth) - GET /api/portfolio/orders/{order_id} — Get order (auth) - DELETE /api/portfolio/orders/{order_id} — Cancel order (auth) - POST /api/portfolio/orders/{order_id}/amend — Amend order (auth) - POST /api/portfolio/orders/{order_id}/decrease — Decrease order (auth) - POST /api/portfolio/orders/batched — Batch create orders (auth) - DELETE /api/portfolio/orders/batched — Batch cancel orders (auth) ### Portfolio — Positions, fills, balance - GET /api/portfolio/balance — Get balance (auth) - GET /api/portfolio/positions — List positions (auth) - GET /api/portfolio/fills — List fills (auth) - GET /api/portfolio/settlements — List settlements (auth) - POST /api/portfolio/deposits — Create deposit (auth) - POST /api/portfolio/withdrawals — Create withdrawal (auth)