> For the complete documentation index, see [llms.txt](https://docs.afx.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.afx.xyz/api-reference/websocket/explorer.md).

# Explorer

## Block Data

> Subscribe to new block data.\
> \
> \`\`\`json\
> { "method": "subscribe", "subscription": { "type": "block" } }\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"AFX DEX WebSocket API","version":"1.0.0"},"servers":[{"url":"wss://ws.afx.xyz/ws/dex","description":"Mainnet"},{"url":"wss://ws-testnet.afx.xyz/ws/dex","description":"Testnet"}],"paths":{"/ws/subscribe/block":{"post":{"operationId":"wsBlock","summary":"Block Data","tags":["Explorer"],"description":"Subscribe to new block data.\n\n```json\n{ \"method\": \"subscribe\", \"subscription\": { \"type\": \"block\" } }\n```\n","responses":{"200":{"description":"Push data","content":{"application/json":{}}}}}}}}
````

## Block Height

> Subscribe to block height updates (lightweight).\
> \
> \`\`\`json\
> { "method": "subscribe", "subscription": { "type": "blockHeight" } }\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"AFX DEX WebSocket API","version":"1.0.0"},"servers":[{"url":"wss://ws.afx.xyz/ws/dex","description":"Mainnet"},{"url":"wss://ws-testnet.afx.xyz/ws/dex","description":"Testnet"}],"paths":{"/ws/subscribe/blockHeight":{"post":{"operationId":"wsBlockHeight","summary":"Block Height","tags":["Explorer"],"description":"Subscribe to block height updates (lightweight).\n\n```json\n{ \"method\": \"subscribe\", \"subscription\": { \"type\": \"blockHeight\" } }\n```\n","responses":{"200":{"description":"Push data","content":{"application/json":{}}}}}}}}
````

## Transactions

> Subscribe to new transactions.\
> \
> \`\`\`json\
> { "method": "subscribe", "subscription": { "type": "tx" } }\
> \`\`\`<br>

````json
{"openapi":"3.0.3","info":{"title":"AFX DEX WebSocket API","version":"1.0.0"},"servers":[{"url":"wss://ws.afx.xyz/ws/dex","description":"Mainnet"},{"url":"wss://ws-testnet.afx.xyz/ws/dex","description":"Testnet"}],"paths":{"/ws/subscribe/tx":{"post":{"operationId":"wsTx","summary":"Transactions","tags":["Explorer"],"description":"Subscribe to new transactions.\n\n```json\n{ \"method\": \"subscribe\", \"subscription\": { \"type\": \"tx\" } }\n```\n","responses":{"200":{"description":"Push data","content":{"application/json":{}}}}}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.afx.xyz/api-reference/websocket/explorer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
