---
title: "Bilibili Balasan Komentar API (V1)"
description: "Mengambil halaman balasan untuk komentar video tingkat atas Bilibili. Gunakan untuk membaca atau menganalisis diskusi di bawah komentar tertentu."
lastUpdated: false
aiUsagePrompt: true
---

# Bilibili Balasan Komentar API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/bilibili/get-video-sub-comment/v1\"")'
  :summary='JSON.parse("\"Balasan Komentar (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/bilibili/comment-replies-v1-id.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Token akses untuk API.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"aid\",\"in\":\"query\",\"description\":\"ID Arsip Desimal (AID) dari video.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"commentId\",\"in\":\"query\",\"description\":\"ID komentar tingkat atas. Gunakan nilai rpid_str dari respons komentar video.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"page\",\"in\":\"query\",\"description\":\"Nomor halaman balasan, mulai dari 1.\",\"required\":false,\"schema\":{\"type\":\"integer\",\"format\":\"int32\",\"default\":1}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Respons Bilibili untuk satu halaman balasan komentar tingkat atas.\",\"properties\":{\"code\":{\"type\":\"integer\",\"description\":\"Kode status bisnis yang dilaporkan oleh Bilibili.\"},\"message\":{\"type\":\"string\",\"description\":\"Pesan status bisnis yang dilaporkan oleh Bilibili.\"},\"ttl\":{\"type\":\"integer\",\"description\":\"Nilai TTL yang dilaporkan dalam respons Bilibili.\"},\"data\":{\"type\":\"object\",\"description\":\"Halaman balasan yang diminta dan komentar tingkat atasnya.\",\"properties\":{\"page\":{\"type\":\"object\",\"description\":\"Informasi paginasi untuk thread balasan.\",\"properties\":{\"num\":{\"type\":\"integer\",\"description\":\"Nomor halaman saat ini.\"},\"size\":{\"type\":\"integer\",\"description\":\"Ukuran halaman yang dilaporkan oleh Bilibili.\"},\"count\":{\"type\":\"integer\",\"description\":\"Jumlah total balasan yang dilaporkan untuk thread tersebut.\"}}},\"replies\":{\"type\":[\"array\",\"null\"],\"description\":\"Balasan yang diberikan pada halaman saat ini.\",\"items\":{\"type\":\"object\",\"description\":\"Salah satu balasan dalam thread komentar yang diminta.\",\"properties\":{\"rpid\":{\"type\":\"integer\",\"description\":\"ID komentar Bilibili berupa angka.\"},\"rpid_str\":{\"type\":\"string\",\"description\":\"Representasi string desimal dari ID komentar.\"},\"oid\":{\"type\":\"integer\",\"description\":\"ID numerik arsip video.\"},\"root\":{\"type\":\"integer\",\"description\":\"ID numerik komentar tingkat atas.\"},\"root_str\":{\"type\":\"string\",\"description\":\"Representasi string desimal dari ID komentar tingkat atas.\"},\"parent\":{\"type\":\"integer\",\"description\":\"ID numerik komentar yang ditangani oleh balasan ini.\"},\"parent_str\":{\"type\":\"string\",\"description\":\"Representasi string desimal dari ID komentar induk langsung.\"},\"ctime\":{\"type\":\"integer\",\"description\":\"Waktu pembuatan balasan dalam format timestamp Unix dalam detik.\"},\"like\":{\"type\":\"integer\",\"description\":\"Jumlah suka untuk balasan.\"},\"member\":{\"type\":\"object\",\"description\":\"Informasi profil publik penulis balasan.\",\"properties\":{\"mid\":{\"type\":\"string\",\"description\":\"ID pengguna Bilibili dari penulis balasan.\"},\"uname\":{\"type\":\"string\",\"description\":\"Nama tampilan penulis balasan.\"},\"avatar\":{\"type\":\"string\",\"description\":\"URL avatar penulis balasan.\"}}},\"content\":{\"type\":\"object\",\"description\":\"Isi komentar.\",\"properties\":{\"message\":{\"type\":\"string\",\"description\":\"Teks komentar.\"}}}}}},\"root\":{\"type\":[\"object\",\"null\"],\"description\":\"Komentar tingkat atas yang memiliki thread tersebut.\",\"properties\":{\"rpid\":{\"type\":\"integer\",\"description\":\"ID komentar Bilibili berupa angka.\"},\"rpid_str\":{\"type\":\"string\",\"description\":\"Representasi string desimal dari ID komentar.\"},\"oid\":{\"type\":\"integer\",\"description\":\"ID numerik arsip video.\"},\"rcount\":{\"type\":\"integer\",\"description\":\"Jumlah balasan yang dilaporkan untuk komentar ini.\"},\"content\":{\"type\":\"object\",\"description\":\"Isi komentar.\",\"properties\":{\"message\":{\"type\":\"string\",\"description\":\"Teks komentar.\"}}}}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Parameter atau isi permintaan yang tidak valid\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Token akses yang tidak valid atau tidak aktif\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Izin ditolak\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Laju permintaan atau batas kuota harian terlampaui\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Kesalahan server internal\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Layanan sementara tidak tersedia\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"API produksi global (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/bilibili/get-video-sub-comment/v1\"")' />

