The Codex API offers two ways to get data: queries and subscriptions. Many endpoints have both a query and a subscription version that return the same data — the difference is how you receive it.
Query
Subscription
Protocol
HTTP (POST to https://graph.codex.io/graphql)
WebSocket (wss://graph.codex.io/graphql)
How it works
You request data, you get a response
You subscribe once, data is pushed to you as it changes
Best for
Page loads, historical data, one-time lookups
Live feeds, real-time dashboards, streaming updates
The table below maps each subscription to its query equivalent. Both return the same data — the query fetches it on-demand, while the subscription streams updates as they happen.