> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sportsapipro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Search for hockey teams, players, and leagues

## Overview

Search across hockey teams, players, and leagues by name.

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://v1.hockey.sportsapipro.com/search?query=Rangers" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://v1.hockey.sportsapipro.com/search?query=Rangers',
    { headers: { 'x-api-key': 'YOUR_API_KEY' } }
  );
  const results = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://v1.hockey.sportsapipro.com/search?query=Rangers',
      headers={'x-api-key': 'YOUR_API_KEY'}
  )
  ```
</CodeGroup>

## Parameters

<ParamField query="query" type="string" required>
  Search term (minimum 2 characters)
</ParamField>

<ParamField query="filter" type="string">
  Filter type: `all`, `athletes`, `competitions`, `competitors`
</ParamField>

## Response Structure

<ResponseField name="athletes" type="array">
  Matching players
</ResponseField>

<ResponseField name="competitions" type="array">
  Matching leagues/tournaments
</ResponseField>

<ResponseField name="competitors" type="array">
  Matching teams
</ResponseField>

<Tip>
  Use search to find team, player, or league IDs, then use those IDs in other endpoints.
</Tip>


## OpenAPI

````yaml openapi-hockey GET /search
openapi: 3.1.0
info:
  title: SportsAPI Pro - Hockey API
  description: >-
    Professional hockey data API providing live scores, team statistics, player
    stats, standings, betting odds, and more for NHL, KHL, and international
    hockey leagues worldwide.
  version: 1.0.0
  contact:
    name: SportsAPI Pro Support
    email: support@sportsapipro.com
servers:
  - url: https://v1.hockey.sportsapipro.com
    description: Production API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Games
    description: Live scores, fixtures, and match data
  - name: Competitions
    description: Leagues and tournaments
  - name: Standings
    description: League tables and rankings
  - name: Athletes
    description: Player statistics and data
  - name: Betting
    description: Betting lines, props, and predictions
  - name: Search
    description: Search entities
  - name: Account
    description: Account status and usage
paths:
  /search:
    get:
      tags:
        - Search
      summary: Search
      description: Search for teams, players, and leagues by name
      operationId: search
      parameters:
        - name: query
          in: query
          required: true
          description: Search query
          schema:
            type: string
            example: Rangers
        - name: filter
          in: query
          description: 'Filter type: all, competitions, competitors, athletes'
          schema:
            type: string
            default: all
            enum:
              - all
              - competitions
              - competitors
              - athletes
      responses:
        '200':
          description: Search results retrieved successfully
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your SportsAPI Pro API key

````