Skip to content

Commit 552fc24

Browse files
committed
Document matched cluster examples
1 parent 8fadf31 commit 552fc24

5 files changed

Lines changed: 269 additions & 76 deletions

File tree

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.44.3] - 2026-05-24
6+
7+
### Fixed
8+
9+
- **Cross Exchange docs**: Add Python, TypeScript, and curl examples for matched market and event cluster API reference pages.
10+
- **Relation filters**: Document valid matched-cluster relation values (`identity`, `subset`, `superset`, `overlap`, `disjoint`) and expose the single-relation enum in OpenAPI.
11+
512
## [2.44.2] - 2026-05-24
613

714
### Fixed

docs/api-reference/openapi-hosted.json

Lines changed: 101 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "PMXT Hosted Router API",
55
"description": "Hosted-only endpoints for cross-venue search, matching, arbitrage, and SQL.",
6-
"version": "9389e99"
6+
"version": "04d3400"
77
},
88
"servers": [
99
{
@@ -51,20 +51,48 @@
5151
},
5252
{
5353
"in": "query",
54-
"name": "relations",
54+
"name": "query",
5555
"schema": {
5656
"type": "string"
5757
},
58-
"description": "Comma-separated relation filter.",
59-
"example": "identity,overlap"
58+
"description": "Text search across cluster titles.",
59+
"example": "Satoshi"
6060
},
6161
{
6262
"in": "query",
63-
"name": "relation",
63+
"name": "category",
6464
"schema": {
6565
"type": "string"
6666
},
67-
"description": "Single relation filter. Alias for relations."
67+
"description": "Filter both sides of matched edges by event category.",
68+
"example": "Crypto"
69+
},
70+
{
71+
"in": "query",
72+
"name": "relations",
73+
"schema": {
74+
"type": "string",
75+
"default": "identity"
76+
},
77+
"description": "Comma-separated relation filter. Valid values: identity (same resolution), subset (A yes implies B yes), superset (B yes implies A yes), overlap (some shared scenarios), and disjoint (mutually exclusive). Defaults to identity. For subset and superset, direction follows the pairwise edge direction returned in rawMatches when includeRawMatches=true.\n",
78+
"example": "identity"
79+
},
80+
{
81+
"in": "query",
82+
"name": "relation",
83+
"schema": {
84+
"type": "string",
85+
"enum": [
86+
"identity",
87+
"subset",
88+
"superset",
89+
"overlap",
90+
"disjoint"
91+
],
92+
"default": "identity"
93+
},
94+
"description": "Single relation filter. Alias for relations.",
95+
"example": "identity"
6896
},
6997
{
7098
"in": "query",
@@ -175,6 +203,23 @@
175203
"description": "Matched event clusters."
176204
}
177205
},
206+
"x-codeSamples": [
207+
{
208+
"lang": "python",
209+
"label": "Python",
210+
"source": "import pmxt\n\nrouter = pmxt.Router(pmxt_api_key=\"YOUR_PMXT_API_KEY\")\nclusters = router.fetch_matched_event_clusters(\n query=\"Satoshi\",\n relation=\"identity\",\n min_venues=2,\n include_raw_matches=True,\n limit=5,\n)\n\nfor cluster in clusters:\n venues = [event.source_exchange for event in cluster.events]\n print(cluster.canonical_title, venues)\n"
211+
},
212+
{
213+
"lang": "javascript",
214+
"label": "TypeScript",
215+
"source": "import { Router } from \"pmxtjs\";\n\nconst router = new Router({ pmxtApiKey: \"YOUR_PMXT_API_KEY\" });\n\nasync function main() {\n const clusters = await router.fetchMatchedEventClusters({\n query: \"Satoshi\",\n relation: \"identity\",\n minVenues: 2,\n includeRawMatches: true,\n limit: 5,\n });\n\n for (const cluster of clusters) {\n console.log(\n cluster.canonicalTitle,\n cluster.events.map((event) => event.sourceExchange),\n );\n }\n}\n\nmain();\n"
216+
},
217+
{
218+
"lang": "bash",
219+
"label": "curl",
220+
"source": "curl -G \"https://api.pmxt.dev/v0/matched-event-clusters\" \\\n -H \"Authorization: Bearer $PMXT_API_KEY\" \\\n --data-urlencode \"query=Satoshi\" \\\n --data-urlencode \"relation=identity\" \\\n --data-urlencode \"minVenues=2\" \\\n --data-urlencode \"includeRawMatches=true\" \\\n --data-urlencode \"limit=5\"\n"
221+
}
222+
],
178223
"operationId": "getV0Matched-event-clusters"
179224
}
180225
},
@@ -212,20 +257,48 @@
212257
},
213258
{
214259
"in": "query",
215-
"name": "relations",
260+
"name": "query",
216261
"schema": {
217262
"type": "string"
218263
},
219-
"description": "Comma-separated relation filter.",
220-
"example": "identity,overlap"
264+
"description": "Text search across cluster titles.",
265+
"example": "Satoshi"
221266
},
222267
{
223268
"in": "query",
224-
"name": "relation",
269+
"name": "category",
225270
"schema": {
226271
"type": "string"
227272
},
228-
"description": "Single relation filter. Alias for relations."
273+
"description": "Filter both sides of matched edges by market category.",
274+
"example": "Crypto"
275+
},
276+
{
277+
"in": "query",
278+
"name": "relations",
279+
"schema": {
280+
"type": "string",
281+
"default": "identity"
282+
},
283+
"description": "Comma-separated relation filter. Valid values: identity (same resolution), subset (A yes implies B yes), superset (B yes implies A yes), overlap (some shared scenarios), and disjoint (mutually exclusive). Defaults to identity. For subset and superset, direction follows the pairwise edge direction returned in rawMatches when includeRawMatches=true.\n",
284+
"example": "identity"
285+
},
286+
{
287+
"in": "query",
288+
"name": "relation",
289+
"schema": {
290+
"type": "string",
291+
"enum": [
292+
"identity",
293+
"subset",
294+
"superset",
295+
"overlap",
296+
"disjoint"
297+
],
298+
"default": "identity"
299+
},
300+
"description": "Single relation filter. Alias for relations.",
301+
"example": "identity"
229302
},
230303
{
231304
"in": "query",
@@ -336,6 +409,23 @@
336409
"description": "Matched market clusters."
337410
}
338411
},
412+
"x-codeSamples": [
413+
{
414+
"lang": "python",
415+
"label": "Python",
416+
"source": "import pmxt\n\nrouter = pmxt.Router(pmxt_api_key=\"YOUR_PMXT_API_KEY\")\nclusters = router.fetch_matched_market_clusters(\n query=\"Satoshi\",\n relation=\"identity\",\n min_venues=2,\n include_raw_matches=True,\n limit=5,\n)\n\nfor cluster in clusters:\n venues = [market.source_exchange for market in cluster.markets]\n print(cluster.canonical_title, venues)\n"
417+
},
418+
{
419+
"lang": "javascript",
420+
"label": "TypeScript",
421+
"source": "import { Router } from \"pmxtjs\";\n\nconst router = new Router({ pmxtApiKey: \"YOUR_PMXT_API_KEY\" });\n\nasync function main() {\n const clusters = await router.fetchMatchedMarketClusters({\n query: \"Satoshi\",\n relation: \"identity\",\n minVenues: 2,\n includeRawMatches: true,\n limit: 5,\n });\n\n for (const cluster of clusters) {\n console.log(\n cluster.canonicalTitle,\n cluster.markets.map((market) => market.sourceExchange),\n );\n }\n}\n\nmain();\n"
422+
},
423+
{
424+
"lang": "bash",
425+
"label": "curl",
426+
"source": "curl -G \"https://api.pmxt.dev/v0/matched-market-clusters\" \\\n -H \"Authorization: Bearer $PMXT_API_KEY\" \\\n --data-urlencode \"query=Satoshi\" \\\n --data-urlencode \"relation=identity\" \\\n --data-urlencode \"minVenues=2\" \\\n --data-urlencode \"includeRawMatches=true\" \\\n --data-urlencode \"limit=5\"\n"
427+
}
428+
],
339429
"operationId": "getV0Matched-market-clusters"
340430
}
341431
},

docs/docs.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@
134134
],
135135
"openapi": "api-reference/openapi.json"
136136
},
137+
{
138+
"group": "Cross Exchange",
139+
"openapi": "api-reference/openapi-hosted.json",
140+
"pages": [
141+
"GET /v0/matched-event-clusters",
142+
"GET /v0/matched-market-clusters"
143+
]
144+
},
137145
{
138146
"group": "Order Book & Trades",
139147
"pages": [
@@ -195,14 +203,6 @@
195203
],
196204
"openapi": "api-reference/openapi.json"
197205
},
198-
{
199-
"group": "Cross Exchange",
200-
"openapi": "api-reference/openapi-hosted.json",
201-
"pages": [
202-
"GET /v0/matched-event-clusters",
203-
"GET /v0/matched-market-clusters"
204-
]
205-
},
206206
{
207207
"group": "Enterprise",
208208
"openapi": "api-reference/openapi-hosted.json",

0 commit comments

Comments
 (0)