Skip to content

Reddit Post Details API (V1) ​

GET
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...

Retrieves details for a Reddit post identified by its full post ID. Use it to look up a known post before discussion review, content analysis, or subsequent comment retrieval.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for this API service.
postIdquerystringYes-The Reddit post identifier in t3_<post-id> format.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/reddit/get-post-detail/v1?token=YOUR_API_KEY&postId=VALUE'
text
I want to use the "Post Details (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/reddit/get-post-detail/v1?token=YOUR_API_KEY&postId=VALUE
API Endpoint: BASE_URL + /api/reddit/get-post-detail/v1?token=YOUR_API_KEY&postId=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/reddit/post-details-v1-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- postId (query): The Reddit post identifier in t3_<post-id> format. (Required)

Return format: safely handle JSON or text according to the actual Content-Type.

Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
   - 0: Success
   - 100: Invalid or Inactive Token
   - 301: Collection Failed. Please Retry.
   - 302: Rate Limit Exceeded
   - 303: Daily Quota Exceeded
   - 400: Invalid Parameters
   - 500: Internal Server Error
   - 600: Permission Denied
   - 601: Insufficient Balance
   - 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.

Please help me write a script in my preferred programming language to call this API and handle the response.
python
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/reddit/get-post-detail/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"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/reddit/get-post-detail/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"; // Provided by OpenAPI servers
        final String url = BASE_URL + "/api/reddit/get-post-detail/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");
        }
    }
}
go
package main

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

const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/reddit/get-post-detail/v1?token=YOUR_API_KEY&postId=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
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/reddit/get-post-detail/v1?token=YOUR_API_KEY&postId=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;
}

Response Fields ​

Key fields in a successful response (code = 0).

Post overview7 fields

data.postsInfoByIds[]

Post lookup results. A missing result can appear as a null entry.

FieldTypeDescription
idstringReddit full post ID, including its t3_ prefix.
postTitlestringTitle reported for the post.
permalinkstringRelative Reddit permalink path for this post.
createdAtstringPost creation timestamp as text. Reddit can return the time-zone offset without a colon.
editedAtstring | nullPost edit timestamp when available.
languageCodestringLanguage code reported for the post.
isSelfPostbooleanWhether Reddit marks this as a self post.
Body and links10 fields

data.postsInfoByIds[]

FieldTypeDescription
urlstringURL associated with the post.
domainstringDomain label Reddit reports for the post.
contentobject | nullPost body when Reddit supplies it. The value can be null.
content.markdownstringPost body in Markdown as returned by Reddit.
content.htmlstring | nullHTML representation of the post body when supplied.
content.previewstring | nullBody preview when supplied.
content.richtextstring | nullSerialized Reddit rich text as a string when available.
outboundLinkobjectOutbound link metadata returned for this post.
outboundLink.urlstringOutbound URL reported by Reddit.
outboundLink.expiresAtstringExpiry timestamp associated with the outbound link.
Author and community18 fields

data.postsInfoByIds[]

FieldTypeDescription
authorInfoobjectPublic information for the post author.
authorInfo.idstringReddit full ID of the post author.
authorInfo.namestringPublic Reddit username of the author.
authorInfo.accountTypestringAccount type reported for the author.
subredditobjectCommunity associated with the post when this section is returned.
subreddit.idstringReddit community identifier.
subreddit.namestringCommunity name.
subreddit.prefixedNamestringCommunity name with its Reddit prefix.
subreddit.titlestringCommunity display title.
subreddit.typestringCommunity type reported by Reddit.
subreddit.subscribersCountnumberSubscriber count reported for the community.
subreddit.isNsfwbooleanWhether Reddit marks the community as NSFW.
subreddit.isQuarantinedbooleanWhether Reddit marks the community as quarantined.
profileobjectReddit profile where this post was published when the section is returned.
profile.idstringReddit profile identifier.
profile.namestringName of the Reddit profile.
profile.subscribersCountnumberSubscriber count reported for the profile.
profile.isNsfwbooleanWhether Reddit marks the profile as NSFW.
Engagement and awards11 fields

data.postsInfoByIds[]

