{"openapi":"3.1.0","info":{"title":"Royal Exchange ChatGPT API","version":"1.0.0","description":"Compact, public, strictly read-only access to the simulated Royal Exchange market. It cannot place trades or write Minecraft, gameplay, or market state."},"servers":[{"url":"https://royalexchange.net"}],"paths":{"/api/v1/overview":{"get":{"operationId":"getRoyalExchangeOverview","summary":"Get the compact current market overview","description":"Use for broad questions about the composite, breadth, current notices, volume, or largest movers. Do not use it to look up every issuer.","parameters":[{"name":"moverLimit","in":"query","schema":{"type":"integer","minimum":1,"maximum":10,"default":5}}],"responses":{"200":{"description":"Current compact market overview.","content":{"application/json":{"schema":{"type":"object","required":["meta","largestMoves"],"properties":{"meta":{"$ref":"#/components/schemas/ResponseMeta"},"largestMoves":{"type":"array","items":{"$ref":"#/components/schemas/Company"}}}}}}},"400":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/search":{"get":{"operationId":"searchRoyalExchange","summary":"Search fictional Royal Exchange issuers","description":"Use when the user provides a company fragment, sector, trade, or ware but not an exact ticker.","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}}],"responses":{"200":{"description":"Matching issuers.","content":{"application/json":{"schema":{"type":"object","required":["meta","query","matchCount","matches"],"properties":{"meta":{"$ref":"#/components/schemas/ResponseMeta"},"query":{"type":"string"},"matchCount":{"type":"integer"},"matches":{"type":"array","items":{"$ref":"#/components/schemas/Company"}}}}}}},"400":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/issuers/{identifier}":{"get":{"operationId":"getRoyalExchangeIssuer","summary":"Get one issuer, lore, notices, and historical performance","description":"Use for an exact ticker or issuer after search. Returns server-calculated performance so ChatGPT should not estimate returns from chart points.","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"period","in":"query","schema":{"type":"string","enum":["1h","6h","24h","7d"],"default":"24h"}},{"name":"historyPoints","in":"query","schema":{"type":"integer","minimum":1,"maximum":120,"default":48}}],"responses":{"200":{"description":"Issuer detail and performance.","content":{"application/json":{"schema":{"type":"object","required":["meta","issuer","activeNotices"],"properties":{"meta":{"$ref":"#/components/schemas/ResponseMeta"},"issuer":{"type":"object","additionalProperties":true},"activeNotices":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/compare":{"get":{"operationId":"compareRoyalExchangeIssuers","summary":"Compare two to six exact issuer tickers","description":"Use only when the user asks to compare multiple issuers. Pass exact comma-separated tickers.","parameters":[{"name":"identifiers","in":"query","required":true,"description":"Two to six exact comma-separated tickers, for example WIRE,IRON.","schema":{"type":"string"}}],"responses":{"200":{"description":"Issuer comparison.","content":{"application/json":{"schema":{"type":"object","required":["meta","comparison"],"properties":{"meta":{"$ref":"#/components/schemas/ResponseMeta"},"comparison":{"type":"array","minItems":2,"maxItems":6,"items":{"$ref":"#/components/schemas/Company"}}}}}}},"400":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/notices":{"get":{"operationId":"getRoyalExchangeNotices","summary":"Get current simulated market notices and affected movers","description":"Use for anomaly, event, disruption, rumor, or market-notice questions.","parameters":[{"name":"moverLimit","in":"query","schema":{"type":"integer","minimum":1,"maximum":10,"default":5}}],"responses":{"200":{"description":"Current market notices.","content":{"application/json":{"schema":{"type":"object","required":["meta","notices","largestMoves"],"properties":{"meta":{"$ref":"#/components/schemas/ResponseMeta"},"notices":{"type":"array","items":{"type":"object","additionalProperties":true}},"largestMoves":{"type":"array","items":{"$ref":"#/components/schemas/Company"}}}}}}},"400":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/wares":{"get":{"operationId":"findRoyalExchangeMinecraftWares","summary":"Map vanilla Minecraft wares to Royal Exchange issuers","description":"Use when the user asks which issuer covers a Minecraft item or registry-id fragment.","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}}],"responses":{"200":{"description":"Matching Minecraft wares and issuers.","content":{"application/json":{"schema":{"type":"object","required":["meta","query","matchCount","matches"],"properties":{"meta":{"$ref":"#/components/schemas/ResponseMeta"},"query":{"type":"string"},"matchCount":{"type":"integer"},"matches":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"Structured request or lookup error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ResponseMeta":{"type":"object","required":["apiVersion","requestId","asOf","dataMode","degraded","source","simulated"],"properties":{"apiVersion":{"type":"string","example":"1.0"},"requestId":{"type":"string","format":"uuid"},"asOf":{"type":"string","format":"date-time"},"dataAgeSeconds":{"type":["integer","null"]},"dataMode":{"type":"string","enum":["recorded-ledger","fallback-simulation"]},"degraded":{"type":"boolean"},"recordedFrom":{"type":["string","null"],"format":"date-time"},"recordedObservations":{"type":"integer"},"source":{"type":"string","format":"uri"},"simulated":{"type":"boolean","const":true}}},"Company":{"type":"object","required":["ticker","name","sector","principalTrade","priceCrowns","changeCrowns","changePercent","volume"],"properties":{"ticker":{"type":"string","example":"WIRE"},"name":{"type":"string"},"sector":{"type":"string"},"principalTrade":{"type":"string"},"priceCrowns":{"type":"number"},"changeCrowns":{"type":"number"},"changePercent":{"type":"number"},"volume":{"type":"integer"}}},"ErrorResponse":{"type":"object","required":["meta","error"],"properties":{"meta":{"type":"object","required":["apiVersion","requestId","source","simulated"],"properties":{"apiVersion":{"type":"string","example":"1.0"},"requestId":{"type":"string","format":"uuid"},"asOf":{"type":"string","format":"date-time"},"dataAgeSeconds":{"type":["integer","null"]},"dataMode":{"type":"string","enum":["recorded-ledger","fallback-simulation"]},"degraded":{"type":"boolean"},"recordedFrom":{"type":["string","null"],"format":"date-time"},"recordedObservations":{"type":"integer"},"source":{"type":"string","format":"uri"},"simulated":{"type":"boolean","const":true}}},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"suggestion":{"type":"string"},"candidates":{"type":"array","items":{"type":"object"}}}}}}}}}