Skip to main content
GET
/
games
/
h2h
Head-to-Head
curl --request GET \
  --url https://v1.basketball.sportsapipro.com/games/h2h \
  --header 'x-api-key: <api-key>'

Overview

Returns historical head-to-head matchups between two teams, useful for pre-game analysis and betting insights.

Query Parameters

competitor1
integer
required
First team ID
competitor2
integer
required
Second team ID
numOfGames
integer
default:"10"
Number of historical games to return

Code Examples

curl -X GET "https://v1.basketball.sportsapipro.com/games/h2h?competitor1=678&competitor2=679&numOfGames=10" \
  -H "x-api-key: YOUR_API_KEY"

Response Structure

games
array
Array of historical matchups
summary
object
H2H summary statistics

Authorizations

x-api-key
string
header
required

Your SportsAPI Pro API key

Query Parameters

competitor1
integer
required

First team ID

Example:

678

competitor2
integer
required

Second team ID

Example:

679

numOfGames
integer
default:10

Number of historical games to return

Example:

10

Response

200

Head-to-head history retrieved successfully