<p>Mengambil halaman balasan untuk komentar video tingkat atas Bilibili. Gunakan untuk membaca atau menganalisis diskusi di bawah komentar tertentu.</p>

## Parameter

<div class="api-doc-table api-doc-table--params">

| Nama | Lokasi | Jenis | Wajib | Bawaan | Deskripsi |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Ya | - | Token akses untuk API. |
| <code>aid</code> | query | <code>string</code> | Ya | - | ID Arsip Desimal (AID) dari video. |
| <code>commentId</code> | query | <code>string</code> | Ya | - | ID komentar tingkat atas. Gunakan nilai rpid_str dari respons komentar video. |
| <code>page</code> | query | <code>integer</code> | Tidak | <code>1</code> | Nomor halaman balasan, mulai dari 1. |

</div>

## Contoh Kode

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE'
```

```text [🤖 Prompt AI]
Saya ingin menggunakan API "Balasan Komentar (V1)" dari JustOneAPI.
URL dasar: https://api.justoneapi.com.
Jalur API: /api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE
Endpoint API: BASE_URL + /api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE
Metode HTTP: GET
Autentikasi: Tambahkan parameter query "token" ke URL.
Definisi OpenAPI: https://docs.justoneapi.com/openapi/bilibili/comment-replies-v1-id.json

Parameter:
- token (query): Token akses untuk API. (Wajib)
- aid (query): ID Arsip Desimal (AID) dari video. (Wajib)
- commentId (query): ID komentar tingkat atas. Gunakan nilai rpid_str dari respons komentar video. (Wajib)
- page (query): Nomor halaman balasan, mulai dari 1.

Format Kembalian: tangani dengan aman JSON atau teks sesuai dengan Content-Type yang sebenarnya.

Penanganan respons dan kode kesalahan:
1. Tentukan hasil pemrosesan dari kolom "code" dalam isi respons (code 0 berarti berhasil).
2. Batas waktu yang disarankan: Atur batas waktu permintaan menjadi 120 detik. Jika 120 detik terlalu lama untuk kebutuhan Anda, gunakan setidaknya 60 detik. Sebagian kecil permintaan mungkin mencapai batas waktu sebelum hasil diterima.
3. Kode hasil:
   - 0: Berhasil
   - 100: Token tidak valid atau tidak aktif
   - 301: Gagal mengambil data. Silakan coba lagi.
   - 302: Batas frekuensi permintaan terlampaui
   - 303: Kuota harian terlampaui
   - 400: Parameter tidak valid
   - 500: Kesalahan internal server
   - 600: Akses ditolak
   - 601: Saldo tidak mencukupi
   - 602: Batas anggaran token tercapai
4. Kode 601 berarti saldo bersama akun tidak mencukupi. Kode 602 berarti token API yang digunakan telah mencapai batas anggaran kumulatifnya sendiri. Menetapkan batas anggaran token tidak memindahkan dana dari saldo bersama akun.

Tolong bantu saya menulis skrip dalam bahasa pemrograman favorit saya untuk memanggil API ini dan menangani responsnya.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Diberikan oleh server OpenAPI

