Mayk IP TV

技術リファレンス

Xtream Codes IPTV APIフォーマット仕様

Xtream Codes IPTV APIの技術仕様解説。認証、カテゴリ、ライブ放送、VOD、シリーズエンドポイントと対話型JSONフォーマット検証機能。

Xtream Codes APIの基本構造

Xtream Codes APIは体系化されたRESTfulインターフェースを提供し、IPTVクライアントがログイン認証やコンテンツカタログの取得を安全に行うことを可能にします。

認証フローと契約情報プロファイル

アプリは認証情報を player_api.php に送信し、アカウントの契約ステータス、有効期限、サーバー接続パラメータを受け取ります。

カタログアクションとカテゴリ分類

専用のAPIアクションにより、ライブチャンネル、オンデマンド映画、および連続ドラマを分離して高速かつ効率的に取得できます。

統一されたストリーミングURL構造

配信リンクは、各メディア種別に応じた適切なコンテナ拡張子を伴う規則的なURLフォーマットに従って構成されます。

認証フィールド

フィールド / タグ階層タイプサンプル値説明
user_info.auth必須Integer (1 = success)1数値による認証状態判定:1 は認証成功、0 はアクセス拒否を示します。
user_info.status必須String ("Active")"Active"ユーザーアカウントの契約状態(Active、Expired、Bannedなど)。
user_info.exp_date必須Unix Timestamp / null"1775000000"ユーザーの利用期限日時を示すUnixタイムスタンプ数値。
user_info.max_connections必須String / Integer"2"このアカウントで許可されている同時ストリーミング接続の最大数。
user_info.allowed_output_formats必須Array of String["m3u8", "ts"]サポートされているストリーミングコンテナ形式の配列リスト(m3u8, ts, mp4, mkv)。
server_info必須Object{"url":"stream.example.com","port":"8080","https_port":"8443","server_protocol":"https"}接続ポート、配信プロトコル、サーバー詳細を含むデータオブジェクト。

カタログエンドポイントとアクション

フィールド / タグ階層タイプサンプル値説明
get_live_categories必須Array of Category Objects[{"category_id":"1","category_name":"News","parent_id":0}]ライブテレビ放送のカテゴリ一覧を取得するためのAPIアクション。
get_vod_categories必須Array of Category Objects[{"category_id":"10","category_name":"Action","parent_id":0}]ビデオオンデマンド(VOD)映画のカテゴリ一覧を取得するAPIアクション。
get_series_categories必須Array of Category Objects[{"category_id":"20","category_name":"Drama","parent_id":0}]テレビドラマシリーズのカテゴリ一覧を取得するためのAPIアクション。
get_live_streams必須Array of Live Stream Objects[{"stream_id":101,"name":"TRT 1 HD","stream_type":"live","category_id":"1"}]ライブ放送チャンネル全体または特定カテゴリ配下を一覧表示するAPIアクション。
get_vod_streams必須Array of VOD Stream Objects[{"stream_id":202,"name":"Example Movie","container_extension":"mp4","category_id":"10"}]VOD映画作品を全体またはカテゴリ別に一覧表示するAPIアクション。
get_series必須Array of Series Objects[{"series_id":303,"name":"Example Series","category_id":"20"}]利用可能なテレビドラマシリーズの全体目録を取得するAPIアクション。
get_series_info必須Series Detail Object (episodes map){"info":{"name":"Example Series"},"episodes":{"1":[{"id":"30301","episode_num":1,"title":"Episode 1"}]}}シーズンや各話リストを含むシリーズ詳細情報を取得するAPIアクション。

ライブ配信・VODデータフィールド

フィールド / タグ階層タイプサンプル値説明
stream_id必須Integer / String101ライブチャンネルまたはVOD作品に割り当てられた一意の数値ID。
name必須String"TRT 1 HD"プレーヤーの操作画面上に表示されるチャンネル名または作品タイトル。
stream_type必須String ("live" | "movie")"live"配信種別:テレビ放送は 'live'、映画作品は 'movie'。
stream_icon任意URL (http/https)"https://stream.example.com:8080/images/101.png"チャンネルロゴまたは映画ポスター画像への直接HTTPSリンクURL。
category_id必須String / Integer"1"コンテンツを特定のジャンルや区分に関連付けるカテゴリID数値。
container_extension必須String without dot ("mp4", "mkv", "m3u8")"mp4"先頭にドットを含まない動画形式拡張子(例: mp4, mkv, m3u8)。
is_adult任意Integer / String ("0" | "1")"0"成人向けコンテンツ判定フラグ:年齢制限対象は 1、それ以外は 0。

シリーズ・エピソードデータフィールド

