---
id: api-search
title: search Method — Match Search
description: Reference for the SEARCH method, which finds sports matches by team or participant name.
version: v1
language: en
---

# `search` Method — Match Search

## Purpose

The `search` method finds matches by team or participant name.

Live and Prematch are searched separately. A response may contain matches from multiple
sports available to the client's API key.

The method returns short match summaries without odds. To retrieve complete data and
odds for a selected match, call [`event`](event.md) using its `game_id`.

## Request

```http
GET https://YOUR_API_DOMAIN/v1/search/{type}/{lang}/{text}
```

Send the API key in the HTTP header:

```http
Package: YOUR_API_KEY
```

## Path Parameters

| Parameter | Type | Required | Description |
|---|---|---:|---|
| `type` | string | yes | Sports line type: `live` or `line` |
| `lang` | string | yes | Language used for names and search. It must be supported by the API and included in the client's subscription |
| `text` | string | yes | A full or partial team name, URL-encoded for use in the path |

Values of `type`:

| Value | Search scope |
|---|---|
| `live` | Matches currently in progress |
| `line` | Upcoming Prematch matches |

Search Live and Prematch separately. One request does not search both line types.

## Search Text Language

For relevant results, enter the name in the language specified by `lang`:

| `lang` | Example text |
|---|---|
| `en` | `Manchester`, `Perth` |

Search supports partial names. For example, `Manchester` may return matches involving
Manchester City, Manchester United, and other participants whose names contain that
text.

SportAPI determines the matches and their order. The method has no parameters for
selecting a sport, country, tournament, result count, or page.

## URL-encoding the Search Text

The `text` value is part of the URL, so spaces and special characters must be encoded.

For example, the text:

```text
Manchester City
```

becomes:

```text
Manchester%20City
```

In JavaScript, use `encodeURIComponent()`:

```js
const text = encodeURIComponent('Manchester City');
const url = `https://YOUR_API_DOMAIN/v1/search/line/en/${text}`;
```

Do not insert unprocessed user input into the URL.

## Live Request Example

Search for matches containing `Perth`:

```bash
curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/search/live/en/Perth' \
  --header 'Package: YOUR_API_KEY'
```

## Prematch Request Example

Search for matches containing `Manchester`:

```bash
curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/search/line/en/Manchester' \
  --header 'Package: YOUR_API_KEY'
```

## Shortened Live Response Example

The following is one match from a real English search response for `Perth`:

```json
{
  "status": 1,
  "page": "/v1/search",
  "body": [
    {
      "sgame_id": "69a6e9d05e99bd05c6f13963",
      "stat_id": "699986ec5e99bd05c6ea5357",
      "game_id": 746266480,
      "game_mid": 746266480,
      "game_start": 1787382000,
      "tournament_id": 980455,
      "tournament_name": "Australia. NPL. Western Australia",
      "opp_1_name": "Armadale",
      "opp_2_name": "Perth RedStar",
      "opp_1_icon": "398cfbf18abf67a8a1a27bbe2fc0b250.png",
      "opp_2_icon": "1c1a28702cd883376ed2516e4b123de6.png",
      "sport_id": 1,
      "sport_name": "Football",
      "score_full": "0:3",
      "period_name": "period",
      "timer": 4501,
      "country_id": 4,
      "country_name": "Australia"
    }
  ]
}
```

Scores, timers, and the contents of the sports line change over time.

## Response Structure

### Top-level Fields

| Field | Type | Description |
|---|---|---|
| `status` | number | Request status. A successful response returns `1` |
| `page` | string | Method name. Search returns `/v1/search` |
| `body` | array | Flat array of matching matches |

Results are not grouped by sport, country, or tournament.

### Match Fields

| Field | Type | Description |
|---|---|---|
| `sgame_id` | string | Reserved test field. It is not currently used by the API |
| `stat_id` | string | Reserved test field. It is not currently used by the API |
| `game_id` | number | Match ID for requesting the detailed `event` method |
| `game_mid` | number or `null` | Main match ID |
| `game_start` | number | Start time as a Unix timestamp in seconds |
| `tournament_id` | number | Tournament ID |
| `tournament_name` | string | Tournament name in the selected language |
| `opp_1_name` | string | First team or participant |
| `opp_2_name` | string | Second team or participant |
| `opp_1_icon` | string | Icon file name for the first team or participant |
| `opp_2_icon` | string | Icon file name for the second team or participant |
| `sport_id` | number | Sport ID |
| `sport_name` | string | Sport name in the selected language |
| `score_full` | string | Current score. Prematch usually returns `0:0` |
| `period_name` | string | Current period of a Live match. Prematch returns an empty string |
| `timer` | number | Live match timer in seconds. Divide by `60` to obtain minutes. Prematch usually returns `0` |
| `country_id` | number | Country ID |
| `country_name` | string | Country name in the selected language |

The search response does not contain `game_oc_list`, `stat_list`, `sub_games`,
`event_plan`, `va`, `vi`, or `zp`. Retrieve these fields through other methods using
`game_id`.

All common fields are documented in the
[Sport Line API Field Reference](../data-models/field-reference.md).

## Icons

Build the sport icon URL from `sport_id`:

```text
https://cdn.sportapi.net/sports/v1/color/{sport_id}.webp
```

Build the country icon URL from `country_id`:

```text
https://cdn.sportapi.net/flags/v1/color/{country_id}.webp
```

Build the tournament icon URL from `tournament_id`:

```text
https://cdn.sportapi.net/tournaments/v1/color/{tournament_id}.webp
```

For a team icon, remove the extension from `opp_1_icon` or `opp_2_icon` and insert the
remaining name into the URL:

```text
https://cdn.sportapi.net/opp/v1/color/{iconName}.webp
```

## No Matches Found

No matches being found is not an error. The API returns a successful response with an
empty `body` array:

```json
{
  "status": 1,
  "page": "/v1/search",
  "body": []
}
```

Display this response as “No matches found” in the interface.

## Subscription Restrictions

The response contains only matches from sports and languages available to the client's
API key. One request may return matches from several available sports.

## Snapshot of Saved Responses

The Live examples used the `Perth` search, while the Prematch examples used
`Manchester`.

| Line type | Search text | Results in the saved English response |
|---|---|---:|
| Live | `Perth` | 10 |
| Prematch (`line`) | `Manchester` | 17 |

These result counts apply only to snapshots retrieved on August 22, 2026. They are not
permanent method limits.

Full unabridged responses:

- [Live, Russian response](../examples/json-responses/search.query-perth.live.ru.json)
- [Live, English, search for “Perth”](../examples/json-responses/search.query-perth.live.en.json)
- [Prematch, Russian response](../examples/json-responses/search.query-manchester.line.ru.json)
- [Prematch, English, search for “Manchester”](../examples/json-responses/search.query-manchester.line.en.json)

The files contain only API response bodies. No API key is stored in them.

## When to Make the Request

`search` is intended to run in response to a user action. It does not require a
continuous background update loop. Send a new request after the user enters or changes
the search text.

Key, subscription, and parameter errors are documented in
[Error Handling](../getting-started/error-handling.md).
