h2h

Pack: api-football · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)

No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/h2h for the schema, then POST the same URL with its arguments for the data.

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

Arguments

{
  "team1": 33,
  "team2": 34,
  "last": 10,
  "_apiKey": "your-api-football-api-key"
}

curl

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":{"team1":33,"team2":34,"last":10,"_apiKey":"your-api-football-api-key"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('h2h', {
  "team1": 33,
  "team2": 34,
  "last": 10,
  "_apiKey": "your-api-football-api-key"
});

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 — every tool in the catalog, including this one — or use one-click install buttons:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://pipeworx.io/mcp"
    }
  }
}
Connect to just the api-football pack
{
  "mcpServers": {
    "api-football": {
      "url": "https://gateway.pipeworx.io/api-football/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build October 5, 2026