---
title: "action=get_stream"
description: "Fetch a single live stream by numeric id. Returns the same shape as one item of get_streams."
---

# action=get_stream

Fetches a single live stream by its numeric id. The response payload has the exact shape of one item in the [action=get_streams](/docs/?page=xc-ref-streams-list) list. Use this when you already have a stream id and want a fresh read without paginating the full catalog, for example to refresh a channel-picker after the panel admin changes a channel name.

Both admin and reseller keys can call this endpoint. Streams are not filtered by reseller; any valid id is visible to any caller with `streams:read`.

## Endpoint

`GET https://<your-panel-domain>/panel-api/xc/{accesscode}/admin/index.php?action=get_stream&id=<stream-id>`

Also accepted: POST with `action=get_stream` and `id` in the body, and the `/reseller/index.php` sub-path.

## Authentication

Send the API key as `?api_key=<token>`, as an `api_key=<token>` POST field, or as `Authorization: Bearer <token>`.

## Required scope

`streams:read`. A key without the scope gets `STATUS_NO_PERMISSIONS` with `error: "insufficient_scope"`.

## Query parameters

| Name | Type | Required | Default | Description |
| ---- | ---- | -------- | ------- | ----------- |
| `action` | string | Yes | | Must be `get_stream`. |
| `api_key` | string | Yes (if not using Bearer) | | The API key. |
| `id` | int | Yes | | Numeric id of the stream. |

## Response

`data` is a single `Stream` object (not wrapped in `items`).

```json
{
  "status": "STATUS_SUCCESS",
  "data": {
    "id": 30,
    "name": "Channel 30",
    "icon": "https://cdn.example.com/logos/channel-30.png",
    "categories": [
      { "id": 1, "name": "Category 1" }
    ]
  }
}
```

Field-by-field.

| Field | Type | Description |
|---|---|---|
| `id` | int | Stream id. |
| `name` | string | Human-readable channel name. |
| `icon` | string | Absolute URL of the channel logo, or empty string if none. |
| `categories` | array | Zero or more category objects the stream belongs to. Each has `id` and `name`. |

## Examples

### cURL

```bash
curl "https://<your-panel-domain>/panel-api/xc/panel_api/admin/index.php?api_key=<your-api-key>&action=get_stream&id=30"
```

### PHP raw

```php
$url = 'https://<your-panel-domain>/panel-api/xc/panel_api/admin/index.php'
     . '?' . http_build_query([
         'api_key' => '<your-api-key>',
         'action'  => 'get_stream',
         'id'      => 30,
       ]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (($body['status'] ?? '') !== 'STATUS_SUCCESS') {
    $slug = $body['data']['error'] ?? 'unknown';
    throw new RuntimeException("get_stream failed: {$slug}");
}
$stream = $body['data'];
echo $stream['id'], "\t", $stream['name'], "\n";
```

### Python raw

```python
import requests

r = requests.get(
    "https://<your-panel-domain>/panel-api/xc/panel_api/admin/index.php",
    params={"api_key": "<your-api-key>", "action": "get_stream", "id": 30},
    timeout=30,
)
r.raise_for_status()
body = r.json()
if body["status"] != "STATUS_SUCCESS":
    raise RuntimeError(f"get_stream failed: {body['data'].get('error')}")
stream = body["data"]
print(stream["id"], stream["name"], stream["icon"])
```

## Errors

| `status` | `error` slug | When it happens | How to fix |
| -------- | ----------- | --------------- | ---------- |
| `STATUS_INVALID_DATA` | `validation_error` | `id` parameter is missing or empty. Response includes `data.details.field = "id"`. | Include `id=<numeric>`. |
| `STATUS_INVALID_DATA` | `validation_error` | `action` parameter is missing. | Include `action=get_stream`. |
| `STATUS_NO_PERMISSIONS` | `insufficient_scope` | The key does not carry `streams:read`. | Issue a new key with the scope. |
| `STATUS_FAILURE` | `not_found` | No stream exists with that id, or it was deleted. Response message: `Stream not found`. | Verify the id against [action=get_streams](/docs/?page=xc-ref-streams-list). |
| `STATUS_FAILURE` | `invalid_key` | Key not sent or not recognized. | Check the key value. |
| `STATUS_FAILURE` | `rate_limited` | Per-minute request budget exceeded. | Slow down. See [Rate limits & Idempotency](/docs/?page=panel-api-rate-limits-idempotency). |

## See also

- [action=get_streams](/docs/?page=xc-ref-streams-list). List endpoint with pagination.
- [action=get_movie](/docs/?page=xc-ref-movies-get). Same shape for a single VOD entry.
- [Panel API Catalog](/docs/?page=xai-ref-overview#streams). Native v1 detail endpoint.
