# Fight Details

This web socket endpoint returns the event-by-event data per fight. Once a fight commences the live information will visible and you'll be able to view the live fight details.

## **Endpoint URL**

| wss\://dde-streams.data.imgarena.com/media/mma/fight-details/feed/{id} |
| ---------------------------------------------------------------------- |

**Process for connecting to the web socket endpoints**

* Connect to SSL websocket address
* Send JSON packet containing API token
* Receive response indicating that connection is authorised (or a response indicating why the connection cannot be made)
* Receive heartbeat packets every 10 seconds to verify the connection is live
* Receive data packets

Once you have the API token, any further data that you send over the connection will be ignored.

## Request Parameters

| **Parameter** | **Type** | **Purpose**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startPosition | integer  | <p>The position in the stream that you want to start from.<br>Each packet in the stream has a sequence number ('seqNum'), where 1 is the first packet in the stream. By default the stream will start from the beginning.</p><p>This is useful if you get disconnected from a stream and need to reconnect. When reconnecting, if you specify the seqNum of the last packet you received + 1, then you can pick up where you left off without need to reprocess all the events already received.</p> |

## Response Model

There are a number of different types of packets that can be sent through this endpoint. They are detailed in the [Fight Details Scenarios](https://img-arena.gitbook.io/mma/-M0NiZjZYQq5xFpHxi-5/fight-details-scenarios) section of this documentation.

| **Field Name**   | **Type** | **Description**                               |
| ---------------- | -------- | --------------------------------------------- |
| stats            | object   | information of the fight                      |
| roundNum         | object   | number of rounds                              |
| timestamp        | string   | Date and time                                 |
| roundTime        | string   | Time of each round                            |
| eventElementType | string   | Status update of the fight                    |
| seqNum           | integer  | The sequence number of the packet in the feed |
| fightStatus      | string   | status of the round/fight                     |

## **Stats Object**

| **Field Name** | **Type** | **Description**             |
| -------------- | -------- | --------------------------- |
| Fight          | object   | information about the fight |
| Round          | object   | information about the round |

## **Fight object**

| **Field Name**    | **Type** | **Description**               |
| ----------------- | -------- | ----------------------------- |
| red/blue          | integer  | fighter colour/class          |
| takedownAttempt   | integer  | number of takedown attempts   |
| submissionAttempt | integer  | number of submission attempts |
| takedownLanded    | integer  | number of landed takedowns    |
| knockdown         | integer  | number of knockdown           |
| reversal          | integer  | number of reversals           |

## **Round object**

stats broken down per round

<table data-header-hidden><thead><tr><th>Field Name</th><th width="167.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Field Name</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>red/blue</td><td>integer</td><td>fighter colour/class</td></tr><tr><td>takedownAttempt</td><td>integer</td><td>number of takedown attempts</td></tr><tr><td>submissionAttempt</td><td>integer</td><td>number of submission attempts</td></tr><tr><td>takedownLanded</td><td>integer</td><td>number of landed takedowns</td></tr><tr><td>knockdown</td><td>integer</td><td>number of knockdown</td></tr><tr><td>reversal</td><td>integer</td><td>number of reversals</td></tr></tbody></table>

## **Sample Websocket**

You can connect to a sample WS for fight details here:

| wss\://dde-streams.data.imgarena.com/media/mma/fights/999991/details |
| -------------------------------------------------------------------- |
