Sehat Tersedia Terbatas Sebagian besar tidak tersedia Tidak ada data
Sehat
Memuat status kesehatan...
Tren 24 jam
Tren 30 hari
Mengambil komentar untuk postingan Reddit dengan dukungan token paginasi. Digunakan untuk meninjau diskusi dalam thread atau melanjutkan pencarian komentar tambahan untuk postingan yang diketahui.
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUE'
text
Saya ingin menggunakan API "Komentar Post (V1)" dari JustOneAPI.URL dasar: https://api.justoneapi.com.Jalur API: /api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUEEndpoint API: BASE_URL + /api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=VALUEMetode HTTP: GETAutentikasi: Tambahkan parameter query "token" ke URL.Definisi OpenAPI: https://docs.justoneapi.com/openapi/reddit/post-comments-v1-id.jsonParameter:- token (query): Token akses untuk layanan API ini. (Wajib)- postId (query): Identifikasi unik postingan Reddit. (Wajib)- cursor (query): Token paginasi untuk halaman hasil berikutnya.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 tercapai4. 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
import requestsBASE_URL = "https://api.justoneapi.com" # Diberikan oleh server OpenAPIurl = BASE_URL + "/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=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
const BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPIconst url = BASE_URL + "/api/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=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
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/reddit/get-post-comments/v1?token=YOUR_API_KEY&postId=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"); } }}
Reddit Komentar Post API (V1)
Mengambil komentar untuk postingan Reddit dengan dukungan token paginasi. Digunakan untuk meninjau diskusi dalam thread atau melanjutkan pencarian komentar tambahan untuk postingan yang diketahui.
Parameter
tokenstringpostIdstringcursorstringContoh Kode
Field Respons
Field Kunci dalam respons yang sukses (
code = 0).Pengiriman dan paginasi9 kolom
dataKomentar postingan di Reddit dengan metadata thread dan informasi kelanjutan cabang.
postInfoByIdobjectpostInfoById.idstringpostInfoById.titlestringpostInfoById.commentCountintegerpostInfoById.commentForestobjectpostInfoById.commentForest.pageInfoobjectpostInfoById.commentForest.pageInfo.commentCountinteger | nullpostInfoById.commentForest.pageInfo.hasNextPagebooleanpostInfoById.commentForest.treesarrayPohon komentar dan kelanjutan cabangnya8 kolom
data.postInfoById.commentForest.trees[]Satu komentar atau entri kelanjutan dalam data tersebut.
childCountintegerdepthintegerparentIdstring | nullnodeobject | nullmoreobject | nullmore.countintegermore.cursorstringmore.isTooDeepForCountbooleanKonten komentar14 kolom
data.postInfoById.commentForest.trees[].nodeidstringcreatedAtstringeditedAtpermalinkstringcontentobjectcontent.markdownstringcontent.previewstringcontent.richtextstringcontent.richtextMediaarraycontent.typeHintstringcontent.translationInfoobjectcontent.translationInfo.isTranslatedbooleancontent.translationInfo.translatedLanguagelanguageCodestring | nullStatus dan skor komentar11 kolom
data.postInfoById.commentForest.trees[].nodescoreintegerisScoreHiddenbooleanisAdminTakedownbooleanisArchivedbooleanisCommercialCommunicationbooleanisLockedbooleanisRemovedbooleanisStickiedbooleanisTranslatablebooleanremovedByCategorydistinguishedAsDetail penulis publik dan badge29 kolom
data.postInfoById.commentForest.trees[].nodeauthorInfoobjectauthorInfo.idstringauthorInfo.namestringauthorInfo.accountTypestringauthorInfo.iconSmallobjectauthorInfo.iconSmall.dimensionsobjectauthorInfo.iconSmall.dimensions.heightintegerauthorInfo.iconSmall.dimensions.widthintegerauthorInfo.iconSmall.urlstringauthorInfo.newIconobjectauthorInfo.newIcon.dimensionsobjectauthorInfo.newIcon.dimensions.heightintegerauthorInfo.newIcon.dimensions.widthintegerauthorInfo.newIcon.urlstringauthorInfo.snoovatarIconobject | nullauthorInfo.snoovatarIcon.dimensionsobjectauthorInfo.snoovatarIcon.dimensions.heightintegerauthorInfo.snoovatarIcon.dimensions.widthintegerauthorInfo.snoovatarIcon.urlstringauthorInfo.isCakeDayNowbooleanauthorInfo.profileobjectauthorInfo.profile.isNsfwbooleanauthorCommunityBadgeobject | nullauthorCommunityBadge.accessibilityLabelstringauthorCommunityBadge.labelstringauthorCommunityBadge.imageobjectauthorCommunityBadge.image.urlstringauthorFlairobject | nullauthorFlair.textstringInformasi komunitas6 kolom
data.postInfoById.subredditInformasi komunitas publik untuk postingan.
idstringnamestringprefixedNamestringisQuarantinedbooleanallowedMediaInCommentsarrayallowedMediaInComments[]stringContoh Respons