FieldTypeDescription
scoreintegerPost score reported by Reddit.
upvoteRationumberPost upvote ratio reported as a fraction from 0 to 1.
commentCountintegerComment count reported for the post.
postStatsobjectPublic post statistics returned by Reddit.
postStats.shareAllTotalintegerTotal shares reported for the post.
awardingsarrayAward records returned for the post.
awardings[]objectOne award type and its count.
awardings[].totalintegerCount of this award reported for the post.
awardings[].awardobjectPublic details for the award type.
awardings[].award.idstringReddit award identifier.
awardings[].award.namestringAward display name.
Streams and downloads22 fields

data.postsInfoByIds[].media

FieldTypeDescription
streamingobject | nullStream metadata when Reddit supplies it.
streaming.hlsUrlstringHLS stream manifest URL.
streaming.dashUrlstringDASH stream manifest URL.
streaming.dimensionsobjectImage or player dimensions in pixels.
streaming.dimensions.widthintegerWidth in pixels.
streaming.dimensions.heightintegerHeight in pixels.
streaming.durationintegerDuration value Reddit reports for the stream.
streaming.isGifbooleanWhether Reddit marks the stream as a GIF-style animation.
downloadobject | nullDownload metadata when Reddit supplies it.
download.urlstringMedia download URL returned by Reddit.
packagedMediaobject | nullPackaged media when Reddit supplies it.
packagedMedia.muxedMp4sobjectPackaged MP4 renditions grouped by quality.
packagedMedia.muxedMp4s.lowobjectLow-quality MP4 rendition.
packagedMedia.muxedMp4s.low.urlstringPackaged MP4 URL.
packagedMedia.muxedMp4s.mediumobjectMedium-quality MP4 rendition.
packagedMedia.muxedMp4s.medium.urlstringPackaged MP4 URL.
packagedMedia.muxedMp4s.highobjectHigh-quality MP4 rendition.
packagedMedia.muxedMp4s.high.urlstringPackaged MP4 URL.
packagedMedia.muxedMp4s.highestobjectHighest-quality MP4 rendition returned in this collection.
packagedMedia.muxedMp4s.highest.urlstringPackaged MP4 URL.
packagedMedia.muxedMp4s.recommendedobjectMP4 rendition recommended by Reddit.
packagedMedia.muxedMp4s.recommended.urlstringPackaged MP4 URL.
Images and thumbnails43 fields

data.postsInfoByIds[]

FieldTypeDescription
mediaobject | nullMedia included with the post, when present. Gallery media also has its own section.
media.typeHintstring | nullMedia type hint reported by Reddit when available.
media.stillobjectStill images for the post, including a source and resized renditions.
media.still.sourceobjectSource still image.
media.still.source.urlstringStill image URL.
media.still.source.dimensionsobjectImage or player dimensions in pixels.
media.still.source.dimensions.widthintegerWidth in pixels.
media.still.source.dimensions.heightintegerHeight in pixels.
media.still.smallobjectSmall image rendition.
media.still.small.urlstringStill image URL.
media.still.small.dimensionsobjectImage or player dimensions in pixels.
media.still.small.dimensions.widthintegerWidth in pixels.
media.still.small.dimensions.heightintegerHeight in pixels.
media.still.mediumobjectMedium image rendition.
media.still.medium.urlstringStill image URL.
media.still.medium.dimensionsobjectImage or player dimensions in pixels.
media.still.medium.dimensions.widthintegerWidth in pixels.
media.still.medium.dimensions.heightintegerHeight in pixels.
media.still.largeobjectLarge image rendition.
media.still.large.urlstringStill image URL.
media.still.large.dimensionsobjectImage or player dimensions in pixels.
media.still.large.dimensions.widthintegerWidth in pixels.
media.still.large.dimensions.heightintegerHeight in pixels.
media.still.xlargeobjectExtra-large image rendition.
media.still.xlarge.urlstringStill image URL.
media.still.xlarge.dimensionsobjectImage or player dimensions in pixels.
media.still.xlarge.dimensions.widthintegerWidth in pixels.
media.still.xlarge.dimensions.heightintegerHeight in pixels.
media.still.xxlargeobjectDouble extra-large image rendition.
media.still.xxlarge.urlstringStill image URL.
media.still.xxlarge.dimensionsobjectImage or player dimensions in pixels.
media.still.xxlarge.dimensions.widthintegerWidth in pixels.
media.still.xxlarge.dimensions.heightintegerHeight in pixels.
media.still.xxxlargeobjectTriple extra-large image rendition.
media.still.xxxlarge.urlstringStill image URL.
media.still.xxxlarge.dimensionsobjectImage or player dimensions in pixels.
media.still.xxxlarge.dimensions.widthintegerWidth in pixels.
media.still.xxxlarge.dimensions.heightintegerHeight in pixels.
thumbnailobject | nullPost thumbnail when included.
thumbnail.urlstringThumbnail image URL.
thumbnail.dimensionsobjectImage or player dimensions in pixels.
thumbnail.dimensions.widthintegerWidth in pixels.
thumbnail.dimensions.heightintegerHeight in pixels.
Gallery40 fields

