h2h

Pack: api-football · Endpoint: https://gateway.pipeworx.io/api-football/mcp

Head-to-head record between two teams. Returns last N matches with scores.

Parameters

NameTypeRequiredDescription
team1numberyesFirst team ID
team2numberyesSecond team ID
lastnumbernoLast N H2H matches (default 5)
_apiKeystringno

Example call

curl -X POST https://gateway.pipeworx.io/api-football/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"h2h","arguments":{}}}'

Response shape

Always returns: count, matches

FieldTypeDescription
countnumberTotal H2H matches returned
matchesarrayArray of H2H fixture objects (max 20)
Full JSON Schema
{
  "type": "object",
  "properties": {
    "count": {
      "type": "number",
      "description": "Total H2H matches returned"
    },
    "matches": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fixture_id": {
            "type": "number",
            "description": "Unique fixture identifier"
          },
          "date": {
            "type": "string",
            "description": "ISO datetime of match kickoff"
          },
          "status": {
            "type": "string",
            "description": "Match status (e.g., NS, 1H, 2H, FT, PST, PEN)"
          },
          "venue": {
            "type": "string",
            "description": "Stadium/venue name"
          },
          "league": {
            "type": "string",
            "description": "League name"
          },
          "round": {
            "type": "string",
            "description": "Round/week identifier"
          },
          "home": {
            "type": "string",
            "description": "Home team name"
          },
          "away": {
            "type": "string",
            "description": "Away team name"
          },
          "home_team_id": {
            "type": "number",
            "description": "Home team ID"
          },
          "away_team_id": {
            "type": "number",
            "description": "Away team ID"
          },
          "score_home": {
            "type": [
              "number",
              "null"
            ],
            "description": "Home team goals (null if not played)"
          },
          "score_away": {
            "type": [
              "number",
              "null"
            ],
            "description": "Away team goals (null if not played)"
          }
        }
      },
      "description": "Array of H2H fixture objects (max 20)"
    }
  },
  "required": [
    "count",
    "matches"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "api-football": {
      "url": "https://gateway.pipeworx.io/api-football/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 21, 2026