Repository navigation
Expand file tree
/
Copy pathschema.json
More file actions
821 lines (821 loc) · 31.8 KB
/
Copy pathschema.json
File metadata and controls
821 lines (821 loc) · 31.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Pixellot Stats API Schema",
"description": "Complete schema for the Pixellot Data API response including team stats, roster stats, box score, and game breakdown",
"version": "3.0.0",
"type": "object",
"properties": {
"schemaUrl": {
"type": "string",
"description": "URL reference to the current schema definition",
"format": "uri",
"examples": ["https://api.pixellot.com/schemas/stats/v2.0.0/schema.json"]
},
"schemaVersion": {
"type": "string",
"description": "Version of the schema following semantic versioning (X.Y.Z)",
"pattern": "^\\d+\\.\\d+\\.\\d+$",
"examples": ["2.0.0"]
},
"matchTeamStats": {
"type": "object",
"description": "Stats for the teams that participated in the game",
"required": [
"metrics",
"results"
],
"properties": {
"metrics": {
"type": "object",
"description": "Definitions of metrics used in the stats",
"patternProperties": {
"^[0-9]+$": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Full name of the metric",
"examples": ["2FG% By Team", "Points By Team"]
},
"shortName": {
"type": "string",
"description": "Abbreviated name of the metric",
"examples": ["2FG%", "P"]
},
"format": {
"type": "string",
"description": "Format to be used when displaying the metric value",
"examples": ["TWO_DECIMAL_POINTS", "TIME:HH:MM:SS"]
}
}
}
}
},
"results": {
"type": "object",
"description": "The part of the response that contains the actual results, along with data explaining the context by which they were calculated",
"additionalProperties": false,
"required": [
"entityHierarchy",
"allStats",
"includes"
],
"properties": {
"statsType": {
"type": "string",
"description": "Are the stats of type `allEntities` or `leaders`?",
"enum": [ "StatsForLeaders", "StatsForAllEntities"]
},
"entityHierarchy": {
"type": "array",
"description": "The hierarchy used to group stats (e.g., [season, league, team]). The last entity is either `team` or `athlete`",
"items": {
"type": "string",
"enum": ["season", "league", "game", "team", "athlete"]
}
},
"allStats": {
"type": "array",
"description": "Array of stats groups",
"items": {
"type": "object",
"description": "Represents a result of stats for a group of entities—e.g., stats for a team in a specific league in a specific season",
"properties": {
"parentEntities": {
"type": "object",
"description": "The IDs of the entities from `entityHierarchy`, minus the last item (the actual entity). Only the fields that appeared in `entityHierarchy` are present",
"properties": {
"season": {
"type": "integer",
"minimum": 1990,
"maximum": 2100,
"examples": [2020]
},
"league": {
"type": "string",
"examples": ["652d1a1d7720c86e48296b0d"]
},
"game": {
"type": "string",
"examples": ["652d1ad5d8733f6962e828ed"]
},
"team": {
"type": "string",
"examples": ["652d266bc4732ea5a44327f9"]
}
}
},
"stats": {
"type": "object",
"description": "The stats data structure varies based on statsType",
"if": {
"properties": {
"statsType": {
"const": "StatsForAllEntities"
}
}
},
"then": {
"patternProperties": {
"^[0-9a-fA-F]{24}$": {
"type": "object",
"description": "The key is the ID of the entity (team or athlete). The value is a map of metricId -> numeric result",
"patternProperties": {
"^[0-9]+$": {
"type": "number",
"format": "float"
}
}
}
}
},
"else": {
"if": {
"properties": {
"statsType": {
"const": "StatsForLeaders"
}
}
},
"then": {
"patternProperties": {
"^[0-9]+$": {
"type": "object",
"description": "The key is the ID of the metric for which we are calculating its leaders",
"patternProperties": {
"^[0-9a-fA-F]{24}$": {
"type": "number",
"format": "float",
"description": "The key is the entity ID. The value is the numeric result for that metric"
}
}
}
}
}
}
}
}
}
},
"includes": {
"type": "object",
"description": "The teams and/or athletes included in the aggregated stats",
"patternProperties": {
"^[0-9a-fA-F]{24}$": {
"description": "The key is the ID of the entity (team or athlete); the value describes that entity",
"anyOf": [
{
"type": "object",
"properties": {
"objectType": {
"type": "string",
"description": "Type of the object in includes (in this case team)",
"const": "team"
},
"teamName": {
"type": "string",
"description": "The name of the basketball team",
"examples": ["Albert Einstein Girls Varsity Basketball"]
}
},
"required": ["objectType"]
},
{
"type": "object",
"properties": {
"objectType": {
"type": "string",
"description": "Type of the object in includes (in this case athlete)",
"const": "athlete"
},
"firstName": {
"oneOf": [
{
"type": "string",
"description": "Player first name",
"examples": ["John"]
},
{
"type": "null"
}
]
},
"lastName": {
"oneOf": [
{
"type": "string",
"description": "Player last name",
"examples": ["Doan"]
},
{
"type": "null"
}
]
},
"middleName": {
"oneOf": [
{
"type": "string",
"description": "Player middle name",
"examples": ["Albert"]
},
{
"type": "null"
}
]
},
"teamId": {
"oneOf": [
{
"type": "string",
"description": "Player team id",
"examples": ["652d266bc4732ea5a44327f9"]
},
{
"type": "null"
}
]
},
"jersey": {
"type": "string",
"description": "Player jersey number",
"examples": ["23"]
},
"isCanonical": {
"type": "boolean",
"description": "Boolean field that shows whether the athlete is canonical or fake"
}
},
"required": ["objectType"]
}
]
}
}
}
}
}
}
},
"matchRosterStats": {
"type": "object",
"description": "Stats for the athletes on the roster that participated in the game",
"required": [
"metrics",
"results"
],
"properties": {
"metrics": {
"$ref": "#/properties/matchTeamStats/properties/metrics"
},
"results": {
"$ref": "#/properties/matchTeamStats/properties/results"
}
}
},
"matchBoxScore": {
"type": "object",
"description": "Stats on the top players by different metrics",
"required": [
"metrics",
"results"
],
"properties": {
"metrics": {
"$ref": "#/properties/matchTeamStats/properties/metrics"
},
"results": {
"$ref": "#/properties/matchTeamStats/properties/results"
}
}
},
"matchRosterLeaders": {
"type": "object",
"description": "Stats on the score of the game",
"required": [
"metrics",
"results"
],
"properties": {
"metrics": {
"$ref": "#/properties/matchTeamStats/properties/metrics"
},
"results": {
"$ref": "#/properties/matchTeamStats/properties/results"
}
}
},
"gameBreakdown": {
"type": "object",
"description": "The raw data of the game, from which the stats are aggregated",
"properties": {
"results": {
"type": "object",
"properties": {
"allStats": {
"type": "array",
"description": "Array of tag events that occurred during the game",
"items": {
"type": "object",
"description": "A point of interest in a game which was logged, plus enriched data about the tag resource and tag attributes",
"required": [
"id",
"gameId",
"resource",
"attrs",
"angles"
],
"properties": {
"id": {
"type": "string",
"description": "The object id of the tag event",
"examples": ["67bbc79e91a779e0122dcf65"]
},
"gameId": {
"type": "string",
"description": "The object id of the game to which the event applies",
"examples": ["67bb4ef005aae699a0d9454e"]
},
"playclipId": {
"type": "string",
"description": "The object id of the play clip",
"examples": ["67bbc5b399fd464a56c9a6e6"]
},
"startUTC": {
"type": "integer",
"description": "The start of the tag event in unix UTC (only for Pixellot camera source or Replay kit)",
"examples": [1739552865]
},
"endUTC": {
"type": "integer",
"description": "The end of the tag event in unix UTC (only for Pixellot camera source or Replay kit)",
"examples": [1739552878]
},
"resource": {
"type": "object",
"description": "Details of a tag resource (used by a tag event)",
"additionalProperties": false,
"required": ["id", "name"],
"properties": {
"id": {
"type": "integer",
"description": "ID of the tag resource",
"examples": [157, 1000000]
},
"name": {
"type": "string",
"description": "Name of the tag resource",
"examples": ["Rebound", "Generic tag resource for playbased sports"]
}
}
},
"attrs": {
"type": "array",
"description": "Array of attributes that provide details about the tag event",
"items": {
"type": "object",
"description": "Details of a tag attribute (used by a tag event)",
"additionalProperties": false,
"required": ["id", "name", "type", "value"],
"properties": {
"id": {
"type": "integer",
"description": "ID of the tag attribute",
"examples": [909, 779, 1444, 1446]
},
"name": {
"type": "string",
"description": "Name of the tag attribute",
"examples": ["Type", "Team", "Inning", "Pitcher"]
},
"type": {
"type": "string",
"description": "The type of the tag attribute value",
"enum": [
"text",
"number",
"list",
"teamNames",
"rosterAthletes",
"chartPoint",
"chartLine",
"rosterCoaches"
]
},
"value": {
"description": "The value given to the attribute. For chartPoint, it will be a JSON string. For teamNames, it's a team ID. For rosterAthletes, it can be either an athlete ID or a string with jersey number and name",
"oneOf": [
{ "type": "string" },
{ "type": "number" },
{
"type": "array",
"items": {
"type": "string"
}
}
],
"examples": [
"offense",
"6579de1d7e14a67a0e1a91bf",
"67a38884b62bf88b1146a82a",
"50 John Cohen",
"{\"x\":517.2781982421875,\"y\":311.42251586914062,\"x2\":0,\"y2\":0,\"type\":\"point\",\"sector\":11,\"orientation\":\"left\"}"
]
}
}
}
},
"angles": {
"type": "object",
"description": "Video offsets for different camera angles. The keys correspond to angle names, which are defined in the top-level angles array",
"additionalProperties": {
"type": "object",
"properties": {
"startOffset": {
"type": "number",
"description": "The start offset in seconds from the beginning of the video source"
},
"endOffset": {
"type": "number",
"description": "The end offset in seconds from the beginning of the video source"
}
},
"required": ["startOffset", "endOffset"]
},
"examples": [
{
"hd": {
"startOffset": 616,
"endOffset": 626
}
},
{
"HP": {
"startOffset": 82,
"endOffset": 95
},
"P3": {
"startOffset": 82,
"endOffset": 95
}
}
]
}
}
}
}
}
},
"includes": {
"type": "object",
"description": "Information about teams and athletes referenced in the tag events",
"patternProperties": {
"^[0-9a-fA-F]{24}$": {
"oneOf": [
{
"type": "object",
"description": "Team information",
"properties": {
"objectType": {
"type": "string",
"description": "Type of the object in includes (in this case team)",
"const": "team"
},
"teamName": {
"type": "string",
"description": "Name of the team",
"examples": ["Magdalena", "Creighton"]
}
},
"required": ["objectType"],
"additionalProperties": false
},
{
"type": "object",
"description": "Athlete information",
"properties": {
"objectType": {
"type": "string",
"description": "Type of the object in includes (in this case athlete)",
"const": "athlete"
},
"firstName": {
"type": ["string", "null"],
"description": "First name of the athlete",
"examples": ["Tate", "Wade"]
},
"lastName": {
"type": ["string", "null"],
"description": "Last name of the athlete",
"examples": ["Gillen", "Walton"]
},
"middleName": {
"type": ["string", "null"],
"description": "Middle name of the athlete"
},
"jersey": {
"type": "string",
"description": "Jersey number of the athlete",
"examples": ["20", "35"]
},
"teamId": {
"type": "string",
"description": "The team ID that the athlete belongs to",
"examples": ["652d266bc4732ea5a44327f9"]
},
"isCanonical": {
"type": "boolean",
"description": "Boolean field that shows whether the athlete is canonical or fake"
}
},
"required": ["objectType"],
"additionalProperties": false
}
]
}
}
},
"fileAttributes": {
"type": "object",
"description": "Attributes describing the file",
"properties": {
"lastUpdatedAt": {
"type": "string",
"format": "date-time",
"description": "Last updated at date and time of the file in ISO 8601 format",
"examples": ["2025-09-25T02:00:00.000Z"]
},
"lastUpdateReason": {
"type": "string",
"description": "Reason for the last update",
"examples": ["breakdown_completed"]
}
}
},
"eventAttributes": {
"type": "object",
"description": "Attributes describing the event/game",
"properties": {
"name": {
"type": "string",
"description": "Name of the event",
"examples": ["[gam75cf98788b] Varsity Boys Football | Jefferson vs. Brookland"]
},
"startDate": {
"type": "string",
"format": "date-time",
"description": "Start date and time of the event in ISO 8601 format",
"examples": ["2025-09-24T21:59:00.000Z"]
},
"endDate": {
"type": "string",
"format": "date-time",
"description": "End date and time of the event in ISO 8601 format",
"examples": ["2025-09-25T02:00:00.000Z"]
},
"sportType": {
"type": "string",
"description": "Sport type of the event",
"examples": ["outdoor-football", "basketball", "soccer"]
},
"gender": {
"type": "string",
"description": "Gender of participants in the event",
"examples": ["men", "women", "mixed"]
},
"homeTeam": {
"type": "object",
"description": "Information about the home team",
"properties": {
"id": {
"type": "string",
"description": "ID of the home team in Advantage",
"examples": ["68af082e980cb4caba4c9511"]
},
"name": {
"type": "string",
"description": "Name of the home team",
"examples": ["Jefferson Middle School"]
},
"playonSchoolKey": {
"type": "string",
"description": "School key of the home team in PlayOn",
"examples": ["schcdeb7fc410"]
}
},
"required": ["id", "name"]
},
"awayTeam": {
"type": "object",
"description": "Information about the away team",
"properties": {
"id": {
"type": "string",
"description": "ID of the away team in Advantage",
"examples": ["68af28ef980cb4caba5a44ec"]
},
"name": {
"type": "string",
"description": "Name of the away team",
"examples": ["Brookland Middle School"]
},
"playonSchoolKey": {
"type": "string",
"description": "School key of the away team in PlayOn",
"examples": ["scha501a20f11"]
}
},
"required": ["id", "name"]
},
"league": {
"oneOf": [
{
"type": "object",
"description": "League information",
"properties": {
"advantageId": {
"type": "string",
"description": "ID of the league in Advantage",
"examples": ["68af417a5b1a116e63804719"]
},
"title": {
"type": "string",
"description": "Title of the league"
},
"vidswapId": {
"type": "integer",
"description": "ID of the league in VidSwap",
"examples": [7627829]
}
},
"required": ["advantageId", "title", "vidswapId"]
},
{
"type": "null"
}
]
},
"ids": {
"type": "object",
"description": "Various system IDs for the event",
"required": ["advantage"],
"properties": {
"advantage": {
"type": "string",
"description": "ID of the event in Advantage. This field is always present",
"examples": ["68af417a5b1a116e63804719"]
},
"vidswap": {
"type": "string",
"description": "ID of the event in VidSwap. Optional field - present in most cases but not guaranteed",
"examples": ["7627829"]
},
"mbe": {
"type": "string",
"description": "MBE ID of event, also known as Pixellot ID. Optional field - only present for external events (e.g., created by NFHS console)",
"examples": ["68af416b49ec903802b226a6"]
},
"nfhs": {
"type": "string",
"description": "NFHS ID of event, also known as Unity Game ID (PlayOn ID). Optional field - only present for external events (e.g., created by NFHS console)",
"examples": ["gam75cf98788b"]
}
}
},
"venue": {
"type": "string",
"description": "ID of the venue used for the event. Optional field - only present when venue data is available from MBE (typically for external events)",
"examples": ["60b353ebb59e3af4c8cb2d45"]
},
"lineup": {
"type": "array",
"description": "Array of athlete lineup data for the event",
"items": {
"type": "object",
"description": "Athlete lineup information",
"properties": {
"athleteId": {
"type": "string",
"description": "ID of the athlete"
},
"teamId": {
"type": "string",
"description": "ID of the team the athlete belongs to"
},
"jersey": {
"type": "string",
"description": "Jersey number of the athlete"
},
"positions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Positions the athlete can play"
},
"name": {
"type": "string",
"description": "Name of the athlete"
},
"isCanonical": {
"type": "boolean",
"description": "Whether the athlete is canonical or fake"
},
"started": {
"type": "boolean",
"description": "Whether the athlete started the game"
},
"played": {
"type": "boolean",
"description": "Whether the athlete played in the game"
},
"tagged": {
"type": "boolean",
"description": "Whether the athlete was tagged in events"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "When this lineup entry was created"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "When this lineup entry was last updated"
}
},
"required": ["jersey", "positions", "athleteId", "teamId", "isCanonical", "started", "played", "tagged"]
}
}
}
},
"breakdownAttributes": {
"type": "object",
"description": "Attributes describing the breakdown data. Optional object - can be omitted completely if breakdown data is not available. Each individual field (id, type, priority) can also be present or missing independently",
"properties": {
"id": {
"type": "string",
"description": "Breakdown ID. Optional field"
},
"type": {
"type": "string",
"description": "Type of the breakdown. Optional field",
"enum": ["basic", "advanced"]
},
"priority": {
"type": "integer",
"description": "Priority of the breakdown (integer number). Optional field"
},
"loggerNotes": {
"oneOf": [
{
"type": "array",
"description": "Notes from the logger",
"items": {
"type": "string"
},
"examples": ["This game was logged on VidSwap"]
},
{
"type": "null"
}
]
}
}
},
"hasAthletes": {
"type": "boolean",
"description": "Flag to indicate whether any athletes are tagged in this breakdown"
},
"hasRoster": {
"type": "boolean",
"description": "Flag to indicate whether canonical athletes from the roster are tagged in this breakdown"
}
}
},
"angles": {
"type": "array",
"description": "All video angles/sources included in this game",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the camera angle",
"examples": ["HP", "P3", "B1", "HH", "CF", "hd"]
},
"recordedStreamUrl" : {
"type": "string",
"description": "URL to the recorded video stream",
"format": "uri",
"examples": ["https://d2s0txx1aqnj4f.cloudfront.net/someTenantName/6736d0dc4c7136f9b31f0269/cloud_hls/0_hd_hls.m3u8"]
},
"startUTC": {
"type": "integer",
"description": "Indicator of event UTC start time in format in seconds",
"examples": [1739552865]
}
}
}
}
}
}