data.postsInfoByIds[]

FieldTypeDescription
galleryobject | nullGallery included with the post, when present.
gallery.itemsarrayMedia entries in the gallery.
gallery.items[]objectOne gallery entry.
gallery.items[].idstringIdentifier of the gallery entry.
gallery.items[].mediaobjectMedia for this gallery entry.
gallery.items[].media.idstringReddit identifier for the gallery media.
gallery.items[].media.mimetypestringMIME type of the gallery media.
gallery.items[].media.urlstringURL returned for the gallery media.
gallery.items[].media.widthintegerGallery media width in pixels.
gallery.items[].media.heightintegerGallery media height in pixels.
gallery.items[].media.smallobjectSmall image rendition.
gallery.items[].media.small.urlstringStill image URL.
gallery.items[].media.small.dimensionsobjectImage or player dimensions in pixels.
gallery.items[].media.small.dimensions.widthintegerWidth in pixels.
gallery.items[].media.small.dimensions.heightintegerHeight in pixels.
gallery.items[].media.mediumobjectMedium image rendition.
gallery.items[].media.medium.urlstringStill image URL.
gallery.items[].media.medium.dimensionsobjectImage or player dimensions in pixels.
gallery.items[].media.medium.dimensions.widthintegerWidth in pixels.
gallery.items[].media.medium.dimensions.heightintegerHeight in pixels.
gallery.items[].media.largeobjectLarge image rendition.
gallery.items[].media.large.urlstringStill image URL.
gallery.items[].media.large.dimensionsobjectImage or player dimensions in pixels.
gallery.items[].media.large.dimensions.widthintegerWidth in pixels.
gallery.items[].media.large.dimensions.heightintegerHeight in pixels.
gallery.items[].media.xlargeobjectExtra-large image rendition.
gallery.items[].media.xlarge.urlstringStill image URL.
gallery.items[].media.xlarge.dimensionsobjectImage or player dimensions in pixels.
gallery.items[].media.xlarge.dimensions.widthintegerWidth in pixels.
gallery.items[].media.xlarge.dimensions.heightintegerHeight in pixels.
gallery.items[].media.xxlargeobjectDouble extra-large image rendition.
gallery.items[].media.xxlarge.urlstringStill image URL.
gallery.items[].media.xxlarge.dimensionsobjectImage or player dimensions in pixels.
gallery.items[].media.xxlarge.dimensions.widthintegerWidth in pixels.
gallery.items[].media.xxlarge.dimensions.heightintegerHeight in pixels.
gallery.items[].media.xxxlargeobjectTriple extra-large image rendition.
gallery.items[].media.xxxlarge.urlstringStill image URL.
gallery.items[].media.xxxlarge.dimensionsobjectImage or player dimensions in pixels.
gallery.items[].media.xxxlarge.dimensions.widthintegerWidth in pixels.
gallery.items[].media.xxxlarge.dimensions.heightintegerHeight in pixels.
Status and display flags12 fields

data.postsInfoByIds[]

Reddit post details when available. The successful result can have null data.

FieldTypeDescription
isNsfwbooleanWhether Reddit marks the post as not safe for work.
isSpoilerbooleanWhether Reddit marks the post as a spoiler.
isArchivedbooleanWhether Reddit marks the post as archived.
isLockedbooleanWhether Reddit marks the post as locked.
isStickiedbooleanWhether Reddit marks the post as pinned.
isScoreHiddenbooleanWhether Reddit flags the score as hidden.
removedByCategorystring | nullRemoval category reported by Reddit when available. A removed post can still have a content object.
postHintstring | nullPost presentation hint reported by Reddit when available.
suggestedCommentSortstring | nullSuggested display ordering for comments when available.
flairobject | nullPost flair when available.
flair.textstringDisplay text of the post flair.
flair.typestringPost-flair type reported by Reddit.

Response Example ​

Loading the response example...