CHAPTER 3: EXPLORING MATCH COMMENTARIES FROM SINGLE FIXTURES.
Just like we mentioned earlier, in this chapter we shall focus on commentaries from a single fixture.
For our short exercise we shall use the fixture ID 19134638, which is for the Manchester derby that ended in an Amad Diallo-inspired 2-1 win for the Red Devils following an 88th-minute comeback.
3.1 Retrieving Match Commentaries from Specific Fixtures.
Using the base https://api.sportmonks.com/v3/football/commentaries/fixtures/{ID}?api_token=YOUR_TOKEN
We can retrieve the play-by-play action from a specific fixture in Rust using the sample code below.
use reqwest::Error;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<(), Error> {
let api_token = "API_Token"; // Replace "API_Token" with your actual API token
let url = format!(
"https://api.sportmonks.com/v3/football/commentaries/fixtures/19134638?api_token={}",
api_token
);
// Send the GET request
let response = reqwest::get(&url).await?;
// Check if the request was successful
if response.status().is_success() {
// Parse the JSON response
let json: Value = response.json().await?;
// Try to pretty-print the JSON response
match serde_json::to_string_pretty(&json) {
Ok(pretty_json) => println!("{}", pretty_json),
Err(e) => eprintln!("Failed to pretty-print JSON: {}", e),
}
} else {
// Print an error message if the request failed
eprintln!("Failed to fetch data: {}", response.status());
}
Ok(())
}
{
"data": [
{
"comment": "Match is currently on hold due to an injury to Mason Mount from Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833283,
"is_goal": false,
"is_important": false,
"minute": 12,
"order": 10
},
{
"comment": "Kevin De Bruyne of Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833210,
"is_goal": false,
"is_important": false,
"minute": 2,
"order": 3
},
{
"comment": "The opening half is underway...",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833208,
"is_goal": false,
"is_important": false,
"minute": null,
"order": 1
},
{
"comment": "Matheus Nunes from Manchester City has been awarded a free kick on the left flank.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833242,
"is_goal": false,
"is_important": false,
"minute": 3,
"order": 5
},
{
"comment": "Fouled by Manuel Ugarte - Manchester United. \n\nRephrased: Manuel Ugarte commits a foul against a Manchester United player.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833231,
"is_goal": false,
"is_important": false,
"minute": 4,
"order": 6
},
{
"comment": "Offside call against Manchester United. Amad Diallo has been flagged for offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833268,
"is_goal": false,
"is_important": false,
"minute": 11,
"order": 9
},
{
"comment": "Jérémy Doku from Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833232,
"is_goal": false,
"is_important": false,
"minute": 4,
"order": 7
},
{
"comment": "Corner awarded to Manchester City after Lisandro Martínez allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833233,
"is_goal": false,
"is_important": false,
"minute": 5,
"order": 8
},
{
"comment": "Noussair Mazraoui commits a foul against Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833307,
"is_goal": false,
"is_important": false,
"minute": 15,
"order": 13
},
{
"comment": "Diogo Dalot from Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833209,
"is_goal": false,
"is_important": false,
"minute": 2,
"order": 2
},
{
"comment": "Josko Gvardiol from Manchester City earned a free kick on the left side of the field.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833308,
"is_goal": false,
"is_important": false,
"minute": 15,
"order": 14
},
{
"comment": "Fouled by Rasmus Højlund - Manchester United",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833220,
"is_goal": false,
"is_important": false,
"minute": 3,
"order": 4
},
{
"comment": "The pause has ended. They’re set to resume play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833305,
"is_goal": false,
"is_important": false,
"minute": 14,
"order": 11
},
{
"comment": "Substitution for Manchester United: Kobbie Mainoo comes on to replace Mason Mount due to an injury.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833306,
"is_goal": false,
"is_important": false,
"minute": 14,
"order": 12
},
{
"comment": "Fouled by Manuel Ugarte - Manchester United",
"extra_minute": 1,
"fixture_id": 19134638,
"id": 8833568,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 44
},
{
"comment": "Missed chance. Phil Foden - Manchester City - shot with left foot from outside the box is close, but missed.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833358,
"is_goal": false,
"is_important": false,
"minute": 21,
"order": 15
},
{
"comment": "Shot blocked. Phil Foden - Manchester City - shot with left foot from the right side of the box is blocked. Assist - Erling Haaland.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833375,
"is_goal": false,
"is_important": false,
"minute": 23,
"order": 16
},
{
"comment": "Corner awarded to Manchester City after Harry Maguire gave it away.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833376,
"is_goal": false,
"is_important": false,
"minute": 23,
"order": 17
},
{
"comment": "Missed chance. Rúben Dias - Manchester City - shot with the head from few metres goes high. Assist - Phil Foden with a cross after corner.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833377,
"is_goal": false,
"is_important": false,
"minute": 23,
"order": 18
},
{
"comment": "Ilkay Gündogan from Manchester City committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833812,
"is_goal": false,
"is_important": false,
"minute": 53,
"order": 59
},
{
"comment": "Corner kick awarded to Manchester City after Matthijs de Ligt allowed the ball to go out of play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833813,
"is_goal": false,
"is_important": false,
"minute": 53,
"order": 60
},
{
"comment": "Bruno Fernandes from Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833466,
"is_goal": false,
"is_important": false,
"minute": 35,
"order": 26
},
{
"comment": "Offside call against Manchester United. Amad Diallo has been flagged for being offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833402,
"is_goal": false,
"is_important": false,
"minute": 26,
"order": 19
},
{
"comment": "Matheus Nunes from Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833815,
"is_goal": false,
"is_important": false,
"minute": 54,
"order": 62
},
{
"comment": "Erling Haaland commits a foul for Manchester City.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833415,
"is_goal": false,
"is_important": false,
"minute": 29,
"order": 20
},
{
"comment": "Harry Maguire from Manchester United has earned a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833416,
"is_goal": false,
"is_important": false,
"minute": 29,
"order": 21
},
{
"comment": "The second half is underway with the score at Manchester City 1, Manchester United 0.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833744,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 51
},
{
"comment": "The attempt is deflected. Lisandro Martínez of Manchester United takes a left-footed shot from outside the penalty area, but it is blocked. The assist came from Manuel Ugarte.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833434,
"is_goal": false,
"is_important": false,
"minute": 32,
"order": 22
},
{
"comment": "Missed opportunity. Manuel Ugarte from Manchester United attempted a right-footed shot from outside the penalty area, but it sailed high and to the right of the goal. The assist came from Kobbie Mainoo.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833435,
"is_goal": false,
"is_important": false,
"minute": 32,
"order": 23
},
{
"comment": "Shot blocked. Amad Diallo - Manchester United - shot with left foot from the right side of the box is blocked.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833436,
"is_goal": false,
"is_important": false,
"minute": 35,
"order": 24
},
{
"comment": "Bernardo Silva - Manchester City - won a free kick on the right wing.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833437,
"is_goal": false,
"is_important": false,
"minute": 35,
"order": 25
},
{
"comment": "Corner awarded to Manchester City after André Onana allowed the ball to go out.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833598,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 47
},
{
"comment": "Kevin De Bruyne from Manchester City has been awarded a free kick on the left flank.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833600,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 49
},
{
"comment": "A shot is deflected! Jérémy Doku of Manchester City attempts a right-footed strike from the left side of the penalty area, but it's blocked. The assist came from Phil Foden.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833461,
"is_goal": false,
"is_important": false,
"minute": 36,
"order": 27
},
{
"comment": "Corner awarded to Manchester City after Noussair Mazraoui allowed the ball to go out of play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833462,
"is_goal": false,
"is_important": false,
"minute": 36,
"order": 28
},
{
"comment": "Goal! Manchester City takes the lead with a score of 1-0 against Manchester United. Josko Gvardiol heads the ball into the center of the net from the middle of the box following a corner kick.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833463,
"is_goal": true,
"is_important": true,
"minute": 36,
"order": 29
},
{
"comment": "The attempt is thwarted. Amad Diallo of Manchester United takes a left-footed shot from outside the penalty area, but it gets blocked. The assist came from Bruno Fernandes.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833783,
"is_goal": false,
"is_important": false,
"minute": 50,
"order": 53
},
{
"comment": "Manuel Ugarte commits a foul on a Manchester United player.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833785,
"is_goal": false,
"is_important": false,
"minute": 50,
"order": 55
},
{
"comment": "Bruno Fernandes from Manchester United has earned a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833811,
"is_goal": false,
"is_important": false,
"minute": 53,
"order": 58
},
{
"comment": "Kyle Walker from Manchester City committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833504,
"is_goal": false,
"is_important": false,
"minute": 38,
"order": 30
},
{
"comment": "Rasmus Højlund from Manchester United earned a free kick in an offensive position.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833505,
"is_goal": false,
"is_important": false,
"minute": 38,
"order": 31
},
{
"comment": "Kyle Walker from Manchester City has been shown a yellow card.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833507,
"is_goal": false,
"is_important": true,
"minute": 40,
"order": 33
},
{
"comment": "Rasmus Højlund of Manchester United has been shown a yellow card.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833506,
"is_goal": false,
"is_important": true,
"minute": 40,
"order": 32
},
{
"comment": "Missed chance. Matthijs de Ligt - Manchester United - shot with the head from the centre of the box missed to the left. Assist - Bruno Fernandes .",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833508,
"is_goal": false,
"is_important": false,
"minute": 40,
"order": 34
},
{
"comment": "Offside call against Manchester United. Noussair Mazraoui has been caught offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833745,
"is_goal": false,
"is_important": false,
"minute": 47,
"order": 52
},
{
"comment": "Corner awarded to Manchester United after Ederson allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833896,
"is_goal": false,
"is_important": false,
"minute": 62,
"order": 68
},
{
"comment": "Corner - Manchester United. Conceded by Rúben Dias.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833528,
"is_goal": false,
"is_important": false,
"minute": 40,
"order": 35
},
{
"comment": "Offside - Manchester United. Diogo Dalot is in offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833529,
"is_goal": false,
"is_important": false,
"minute": 41,
"order": 36
},
{
"comment": "Fourth official has announced 4 minutes of added time.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833567,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 43
},
{
"comment": "Lisandro Martínez from Manchester United committed a foul.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833599,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 48
},
{
"comment": "The first half has concluded with Manchester City leading Manchester United 1-0.",
"extra_minute": 5,
"fixture_id": 19134638,
"id": 8833601,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 50
},
{
"comment": "Delay in match - Manchester City",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833562,
"is_goal": false,
"is_important": false,
"minute": 43,
"order": 38
},
{
"comment": "Delay over. They are ready to continue.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833563,
"is_goal": false,
"is_important": false,
"minute": 43,
"order": 39
},
{
"comment": "New attacking attempt. Kevin De Bruyne - Manchester City - shot with right foot from long distance on the right is saved in the top right corner.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833561,
"is_goal": false,
"is_important": false,
"minute": 43,
"order": 37
},
{
"comment": "Offside - Manchester United. Amad Diallo is in offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833564,
"is_goal": false,
"is_important": false,
"minute": 44,
"order": 40
},
{
"comment": "Fouled by Erling Haaland - Manchester City",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833565,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 41
},
{
"comment": "Manuel Ugarte - Manchester United - won a free kick in defence.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833566,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 42
},
{
"comment": "Kevin De Bruyne from Manchester City has earned a free kick on the right side of the field.",
"extra_minute": 1,
"fixture_id": 19134638,
"id": 8833596,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 45
},
{
"comment": "Another offensive push from Manchester City. Phil Foden takes a left-footed shot from outside the penalty area, but it's saved in the bottom left corner. The assist came from Ilkay Gündogan.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833597,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 46
},
{
"comment": "Bernardo Silva - Manchester City - won a free kick in attack.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833897,
"is_goal": false,
"is_important": false,
"minute": 66,
"order": 69
},
{
"comment": "Matheus Nunes from Manchester City has given away a penalty due to a foul committed inside the box.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834011,
"is_goal": false,
"is_important": false,
"minute": 86,
"order": 87
},
{
"comment": "Kobbie Mainoo from Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833845,
"is_goal": false,
"is_important": false,
"minute": 58,
"order": 63
},
{
"comment": "Missed chance. Kobbie Mainoo - Manchester United - shot with the head from the centre of the box goes high. Assist - Lisandro Martínez with a cross.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834007,
"is_goal": false,
"is_important": false,
"minute": 84,
"order": 84
},
{
"comment": "Penalty awarded to Manchester United! Amad Diallo is fouled inside the box.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834010,
"is_goal": false,
"is_important": false,
"minute": 86,
"order": 86
},
{
"comment": "Diogo Dalot commits a foul for Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833787,
"is_goal": false,
"is_important": false,
"minute": 51,
"order": 57
},
{
"comment": "Bernardo Silva from Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833786,
"is_goal": false,
"is_important": false,
"minute": 51,
"order": 56
},
{
"comment": "Diogo Dalot of Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833814,
"is_goal": false,
"is_important": false,
"minute": 54,
"order": 61
},
{
"comment": "Matheus Nunes from Manchester City earned a free kick on the left flank.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833846,
"is_goal": false,
"is_important": false,
"minute": 58,
"order": 64
},
{
"comment": "Fouled by Noussair Mazraoui of Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833869,
"is_goal": false,
"is_important": false,
"minute": 58,
"order": 65
},
{
"comment": "Bernardo Silva from Manchester City has earned a free kick in the defensive zone.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833784,
"is_goal": false,
"is_important": false,
"minute": 50,
"order": 54
},
{
"comment": "Substitution for Manchester United: Leny Yoro comes on to replace Matthijs de Ligt.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833984,
"is_goal": false,
"is_important": false,
"minute": 79,
"order": 83
},
{
"comment": "Manuel Ugarte commits a foul against Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833905,
"is_goal": false,
"is_important": false,
"minute": 66,
"order": 70
},
{
"comment": "Goal! Manchester City 1, Manchester United 2. Amad Diallo from Manchester United takes a left-footed shot from a challenging angle on the left side, sending the ball towards the center of the goal. The assist comes from Lisandro Martínez, who delivered a precise through ball.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834036,
"is_goal": true,
"is_important": true,
"minute": 90,
"order": 92
},
{
"comment": "Another offensive push from Manchester United. Amad Diallo heads the ball from the center of the box, but it's expertly saved in the right corner. The assist came from Bruno Fernandes, who delivered a precise cross.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833887,
"is_goal": false,
"is_important": false,
"minute": 62,
"order": 67
},
{
"comment": "Substitution for Manchester City: Savinho is coming on to replace Ilkay Gündogan.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834035,
"is_goal": false,
"is_important": false,
"minute": 89,
"order": 91
},
{
"comment": "Opportunity wasted. Kevin De Bruyne from Manchester City takes a left-footed shot from outside the penalty area, but it sails over the crossbar.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833914,
"is_goal": false,
"is_important": false,
"minute": 67,
"order": 71
},
{
"comment": "Substitution for Manchester City: Mateo Kovacic is coming on to replace Kevin De Bruyne.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833915,
"is_goal": false,
"is_important": false,
"minute": 68,
"order": 72
},
{
"comment": "Substitution for Manchester United: Joshua Zirkzee comes on to replace Rasmus Højlund.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833982,
"is_goal": false,
"is_important": false,
"minute": 78,
"order": 81
},
{
"comment": "Corner awarded to Manchester City after Kobbie Mainoo allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834009,
"is_goal": false,
"is_important": false,
"minute": 84,
"order": 85
},
{
"comment": "Substitution for Manchester City: Jack Grealish comes off, and Jérémy Doku takes his place.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833980,
"is_goal": false,
"is_important": false,
"minute": 77,
"order": 79
},
{
"comment": "The fourth official has indicated that there will be 5 minutes of stoppage time.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834037,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 93
},
{
"comment": "Corner awarded to Manchester City after Lisandro Martínez allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833979,
"is_goal": false,
"is_important": false,
"minute": 76,
"order": 78
},
{
"comment": "Goal! Manchester City 1, Manchester United 1. Bruno Fernandes - Manchester United - converts the penalty with a shot with right foot to the right corner.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834022,
"is_goal": true,
"is_important": true,
"minute": 88,
"order": 90
},
{
"comment": "Opportunity squandered. Phil Foden of Manchester City takes a left-footed shot from outside the penalty area following a corner, but it sails over the goal.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833981,
"is_goal": false,
"is_important": false,
"minute": 78,
"order": 80
},
{
"comment": "Offside call against Manchester United. Rasmus Højlund has been flagged for being in an offside position.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833946,
"is_goal": false,
"is_important": false,
"minute": 72,
"order": 73
},
{
"comment": "Bernardo Silva from Manchester City has been awarded a free kick on the right flank.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833947,
"is_goal": false,
"is_important": false,
"minute": 73,
"order": 74
},
{
"comment": "Diogo Dalot of Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833948,
"is_goal": false,
"is_important": false,
"minute": 73,
"order": 75
},
{
"comment": "Missed chance. Bruno Fernandes - Manchester United - shot with right foot from the right side of the box is close, but missed to the left. Assist - Rasmus Højlund with a through ball following a fast break.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833950,
"is_goal": false,
"is_important": false,
"minute": 74,
"order": 76
},
{
"comment": "The attempt is denied. Erling Haaland from Manchester City fires a left-footed shot from the middle of the penalty area, but it's intercepted. The assist came from Mateo Kovacic.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833978,
"is_goal": false,
"is_important": false,
"minute": 76,
"order": 77
},
{
"comment": "Substitution for Manchester United: Antony replaces Noussair Mazraoui.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833983,
"is_goal": false,
"is_important": false,
"minute": 78,
"order": 82
},
{
"comment": "The second half has concluded with the final score: Manchester City 1, Manchester United 2.",
"extra_minute": 6,
"fixture_id": 19134638,
"id": 8834061,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 96
},
{
"comment": "Delay in match - injury Amad Diallo - Manchester United",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834018,
"is_goal": false,
"is_important": false,
"minute": 86,
"order": 88
},
{
"comment": "Corner awarded to Manchester City after Victor Lindelöf allowed the ball to go out.",
"extra_minute": 5,
"fixture_id": 19134638,
"id": 8834060,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 95
},
{
"comment": "The pause has ended. They are set to resume play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834020,
"is_goal": false,
"is_important": false,
"minute": 87,
"order": 89
},
{
"comment": "That's it! The match has concluded with Manchester City 1, Manchester United 2.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834062,
"is_goal": false,
"is_important": false,
"minute": null,
"order": 97
},
{
"comment": "Substitution for Manchester United: Victor Lindelöf comes on to replace Amad Diallo.",
"extra_minute": 1,
"fixture_id": 19134638,
"id": 8834049,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 94
}
],
"rate_limit": {
"remaining": 2997,
"requested_entity": "Commentary",
"resets_in_seconds": 410
},
"subscription": [
{
"add_ons": [
{
"add_on": "All-in News API",
"category": "News",
"sport": "Football"
},
{
"add_on": "pressure index add-on",
"category": "Default",
"sport": "Football"
},
{
"add_on": "Enterprise Plan Predictions",
"category": "Predictions",
"sport": "Football"
},
{
"add_on": "xG Advanced",
"category": "Expected",
"sport": "Football"
}
],
"meta": {
"current_timestamp": 1736011169,
"ends_at": null,
"trial_ends_at": "2024-10-16 14:50:45"
},
"plans": [
{
"category": "Advanced",
"plan": "Enterprise plan (loyal)",
"sport": "Football"
},
{
"category": "Standard",
"plan": "Enterprise Plan",
"sport": "Cricket"
},
{
"category": "Standard",
"plan": "Formula One",
"sport": "Formula One"
}
],
"widgets": [
{
"sport": "Football",
"widget": "Sportmonks Widgets"
}
]
}
],
"timezone": "UTC"
}
3.2 Order Match Commentaries in Descending Order.
You must have noticed the results are not arranged in any particular order. However, since this is a live, minute-by-minute coverage, it would be ideal to arrange the commentaries in an orderly fashion.
To achieve this, we shall rearrange the commentaries in descending order using the field rightly named ‘order.’
We shall introduce a new code section to sort the commentaries using the order field.
if let Some(data) = json.get("data") { let mut commentaries: Vec = serde_json::from_value(data.clone())?;
// Sorting the commentaries by the "order" field in descending order
commentaries.sort_by(|a, b| b.order.cmp(&a.order));
// Convert sorted vector back to JSON
let sorted_json = serde_json::to_string_pretty(&commentaries)?;
println!("{}", sorted_json);
}
Using b.order.cmp(&a.order) ensures the largest order value comes first to enable us arrange the commentaries by Descending Order.
Rust’s sort_by ensures optimal performance even with large datasets. After sorting the vector, it is serialized back into JSON format using serde_json::to_string_pretty as shown in the piece of code.
Here below is the full code.
use reqwest::Error;
use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Debug, Deserialize, Serialize)]
struct Commentary {
comment: String,
extra_minute: Option<i32>,
fixture_id: i64,
id: i64,
is_goal: bool,
is_important: bool,
minute: Option<i32>,
order: i32,
}
#[tokio::main]
async fn main() -> Result<(), Error> {
// Replace "API_Token" with your actual API token
let api_token = "API_Token";
let url = format!(
"https://api.sportmonks.com/v3/football/commentaries/fixtures/19134638?api_token={}",
api_token
);
// Send the GET request
let response = reqwest::get(&url).await?;
if response.status().is_success() {
// Parse the JSON response
let json: Value = response.json().await?;
// Extract the "data" field which contains the list of commentaries
if let Some(data) = json.get("data") {
// Deserialize into a Vec<Commentary>
let mut commentaries: Vec<Commentary> = serde_json::from_value(data.clone())
.expect("Failed to deserialize 'data' field into Vec<Commentary>");
// Sort the commentaries by the "order" field in descending order
commentaries.sort_by(|a, b| b.order.cmp(&a.order));
// Serialize the sorted list back to JSON
let sorted_json = serde_json::to_string_pretty(&commentaries)
.expect("Failed to serialize sorted commentaries to JSON");
println!("{}", sorted_json);
} else {
eprintln!("The 'data' field is missing in the response.");
}
} else {
eprintln!("Failed to fetch data: {}", response.status());
}
Ok(())
}
[
{
"comment": "That's it! The match has concluded with Manchester City 1, Manchester United 2.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834062,
"is_goal": false,
"is_important": false,
"minute": null,
"order": 97
},
{
"comment": "The second half has concluded with the final score: Manchester City 1, Manchester United 2.",
"extra_minute": 6,
"fixture_id": 19134638,
"id": 8834061,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 96
},
{
"comment": "Corner awarded to Manchester City after Victor Lindelöf allowed the ball to go out.",
"extra_minute": 5,
"fixture_id": 19134638,
"id": 8834060,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 95
},
{
"comment": "Substitution for Manchester United: Victor Lindelöf comes on to replace Amad Diallo.",
"extra_minute": 1,
"fixture_id": 19134638,
"id": 8834049,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 94
},
{
"comment": "The fourth official has indicated that there will be 5 minutes of stoppage time.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834037,
"is_goal": false,
"is_important": false,
"minute": 90,
"order": 93
},
{
"comment": "Goal! Manchester City 1, Manchester United 2. Amad Diallo from Manchester United takes a left-footed shot from a challenging angle on the left side, sending the ball towards the center of the goal. The assist comes from Lisandro Martínez, who delivered a precise through ball.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834036,
"is_goal": true,
"is_important": true,
"minute": 90,
"order": 92
},
{
"comment": "Substitution for Manchester City: Savinho is coming on to replace Ilkay Gündogan.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834035,
"is_goal": false,
"is_important": false,
"minute": 89,
"order": 91
},
{
"comment": "Goal! Manchester City 1, Manchester United 1. Bruno Fernandes - Manchester United - converts the penalty with a shot with right foot to the right corner.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834022,
"is_goal": true,
"is_important": true,
"minute": 88,
"order": 90
},
{
"comment": "The pause has ended. They are set to resume play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834020,
"is_goal": false,
"is_important": false,
"minute": 87,
"order": 89
},
{
"comment": "Delay in match - injury Amad Diallo - Manchester United",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834018,
"is_goal": false,
"is_important": false,
"minute": 86,
"order": 88
},
{
"comment": "Matheus Nunes from Manchester City has given away a penalty due to a foul committed inside the box.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834011,
"is_goal": false,
"is_important": false,
"minute": 86,
"order": 87
},
{
"comment": "Penalty awarded to Manchester United! Amad Diallo is fouled inside the box.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834010,
"is_goal": false,
"is_important": false,
"minute": 86,
"order": 86
},
{
"comment": "Corner awarded to Manchester City after Kobbie Mainoo allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834009,
"is_goal": false,
"is_important": false,
"minute": 84,
"order": 85
},
{
"comment": "Missed chance. Kobbie Mainoo - Manchester United - shot with the head from the centre of the box goes high. Assist - Lisandro Martínez with a cross.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8834007,
"is_goal": false,
"is_important": false,
"minute": 84,
"order": 84
},
{
"comment": "Substitution for Manchester United: Leny Yoro comes on to replace Matthijs de Ligt.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833984,
"is_goal": false,
"is_important": false,
"minute": 79,
"order": 83
},
{
"comment": "Substitution for Manchester United: Antony replaces Noussair Mazraoui.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833983,
"is_goal": false,
"is_important": false,
"minute": 78,
"order": 82
},
{
"comment": "Substitution for Manchester United: Joshua Zirkzee comes on to replace Rasmus Højlund.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833982,
"is_goal": false,
"is_important": false,
"minute": 78,
"order": 81
},
{
"comment": "Opportunity squandered. Phil Foden of Manchester City takes a left-footed shot from outside the penalty area following a corner, but it sails over the goal.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833981,
"is_goal": false,
"is_important": false,
"minute": 78,
"order": 80
},
{
"comment": "Substitution for Manchester City: Jack Grealish comes off, and Jérémy Doku takes his place.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833980,
"is_goal": false,
"is_important": false,
"minute": 77,
"order": 79
},
{
"comment": "Corner awarded to Manchester City after Lisandro Martínez allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833979,
"is_goal": false,
"is_important": false,
"minute": 76,
"order": 78
},
{
"comment": "The attempt is denied. Erling Haaland from Manchester City fires a left-footed shot from the middle of the penalty area, but it's intercepted. The assist came from Mateo Kovacic.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833978,
"is_goal": false,
"is_important": false,
"minute": 76,
"order": 77
},
{
"comment": "Missed chance. Bruno Fernandes - Manchester United - shot with right foot from the right side of the box is close, but missed to the left. Assist - Rasmus Højlund with a through ball following a fast break.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833950,
"is_goal": false,
"is_important": false,
"minute": 74,
"order": 76
},
{
"comment": "Diogo Dalot of Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833948,
"is_goal": false,
"is_important": false,
"minute": 73,
"order": 75
},
{
"comment": "Bernardo Silva from Manchester City has been awarded a free kick on the right flank.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833947,
"is_goal": false,
"is_important": false,
"minute": 73,
"order": 74
},
{
"comment": "Offside call against Manchester United. Rasmus Højlund has been flagged for being in an offside position.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833946,
"is_goal": false,
"is_important": false,
"minute": 72,
"order": 73
},
{
"comment": "Substitution for Manchester City: Mateo Kovacic is coming on to replace Kevin De Bruyne.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833915,
"is_goal": false,
"is_important": false,
"minute": 68,
"order": 72
},
{
"comment": "Opportunity wasted. Kevin De Bruyne from Manchester City takes a left-footed shot from outside the penalty area, but it sails over the crossbar.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833914,
"is_goal": false,
"is_important": false,
"minute": 67,
"order": 71
},
{
"comment": "Manuel Ugarte commits a foul against Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833905,
"is_goal": false,
"is_important": false,
"minute": 66,
"order": 70
},
{
"comment": "Bernardo Silva - Manchester City - won a free kick in attack.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833897,
"is_goal": false,
"is_important": false,
"minute": 66,
"order": 69
},
{
"comment": "Corner awarded to Manchester United after Ederson allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833896,
"is_goal": false,
"is_important": false,
"minute": 62,
"order": 68
},
{
"comment": "Another offensive push from Manchester United. Amad Diallo heads the ball from the center of the box, but it's expertly saved in the right corner. The assist came from Bruno Fernandes, who delivered a precise cross.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833887,
"is_goal": false,
"is_important": false,
"minute": 62,
"order": 67
},
{
"comment": "Fouled by Noussair Mazraoui of Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833869,
"is_goal": false,
"is_important": false,
"minute": 58,
"order": 65
},
{
"comment": "Matheus Nunes from Manchester City earned a free kick on the left flank.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833846,
"is_goal": false,
"is_important": false,
"minute": 58,
"order": 64
},
{
"comment": "Kobbie Mainoo from Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833845,
"is_goal": false,
"is_important": false,
"minute": 58,
"order": 63
},
{
"comment": "Matheus Nunes from Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833815,
"is_goal": false,
"is_important": false,
"minute": 54,
"order": 62
},
{
"comment": "Diogo Dalot of Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833814,
"is_goal": false,
"is_important": false,
"minute": 54,
"order": 61
},
{
"comment": "Corner kick awarded to Manchester City after Matthijs de Ligt allowed the ball to go out of play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833813,
"is_goal": false,
"is_important": false,
"minute": 53,
"order": 60
},
{
"comment": "Ilkay Gündogan from Manchester City committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833812,
"is_goal": false,
"is_important": false,
"minute": 53,
"order": 59
},
{
"comment": "Bruno Fernandes from Manchester United has earned a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833811,
"is_goal": false,
"is_important": false,
"minute": 53,
"order": 58
},
{
"comment": "Diogo Dalot commits a foul for Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833787,
"is_goal": false,
"is_important": false,
"minute": 51,
"order": 57
},
{
"comment": "Bernardo Silva from Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833786,
"is_goal": false,
"is_important": false,
"minute": 51,
"order": 56
},
{
"comment": "Manuel Ugarte commits a foul on a Manchester United player.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833785,
"is_goal": false,
"is_important": false,
"minute": 50,
"order": 55
},
{
"comment": "Bernardo Silva from Manchester City has earned a free kick in the defensive zone.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833784,
"is_goal": false,
"is_important": false,
"minute": 50,
"order": 54
},
{
"comment": "The attempt is thwarted. Amad Diallo of Manchester United takes a left-footed shot from outside the penalty area, but it gets blocked. The assist came from Bruno Fernandes.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833783,
"is_goal": false,
"is_important": false,
"minute": 50,
"order": 53
},
{
"comment": "Offside call against Manchester United. Noussair Mazraoui has been caught offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833745,
"is_goal": false,
"is_important": false,
"minute": 47,
"order": 52
},
{
"comment": "The second half is underway with the score at Manchester City 1, Manchester United 0.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833744,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 51
},
{
"comment": "The first half has concluded with Manchester City leading Manchester United 1-0.",
"extra_minute": 5,
"fixture_id": 19134638,
"id": 8833601,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 50
},
{
"comment": "Kevin De Bruyne from Manchester City has been awarded a free kick on the left flank.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833600,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 49
},
{
"comment": "Lisandro Martínez from Manchester United committed a foul.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833599,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 48
},
{
"comment": "Corner awarded to Manchester City after André Onana allowed the ball to go out.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833598,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 47
},
{
"comment": "Another offensive push from Manchester City. Phil Foden takes a left-footed shot from outside the penalty area, but it's saved in the bottom left corner. The assist came from Ilkay Gündogan.",
"extra_minute": 4,
"fixture_id": 19134638,
"id": 8833597,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 46
},
{
"comment": "Kevin De Bruyne from Manchester City has earned a free kick on the right side of the field.",
"extra_minute": 1,
"fixture_id": 19134638,
"id": 8833596,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 45
},
{
"comment": "Fouled by Manuel Ugarte - Manchester United",
"extra_minute": 1,
"fixture_id": 19134638,
"id": 8833568,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 44
},
{
"comment": "Fourth official has announced 4 minutes of added time.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833567,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 43
},
{
"comment": "Manuel Ugarte - Manchester United - won a free kick in defence.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833566,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 42
},
{
"comment": "Fouled by Erling Haaland - Manchester City",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833565,
"is_goal": false,
"is_important": false,
"minute": 45,
"order": 41
},
{
"comment": "Offside - Manchester United. Amad Diallo is in offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833564,
"is_goal": false,
"is_important": false,
"minute": 44,
"order": 40
},
{
"comment": "Delay over. They are ready to continue.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833563,
"is_goal": false,
"is_important": false,
"minute": 43,
"order": 39
},
{
"comment": "Delay in match - Manchester City",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833562,
"is_goal": false,
"is_important": false,
"minute": 43,
"order": 38
},
{
"comment": "New attacking attempt. Kevin De Bruyne - Manchester City - shot with right foot from long distance on the right is saved in the top right corner.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833561,
"is_goal": false,
"is_important": false,
"minute": 43,
"order": 37
},
{
"comment": "Offside - Manchester United. Diogo Dalot is in offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833529,
"is_goal": false,
"is_important": false,
"minute": 41,
"order": 36
},
{
"comment": "Corner - Manchester United. Conceded by Rúben Dias.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833528,
"is_goal": false,
"is_important": false,
"minute": 40,
"order": 35
},
{
"comment": "Missed chance. Matthijs de Ligt - Manchester United - shot with the head from the centre of the box missed to the left. Assist - Bruno Fernandes .",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833508,
"is_goal": false,
"is_important": false,
"minute": 40,
"order": 34
},
{
"comment": "Kyle Walker from Manchester City has been shown a yellow card.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833507,
"is_goal": false,
"is_important": true,
"minute": 40,
"order": 33
},
{
"comment": "Rasmus Højlund of Manchester United has been shown a yellow card.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833506,
"is_goal": false,
"is_important": true,
"minute": 40,
"order": 32
},
{
"comment": "Rasmus Højlund from Manchester United earned a free kick in an offensive position.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833505,
"is_goal": false,
"is_important": false,
"minute": 38,
"order": 31
},
{
"comment": "Kyle Walker from Manchester City committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833504,
"is_goal": false,
"is_important": false,
"minute": 38,
"order": 30
},
{
"comment": "Goal! Manchester City takes the lead with a score of 1-0 against Manchester United. Josko Gvardiol heads the ball into the center of the net from the middle of the box following a corner kick.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833463,
"is_goal": true,
"is_important": true,
"minute": 36,
"order": 29
},
{
"comment": "Corner awarded to Manchester City after Noussair Mazraoui allowed the ball to go out of play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833462,
"is_goal": false,
"is_important": false,
"minute": 36,
"order": 28
},
{
"comment": "A shot is deflected! Jérémy Doku of Manchester City attempts a right-footed strike from the left side of the penalty area, but it's blocked. The assist came from Phil Foden.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833461,
"is_goal": false,
"is_important": false,
"minute": 36,
"order": 27
},
{
"comment": "Bruno Fernandes from Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833466,
"is_goal": false,
"is_important": false,
"minute": 35,
"order": 26
},
{
"comment": "Bernardo Silva - Manchester City - won a free kick on the right wing.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833437,
"is_goal": false,
"is_important": false,
"minute": 35,
"order": 25
},
{
"comment": "Shot blocked. Amad Diallo - Manchester United - shot with left foot from the right side of the box is blocked.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833436,
"is_goal": false,
"is_important": false,
"minute": 35,
"order": 24
},
{
"comment": "Missed opportunity. Manuel Ugarte from Manchester United attempted a right-footed shot from outside the penalty area, but it sailed high and to the right of the goal. The assist came from Kobbie Mainoo.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833435,
"is_goal": false,
"is_important": false,
"minute": 32,
"order": 23
},
{
"comment": "The attempt is deflected. Lisandro Martínez of Manchester United takes a left-footed shot from outside the penalty area, but it is blocked. The assist came from Manuel Ugarte.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833434,
"is_goal": false,
"is_important": false,
"minute": 32,
"order": 22
},
{
"comment": "Harry Maguire from Manchester United has earned a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833416,
"is_goal": false,
"is_important": false,
"minute": 29,
"order": 21
},
{
"comment": "Erling Haaland commits a foul for Manchester City.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833415,
"is_goal": false,
"is_important": false,
"minute": 29,
"order": 20
},
{
"comment": "Offside call against Manchester United. Amad Diallo has been flagged for being offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833402,
"is_goal": false,
"is_important": false,
"minute": 26,
"order": 19
},
{
"comment": "Missed chance. Rúben Dias - Manchester City - shot with the head from few metres goes high. Assist - Phil Foden with a cross after corner.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833377,
"is_goal": false,
"is_important": false,
"minute": 23,
"order": 18
},
{
"comment": "Corner awarded to Manchester City after Harry Maguire gave it away.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833376,
"is_goal": false,
"is_important": false,
"minute": 23,
"order": 17
},
{
"comment": "Shot blocked. Phil Foden - Manchester City - shot with left foot from the right side of the box is blocked. Assist - Erling Haaland.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833375,
"is_goal": false,
"is_important": false,
"minute": 23,
"order": 16
},
{
"comment": "Missed chance. Phil Foden - Manchester City - shot with left foot from outside the box is close, but missed.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833358,
"is_goal": false,
"is_important": false,
"minute": 21,
"order": 15
},
{
"comment": "Josko Gvardiol from Manchester City earned a free kick on the left side of the field.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833308,
"is_goal": false,
"is_important": false,
"minute": 15,
"order": 14
},
{
"comment": "Noussair Mazraoui commits a foul against Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833307,
"is_goal": false,
"is_important": false,
"minute": 15,
"order": 13
},
{
"comment": "Substitution for Manchester United: Kobbie Mainoo comes on to replace Mason Mount due to an injury.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833306,
"is_goal": false,
"is_important": false,
"minute": 14,
"order": 12
},
{
"comment": "The pause has ended. They’re set to resume play.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833305,
"is_goal": false,
"is_important": false,
"minute": 14,
"order": 11
},
{
"comment": "Match is currently on hold due to an injury to Mason Mount from Manchester United.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833283,
"is_goal": false,
"is_important": false,
"minute": 12,
"order": 10
},
{
"comment": "Offside call against Manchester United. Amad Diallo has been flagged for offside.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833268,
"is_goal": false,
"is_important": false,
"minute": 11,
"order": 9
},
{
"comment": "Corner awarded to Manchester City after Lisandro Martínez allowed the ball to go out.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833233,
"is_goal": false,
"is_important": false,
"minute": 5,
"order": 8
},
{
"comment": "Jérémy Doku from Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833232,
"is_goal": false,
"is_important": false,
"minute": 4,
"order": 7
},
{
"comment": "Fouled by Manuel Ugarte - Manchester United. \n\nRephrased: Manuel Ugarte commits a foul against a Manchester United player.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833231,
"is_goal": false,
"is_important": false,
"minute": 4,
"order": 6
},
{
"comment": "Matheus Nunes from Manchester City has been awarded a free kick on the left flank.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833242,
"is_goal": false,
"is_important": false,
"minute": 3,
"order": 5
},
{
"comment": "Fouled by Rasmus Højlund - Manchester United",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833220,
"is_goal": false,
"is_important": false,
"minute": 3,
"order": 4
},
{
"comment": "Kevin De Bruyne of Manchester City has been awarded a free kick in the defensive area.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833210,
"is_goal": false,
"is_important": false,
"minute": 2,
"order": 3
},
{
"comment": "Diogo Dalot from Manchester United committed a foul.",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833209,
"is_goal": false,
"is_important": false,
"minute": 2,
"order": 2
},
{
"comment": "The opening half is underway...",
"extra_minute": null,
"fixture_id": 19134638,
"id": 8833208,
"is_goal": false,
"is_important": false,
"minute": null,
"order": 1
}
]
In the final chapter, we shall perform some advanced formatting to extract only the required data and present the commentaries in a refined way.
Let’s dive in.