フィールド / タグ階層タイプサンプル値説明
series_id必須Integer / String303テレビドラマシリーズに割り当てられた固有の数値識別番号。
name必須String"Example Series"シリーズ目録におけるドラマ作品の公式名称タイトル。
cover任意URL (http/https)"https://stream.example.com:8080/images/series303.png"シリーズのキービジュアルポスター画像への直接HTTPSリンクURL。
category_id必須String / Integer"20"シリーズ一覧における所属ジャンルのカテゴリ識別子。
season必須Integer / String1特定のエピソードが属するシーズン番号の数値表記。
episode_num必須Integer / String1該当シーズン内におけるエピソードの話数カウント順序。
container_extension必須String without dot ("mp4", "mkv")"mp4"エピソード動画ファイルの拡張子(先頭ドットなし)。

配信URLパターン

種別フィールド / タグサンプル値
ライブTV{server}/live/{username}/{password}/{stream_id}.m3u8https://stream.example.com:8080/live/demo_user/demo_pass/101.m3u8
映画 (VOD){server}/movie/{username}/{password}/{stream_id}.{container_extension}https://stream.example.com:8080/movie/demo_user/demo_pass/202.mp4
シリーズエピソード{server}/series/{username}/{password}/{episode_id}.{container_extension}https://stream.example.com:8080/series/demo_user/demo_pass/30301.mp4

サンプルテンプレート

GET /player_api.php (user_info & server_info)
{
  "user_info": {
    "username": "demo_user",
    "password": "demo_pass",
    "auth": 1,
    "status": "Active",
    "exp_date": "1775000000",
    "is_trial": "0",
    "active_cons": "0",
    "max_connections": "2",
    "created_at": "1700000000",
    "allowed_output_formats": [
      "m3u8",
      "ts",
      "mp4",
      "mkv"
    ]
  },
  "server_info": {
    "url": "stream.example.com",
    "port": "8080",
    "https_port": "8443",
    "server_protocol": "https",
    "rtmp_port": "8880",
    "timezone": "UTC",
    "timestamp_now": 1714000000,
    "time_now": "2026-10-26 10:00:00"
  }
}
get_live_streams & get_vod_streams
[
  {
    "num": 1,
    "name": "TRT 1 HD",
    "stream_type": "live",
    "stream_id": 101,
    "stream_icon": "https://stream.example.com:8080/images/101.png",
    "epg_channel_id": "trt1.tr",
    "added": "1700000000",
    "category_id": "1",
    "custom_sid": null,
    "tv_archive": 1,
    "direct_source": "",
    "tv_archive_duration": 3
  },
  {
    "num": 2,
    "name": "Example Movie (2026)",
    "stream_type": "movie",
    "stream_id": 202,
    "stream_icon": "https://stream.example.com:8080/images/202.png",
    "category_id": "10",
    "container_extension": "mp4",
    "rating": "8.4",
    "year": "2026"
  }
]
get_series_info (seasons & episodes)
{
  "seasons": [
    {
      "air_date": "2026-01-01",
      "episode_count": 10,
      "id": 1,
      "name": "Season 1",
      "overview": "First season overview",
      "season_number": 1,
      "cover": "https://stream.example.com:8080/images/season1.png"
    }
  ],
  "info": {
    "name": "Example Series",
    "cover": "https://stream.example.com:8080/images/series303.png",
    "plot": "Series plot description",
    "cast": "Actor One, Actor Two",
    "director": "Director Name",
    "genre": "Drama",
    "releaseDate": "2026-01-01",
    "rating": "8.7",
    "category_id": "20"
  },
  "episodes": {
    "1": [
      {
        "id": "30301",
        "episode_num": 1,
        "title": "Pilot",
        "container_extension": "mp4",
        "info": {
          "duration_secs": 2700,
          "duration": "00:45:00",
          "video": {},
          "audio": {},
          "bitrate": 4500
        },
        "season": 1
      }
    ]
  }
}

対話型フォーマットチェッカー

Mayk IP TVとの互換性を確認するために、以下にM3UスニペットまたはXtream JSON応答を貼り付けてください。

Xtream Codes API動作確認チェックリスト

  • 正規の契約者に対しては user_info.auth = 1 および Active ステータスを返却してください。
  • 空のカタログ項目に対しては null ではなく空のJSON配列 [] を返してください。
  • 各 category_id が実在する有効なカテゴリ定義を参照していることを確認してください。
  • container_extension には先頭ドットを付けずに拡張子を指定してください(例: mp4)。
  • 滑らかなシーク動作を実現するため、HTTP 206 Partial Content リクエストをサポートしてください。