Reddit Post Details API (V1)
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
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Access token for this API service. |
postId | query | string | Yes | - | 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.
| Field | Type | Description |
|---|---|---|
id | string | Reddit full post ID, including its t3_ prefix. |
postTitle | string | Title reported for the post. |
permalink | string | Relative Reddit permalink path for this post. |
createdAt | string | Post creation timestamp as text. Reddit can return the time-zone offset without a colon. |
editedAt | string | null | Post edit timestamp when available. |
languageCode | string | Language code reported for the post. |
isSelfPost | boolean | Whether Reddit marks this as a self post. |
Body and links10 fields
data.postsInfoByIds[]
| Field | Type | Description |
|---|---|---|
url | string | URL associated with the post. |
domain | string | Domain label Reddit reports for the post. |
content | object | null | Post body when Reddit supplies it. The value can be null. |
content.markdown | string | Post body in Markdown as returned by Reddit. |
content.html | string | null | HTML representation of the post body when supplied. |
content.preview | string | null | Body preview when supplied. |
content.richtext | string | null | Serialized Reddit rich text as a string when available. |
outboundLink | object | Outbound link metadata returned for this post. |
outboundLink.url | string | Outbound URL reported by Reddit. |
outboundLink.expiresAt | string | Expiry timestamp associated with the outbound link. |
Author and community18 fields
data.postsInfoByIds[]
| Field | Type | Description |
|---|---|---|
authorInfo | object | Public information for the post author. |
authorInfo.id | string | Reddit full ID of the post author. |
authorInfo.name | string | Public Reddit username of the author. |
authorInfo.accountType | string | Account type reported for the author. |
subreddit | object | Community associated with the post when this section is returned. |
subreddit.id | string | Reddit community identifier. |
subreddit.name | string | Community name. |
subreddit.prefixedName | string | Community name with its Reddit prefix. |
subreddit.title | string | Community display title. |
subreddit.type | string | Community type reported by Reddit. |
subreddit.subscribersCount | number | Subscriber count reported for the community. |
subreddit.isNsfw | boolean | Whether Reddit marks the community as NSFW. |
subreddit.isQuarantined | boolean | Whether Reddit marks the community as quarantined. |
profile | object | Reddit profile where this post was published when the section is returned. |
profile.id | string | Reddit profile identifier. |
profile.name | string | Name of the Reddit profile. |
profile.subscribersCount | number | Subscriber count reported for the profile. |
profile.isNsfw | boolean | Whether Reddit marks the profile as NSFW. |
Engagement and awards11 fields
data.postsInfoByIds[]
| Field | Type | Description |
|---|---|---|
score | integer | Post score reported by Reddit. |
upvoteRatio | number | Post upvote ratio reported as a fraction from 0 to 1. |
commentCount | integer | Comment count reported for the post. |
postStats | object | Public post statistics returned by Reddit. |
postStats.shareAllTotal | integer | Total shares reported for the post. |
awardings | array | Award records returned for the post. |
awardings[] | object | One award type and its count. |
awardings[].total | integer | Count of this award reported for the post. |
awardings[].award | object | Public details for the award type. |
awardings[].award.id | string | Reddit award identifier. |
awardings[].award.name | string | Award display name. |
Streams and downloads22 fields
data.postsInfoByIds[].media
| Field | Type | Description |
|---|---|---|
streaming | object | null | Stream metadata when Reddit supplies it. |
streaming.hlsUrl | string | HLS stream manifest URL. |
streaming.dashUrl | string | DASH stream manifest URL. |
streaming.dimensions | object | Image or player dimensions in pixels. |
streaming.dimensions.width | integer | Width in pixels. |
streaming.dimensions.height | integer | Height in pixels. |
streaming.duration | integer | Duration value Reddit reports for the stream. |
streaming.isGif | boolean | Whether Reddit marks the stream as a GIF-style animation. |
download | object | null | Download metadata when Reddit supplies it. |
download.url | string | Media download URL returned by Reddit. |
packagedMedia | object | null | Packaged media when Reddit supplies it. |
packagedMedia.muxedMp4s | object | Packaged MP4 renditions grouped by quality. |
packagedMedia.muxedMp4s.low | object | Low-quality MP4 rendition. |
packagedMedia.muxedMp4s.low.url | string | Packaged MP4 URL. |
packagedMedia.muxedMp4s.medium | object | Medium-quality MP4 rendition. |
packagedMedia.muxedMp4s.medium.url | string | Packaged MP4 URL. |
packagedMedia.muxedMp4s.high | object | High-quality MP4 rendition. |
packagedMedia.muxedMp4s.high.url | string | Packaged MP4 URL. |
packagedMedia.muxedMp4s.highest | object | Highest-quality MP4 rendition returned in this collection. |
packagedMedia.muxedMp4s.highest.url | string | Packaged MP4 URL. |
packagedMedia.muxedMp4s.recommended | object | MP4 rendition recommended by Reddit. |
packagedMedia.muxedMp4s.recommended.url | string | Packaged MP4 URL. |
Images and thumbnails43 fields
data.postsInfoByIds[]
| Field | Type | Description |
|---|---|---|
media | object | null | Media included with the post, when present. Gallery media also has its own section. |
media.typeHint | string | null | Media type hint reported by Reddit when available. |
media.still | object | Still images for the post, including a source and resized renditions. |
media.still.source | object | Source still image. |
media.still.source.url | string | Still image URL. |
media.still.source.dimensions | object | Image or player dimensions in pixels. |
media.still.source.dimensions.width | integer | Width in pixels. |
media.still.source.dimensions.height | integer | Height in pixels. |
media.still.small | object | Small image rendition. |
media.still.small.url | string | Still image URL. |
media.still.small.dimensions | object | Image or player dimensions in pixels. |
media.still.small.dimensions.width | integer | Width in pixels. |
media.still.small.dimensions.height | integer | Height in pixels. |
media.still.medium | object | Medium image rendition. |
media.still.medium.url | string | Still image URL. |
media.still.medium.dimensions | object | Image or player dimensions in pixels. |
media.still.medium.dimensions.width | integer | Width in pixels. |
media.still.medium.dimensions.height | integer | Height in pixels. |
media.still.large | object | Large image rendition. |
media.still.large.url | string | Still image URL. |
media.still.large.dimensions | object | Image or player dimensions in pixels. |
media.still.large.dimensions.width | integer | Width in pixels. |
media.still.large.dimensions.height | integer | Height in pixels. |
media.still.xlarge | object | Extra-large image rendition. |
media.still.xlarge.url | string | Still image URL. |
media.still.xlarge.dimensions | object | Image or player dimensions in pixels. |
media.still.xlarge.dimensions.width | integer | Width in pixels. |
media.still.xlarge.dimensions.height | integer | Height in pixels. |
media.still.xxlarge | object | Double extra-large image rendition. |
media.still.xxlarge.url | string | Still image URL. |
media.still.xxlarge.dimensions | object | Image or player dimensions in pixels. |
media.still.xxlarge.dimensions.width | integer | Width in pixels. |
media.still.xxlarge.dimensions.height | integer | Height in pixels. |
media.still.xxxlarge | object | Triple extra-large image rendition. |
media.still.xxxlarge.url | string | Still image URL. |
media.still.xxxlarge.dimensions | object | Image or player dimensions in pixels. |
media.still.xxxlarge.dimensions.width | integer | Width in pixels. |
media.still.xxxlarge.dimensions.height | integer | Height in pixels. |
thumbnail | object | null | Post thumbnail when included. |
thumbnail.url | string | Thumbnail image URL. |
thumbnail.dimensions | object | Image or player dimensions in pixels. |
thumbnail.dimensions.width | integer | Width in pixels. |
thumbnail.dimensions.height | integer | Height in pixels. |
Gallery40 fields
data.postsInfoByIds[]
| Field | Type | Description |
|---|---|---|
gallery | object | null | Gallery included with the post, when present. |
gallery.items | array | Media entries in the gallery. |
gallery.items[] | object | One gallery entry. |
gallery.items[].id | string | Identifier of the gallery entry. |
gallery.items[].media | object | Media for this gallery entry. |
gallery.items[].media.id | string | Reddit identifier for the gallery media. |
gallery.items[].media.mimetype | string | MIME type of the gallery media. |
gallery.items[].media.url | string | URL returned for the gallery media. |
gallery.items[].media.width | integer | Gallery media width in pixels. |
gallery.items[].media.height | integer | Gallery media height in pixels. |
gallery.items[].media.small | object | Small image rendition. |
gallery.items[].media.small.url | string | Still image URL. |
gallery.items[].media.small.dimensions | object | Image or player dimensions in pixels. |
gallery.items[].media.small.dimensions.width | integer | Width in pixels. |
gallery.items[].media.small.dimensions.height | integer | Height in pixels. |
gallery.items[].media.medium | object | Medium image rendition. |
gallery.items[].media.medium.url | string | Still image URL. |
gallery.items[].media.medium.dimensions | object | Image or player dimensions in pixels. |
gallery.items[].media.medium.dimensions.width | integer | Width in pixels. |
gallery.items[].media.medium.dimensions.height | integer | Height in pixels. |
gallery.items[].media.large | object | Large image rendition. |
gallery.items[].media.large.url | string | Still image URL. |
gallery.items[].media.large.dimensions | object | Image or player dimensions in pixels. |
gallery.items[].media.large.dimensions.width | integer | Width in pixels. |
gallery.items[].media.large.dimensions.height | integer | Height in pixels. |
gallery.items[].media.xlarge | object | Extra-large image rendition. |
gallery.items[].media.xlarge.url | string | Still image URL. |
gallery.items[].media.xlarge.dimensions | object | Image or player dimensions in pixels. |
gallery.items[].media.xlarge.dimensions.width | integer | Width in pixels. |
gallery.items[].media.xlarge.dimensions.height | integer | Height in pixels. |
gallery.items[].media.xxlarge | object | Double extra-large image rendition. |
gallery.items[].media.xxlarge.url | string | Still image URL. |
gallery.items[].media.xxlarge.dimensions | object | Image or player dimensions in pixels. |
gallery.items[].media.xxlarge.dimensions.width | integer | Width in pixels. |
gallery.items[].media.xxlarge.dimensions.height | integer | Height in pixels. |
gallery.items[].media.xxxlarge | object | Triple extra-large image rendition. |
gallery.items[].media.xxxlarge.url | string | Still image URL. |
gallery.items[].media.xxxlarge.dimensions | object | Image or player dimensions in pixels. |
gallery.items[].media.xxxlarge.dimensions.width | integer | Width in pixels. |
gallery.items[].media.xxxlarge.dimensions.height | integer | Height in pixels. |
Status and display flags12 fields
data.postsInfoByIds[]
Reddit post details when available. The successful result can have null data.
| Field | Type | Description |
|---|---|---|
isNsfw | boolean | Whether Reddit marks the post as not safe for work. |
isSpoiler | boolean | Whether Reddit marks the post as a spoiler. |
isArchived | boolean | Whether Reddit marks the post as archived. |
isLocked | boolean | Whether Reddit marks the post as locked. |
isStickied | boolean | Whether Reddit marks the post as pinned. |
isScoreHidden | boolean | Whether Reddit flags the score as hidden. |
removedByCategory | string | null | Removal category reported by Reddit when available. A removed post can still have a content object. |
postHint | string | null | Post presentation hint reported by Reddit when available. |
suggestedCommentSort | string | null | Suggested display ordering for comments when available. |
flair | object | null | Post flair when available. |
flair.text | string | Display text of the post flair. |
flair.type | string | Post-flair type reported by Reddit. |
Response Example
Loading the response example...