url = BASE_URL + "/api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
const url = BASE_URL + "/api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
        final String url = BASE_URL + "/api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Diberikan oleh server OpenAPI

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Diberikan oleh server OpenAPI
$url = $BASE_URL . '/api/bilibili/get-video-sub-comment/v1?token=YOUR_API_KEY&aid=VALUE&commentId=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/bilibili/comment-replies-v1-id.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[Definisi OpenAPI (JSON)]</a>
</div>

## Field Respons

Field Kunci dalam respons yang sukses (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Jalur Field | Jenis | Deskripsi |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | Respons Bilibili untuk satu halaman balasan komentar tingkat atas. |
| <code>data.code</code> | <code>integer</code> | Kode status bisnis yang dilaporkan oleh Bilibili. |
| <code>data.message</code> | <code>string</code> | Pesan status bisnis yang dilaporkan oleh Bilibili. |
| <code>data.ttl</code> | <code>integer</code> | Nilai TTL yang dilaporkan dalam respons Bilibili. |
| <code>data.data</code> | <code>object</code> | Halaman balasan yang diminta dan komentar tingkat atasnya. |
| <code>data.data.page</code> | <code>object</code> | Informasi paginasi untuk thread balasan. |
| <code>data.data.page.num</code> | <code>integer</code> | Nomor halaman saat ini. |
| <code>data.data.page.size</code> | <code>integer</code> | Ukuran halaman yang dilaporkan oleh Bilibili. |
| <code>data.data.page.count</code> | <code>integer</code> | Jumlah total balasan yang dilaporkan untuk thread tersebut. |
| <code>data.data.replies</code> | <code>array &#124; null</code> | Balasan yang diberikan pada halaman saat ini. |
| <code>data.data.replies[]</code> | <code>object</code> | Salah satu balasan dalam thread komentar yang diminta. |
| <code>data.data.replies[].rpid</code> | <code>integer</code> | ID komentar Bilibili berupa angka. |
| <code>data.data.replies[].rpid_str</code> | <code>string</code> | Representasi string desimal dari ID komentar. |
| <code>data.data.replies[].oid</code> | <code>integer</code> | ID numerik arsip video. |
| <code>data.data.replies[].root</code> | <code>integer</code> | ID numerik komentar tingkat atas. |
| <code>data.data.replies[].root_str</code> | <code>string</code> | Representasi string desimal dari ID komentar tingkat atas. |
| <code>data.data.replies[].parent</code> | <code>integer</code> | ID numerik komentar yang ditangani oleh balasan ini. |
| <code>data.data.replies[].parent_str</code> | <code>string</code> | Representasi string desimal dari ID komentar induk langsung. |
| <code>data.data.replies[].ctime</code> | <code>integer</code> | Waktu pembuatan balasan dalam format timestamp Unix dalam detik. |
| <code>data.data.replies[].like</code> | <code>integer</code> | Jumlah suka untuk balasan. |
| <code>data.data.replies[].member</code> | <code>object</code> | Informasi profil publik penulis balasan. |
| <code>data.data.replies[].member.mid</code> | <code>string</code> | ID pengguna Bilibili dari penulis balasan. |
| <code>data.data.replies[].member.uname</code> | <code>string</code> | Nama tampilan penulis balasan. |
| <code>data.data.replies[].member.avatar</code> | <code>string</code> | URL avatar penulis balasan. |
| <code>data.data.replies[].content</code> | <code>object</code> | Isi komentar. |
| <code>data.data.replies[].content.message</code> | <code>string</code> | Teks komentar. |
| <code>data.data.root</code> | <code>object &#124; null</code> | Komentar tingkat atas yang memiliki thread tersebut. |
| <code>data.data.root.rpid</code> | <code>integer</code> | ID komentar Bilibili berupa angka. |
| <code>data.data.root.rpid_str</code> | <code>string</code> | Representasi string desimal dari ID komentar. |
| <code>data.data.root.oid</code> | <code>integer</code> | ID numerik arsip video. |
| <code>data.data.root.rcount</code> | <code>integer</code> | Jumlah balasan yang dilaporkan untuk komentar ini. |
| <code>data.data.root.content</code> | <code>object</code> | Isi komentar. |
| <code>data.data.root.content.message</code> | <code>string</code> | Teks komentar. |

</div>

## Contoh Respons

<ApiExampleSection :api='JSON.parse("\"/api/bilibili/get-video-sub-comment/v1\"")' />

