No Subscription to this function
GET /soccer/get_head2head
Returns head-2-head statistics between 2 teams.
Request URL
https://dsg-api.com/clients/{client_name}/soccer/soccer/get_head2head?id={match_id}&client={client_name}&authkey={client_authkey}
Parameters
authkey
string Required
client authentification key
client
string Required
unique client ID
ftype
string
changes feed type from XML to json (ftype=json)
id
int Required
match id to return
lang
string
two-character language code, defaults to 'en'
Nodes
datasportsgroup
details about the API version, sport, language and generation timestamp
generated_utc
UTC timestamp when the API output was generated
lang
language of the API
sport
sport of the API
version
version of the API
match
Details about next matches of the particular team
attendance
amount of people that attended the particular match
competition_id
unique identifier for a competition.
competition_name
name of the competition.
date
Date of match, format 'yyyy-mm-dd' (CET)
date_utc
Date of match, format 'yyyy-mm-dd' (UTC)
gameweek
contains the gameweek a match belongs to.
last_updated
when record was last updated. Format YYYY-MM-DD HH:MM:SS in CET timezone.
match_id
unique identifier of match.
round_id
unique identifier of round
season_id
unique identifier of season
team_a_country
three-letter-acronym of the area where the home team origins.
team_a_id
unique team ID for the home team.
team_a_logo
URL to the team logo
team_a_name
current name of the home team.
team_a_original_name
the real name at the particular season (so can differ to current name)
team_a_short_name
short name of the home team.
team_a_tla_name
three-letter-acronym of the home team.
team_b_country
three-letter-acronym of the area where the home team origins.
team_b_id
unique team ID for the away team.
team_b_logo
URL to the team logo
team_b_name
current name of the away team.
team_b_original_name
the real name at the particular season (so can differ to current name)
team_b_short_name
short name of the away team.
team_b_tla_name
three-letter-acronym of the away team.
time
start time (CET), format 'hh:mm:ss'.
time_utc
start time (UTC), format 'hh:mm:ss'.
venue_city
city where the venue is based
venue_id
unique identifier of the venue
venue_name
current name of the venue
venue_type
determines if the match is on neutral ground or on home/away basis
method
details about the API function
method_id
unique ID of method.
name
name of method.
stats
Head-2-Head statistics
draws
number of draws
losses
number of losses
matches
number of matches
scores_against
number of scores against
scores_for
number of scores
type
type of match (away, home, neutral or total)
wins
number of wins
team
team informations
team_area
area name of the particular team
team_id
unique identifier for a team
team_name
current team name
Response Headers
200
Success
401
Unauthorized
429
Too Many Requests
Code Samples
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://dsg-api.com/clients/{client_name}/soccer/soccer/get_head2head?id={match_id}&client={client_name}&authkey={client_authkey}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "{User}:{Password}");
$content = curl_exec($ch);
curl_close($ch);
?>
curl GET -u "User:Password" "https://dsg-api.com/clients/{client_name}/soccer/soccer/get_head2head?id={match_id}&client={client_name}&authkey={client_authkey}"
response = requests.get("https://dsg-api.com/clients/{client_name}/soccer/soccer/get_head2head?id={match_id}&client={client_name}&authkey={client_authkey}", auth=("User", "Password"))
Response Example
200 Success
{"datasportsgroup":{"version":"2.0","sport":"soccer","lang":"en","method":{"method_id":"18","name":"get_head2head"},"head2head":{"team":[{"team_id":"2169","team_name":"AFC Bournemouth","team_area":"England","stats":[{"type":"home","matches":"2","wins":"2","draws":"0","losses":"0","scores_for":"7","scores_against":"3"},{"type":"away","matches":"3","wins":"1","draws":"1","losses":"1","scores_for":"4","scores_against":"3"},{"type":"neutral","matches":"0","wins":"0","draws":"0","losses":"0","scores_for":"0","scores_against":"0"},{"type":"total","matches":"5","wins":"3","draws":"1","losses":"1","scores_for":"11","scores_against":"6"}]},{"team_id":"495","team_name":"Cardiff City FC","team_area":"Wales","stats":[{"type":"home","matches":"3","wins":"1","draws":"1","losses":"1","scores_for":"3","scores_against":"4"},{"type":"away","matches":"2","wins":"0","draws":"0","losses":"2","scores_for":"3","scores_against":"7"},{"type":"neutral","matches":"0","wins":"0","draws":"0","losses":"0","scores_for":"0","scores_against":"0"},{"type":"total","matches":"5","wins":"1","draws":"1","losses":"3","scores_for":"6","scores_against":"11"}]}]},"head2head_matches":{"match":[{"match_id":"1344112","date":"2019-02-02","time":"18:30:00","date_utc":"2019-02-02","time_utc":"17:30:00","team_a_id":"495","team_a_name":"Cardiff City FC","team_a_short_name":"Cardiff","team_a_tla_name":"CAR","team_a_original_name":"Cardiff City FC","team_a_country":"WAL","team_a_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/495.png","team_b_id":"2169","team_b_name":"AFC Bournemouth","team_b_short_name":"Bournemouth","team_b_tla_name":"BOU","team_b_original_name":"AFC Bournemouth","team_b_country":"ENG","team_b_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/2169.png","status":"Played","gameweek":"25","winner":"team_A","score_a":"2","score_b":"0","p1s_a":"1","p1s_b":"0","p2s_a":"1","p2s_b":"0","ets_a":"","ets_b":"","pen_a":"","pen_b":"","venue_type":"home_away","game_minute":"","final_period":"soc_p2s","attendance":"31939","venue_id":"356","venue_name":"Cardiff City Stadium","venue_city":"Cardiff","competition_id":"2","competition_name":"Premier League","season_id":"16336","round_id":"22226","last_updated":"2019-02-02 22:36:04"},{"match_id":"1343870","date":"2018-08-11","time":"16:00:00","date_utc":"2018-08-11","time_utc":"14:00:00","team_a_id":"2169","team_a_name":"AFC Bournemouth","team_a_short_name":"Bournemouth","team_a_tla_name":"BOU","team_a_original_name":"AFC Bournemouth","team_a_country":"ENG","team_a_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/2169.png","team_b_id":"495","team_b_name":"Cardiff City FC","team_b_short_name":"Cardiff","team_b_tla_name":"CAR","team_b_original_name":"Cardiff City FC","team_b_country":"WAL","team_b_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/495.png","status":"Played","gameweek":"1","winner":"team_A","score_a":"2","score_b":"0","p1s_a":"1","p1s_b":"0","p2s_a":"1","p2s_b":"0","ets_a":"","ets_b":"","pen_a":"","pen_b":"","venue_type":"home_away","game_minute":"","final_period":"soc_p2s","attendance":"10353","venue_id":"759","venue_name":"Vitality Stadium","venue_city":"Bournemouth","competition_id":"2","competition_name":"Premier League","season_id":"16336","round_id":"22226","last_updated":"2018-11-25 12:10:16"},{"match_id":"429314","date":"2015-03-17","time":"20:45:00","date_utc":"2015-03-17","time_utc":"19:45:00","team_a_id":"495","team_a_name":"Cardiff City FC","team_a_short_name":"Cardiff","team_a_tla_name":"CAR","team_a_original_name":"Cardiff City FC","team_a_country":"WAL","team_a_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/495.png","team_b_id":"2169","team_b_name":"AFC Bournemouth","team_b_short_name":"Bournemouth","team_b_tla_name":"BOU","team_b_original_name":"AFC Bournemouth","team_b_country":"ENG","team_b_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/2169.png","status":"Played","gameweek":"38","winner":"draw","score_a":"1","score_b":"1","p1s_a":"0","p1s_b":"1","p2s_a":"1","p2s_b":"0","ets_a":"","ets_b":"","pen_a":"","pen_b":"","venue_type":"home_away","game_minute":"","final_period":"soc_p2s","attendance":"19819","venue_id":"356","venue_name":"Cardiff City Stadium","venue_city":"Cardiff","competition_id":"292","competition_name":"Sky Bet Championship","season_id":"4312","round_id":"3929","last_updated":"2017-12-15 18:44:04"},{"match_id":"429181","date":"2014-12-13","time":"16:00:00","date_utc":"2014-12-13","time_utc":"15:00:00","team_a_id":"2169","team_a_name":"AFC Bournemouth","team_a_short_name":"Bournemouth","team_a_tla_name":"BOU","team_a_original_name":"AFC Bournemouth","team_a_country":"ENG","team_a_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/2169.png","team_b_id":"495","team_b_name":"Cardiff City FC","team_b_short_name":"Cardiff","team_b_tla_name":"CAR","team_b_original_name":"Cardiff City FC","team_b_country":"WAL","team_b_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/495.png","status":"Played","gameweek":"21","winner":"team_A","score_a":"5","score_b":"3","p1s_a":"3","p1s_b":"1","p2s_a":"2","p2s_b":"2","ets_a":"","ets_b":"","pen_a":"","pen_b":"","venue_type":"home_away","game_minute":"","final_period":"soc_p2s","attendance":"10440","venue_id":"759","venue_name":"Vitality Stadium","venue_city":"Bournemouth","competition_id":"292","competition_name":"Sky Bet Championship","season_id":"4312","round_id":"3929","last_updated":"2017-12-15 18:44:04"},{"match_id":"440024","date":"2014-09-23","time":"20:45:00","date_utc":"2014-09-23","time_utc":"18:45:00","team_a_id":"495","team_a_name":"Cardiff City FC","team_a_short_name":"Cardiff","team_a_tla_name":"CAR","team_a_original_name":"Cardiff City FC","team_a_country":"WAL","team_a_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/495.png","team_b_id":"2169","team_b_name":"AFC Bournemouth","team_b_short_name":"Bournemouth","team_b_tla_name":"BOU","team_b_original_name":"AFC Bournemouth","team_b_country":"ENG","team_b_logo":"https:\/\/www.dsg-images.com\/clubs\/200x200\/2169.png","status":"Played","gameweek":"","winner":"team_B","score_a":"0","score_b":"3","p1s_a":"0","p1s_b":"3","p2s_a":"0","p2s_b":"0","ets_a":"","ets_b":"","pen_a":"","pen_b":"","venue_type":"home_away","game_minute":"","final_period":"soc_p2s","attendance":"6491","venue_id":"356","venue_name":"Cardiff City Stadium","venue_city":"Cardiff","competition_id":"413","competition_name":"Capital One Cup","season_id":"3941","round_id":"3981","last_updated":"2017-12-15 18:44:10"}]}}}