Skip to content

Reddit Keyword Search API (V1) ​

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

Searches Reddit posts by keyword with an optional continuation token. Use it to discover topic-related discussions or continue through additional search-result pages.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for this API service.
keywordquerystringYes-Search query keywords.
afterquerystringNoPagination token to retrieve the next set of results.

Code Samples ​

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

Parameters:
- token (query): Access token for this API service. (Required)
- keyword (query): Search query keywords. (Required)
- after (query): Pagination token to retrieve the next set of results.

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/search/v1?token=YOUR_API_KEY&keyword=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/search/v1?token=YOUR_API_KEY&keyword=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/search/v1?token=YOUR_API_KEY&keyword=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/search/v1?token=YOUR_API_KEY&keyword=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/search/v1?token=YOUR_API_KEY&keyword=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).

Pagination4 fields

data.search.dynamic.components.main.pageInfo

Pagination information for the current search page.

FieldTypeDescription
endCursorstringPass this cursor unchanged as after with the same keyword to request the next page when hasNextPage is true.
hasNextPagebooleanWhether Reddit reports that a subsequent page is available.
hasPreviousPagebooleanWhether Reddit reports that an earlier page is available.
startCursorstringCursor reported at the start of the current page.
Search response structure5 fields

data

Reddit search results and pagination information.

FieldTypeDescription
searchobjectSearch result data.
search.dynamicobjectDynamic result data returned for the search.
search.dynamic.componentsobjectComponents returned for the search results.
search.dynamic.components.__typenamestringGraphQL type name of the search components object.
search.dynamic.components.mainobjectMain result connection, containing result edges and page information.
Search result components8 fields

data.search.dynamic.components.main

FieldTypeDescription
edgesarrayResult edges on the page. An edge can contain a list, a row, or another search component.
edges[]objectOne result edge.
edges[].cursorstringCursor reported for this result edge.
edges[].nodeobjectSearch component on this edge. Some component types contain post results.
edges[].node.__typenamestringGraphQL type identifying the search component.
edges[].node.childrenarrayChild results of the component, when present.
edges[].node.children[]objectOne child result. Post results include a post object.
edges[].node.children[].__typenamestringGraphQL type identifying the child result.
Search filters6 fields

data.search.dynamic.components

FieldTypeDescription
appliedStateobjectSearch filters and result pane reported for this response.
appliedState.filtersarrayFilters reported as applied to the search results.
appliedState.filters[]objectOne reported search filter.
appliedState.filters[].keystringName of the reported filter.
appliedState.filters[].valuestringValue of the reported filter.
appliedState.panestringResult pane reported for the search.
Post information15 fields

data.search.dynamic.components.main.edges[].node.children[].post

Post information for a post result, when present.

FieldTypeDescription
__typenamestringGraphQL type name of the post object.
createdAtstringPost creation timestamp as text. Reddit can return the time-zone offset without a colon.
domainstringDomain label Reddit reports for the post.
editedAtstring | nullPost edit timestamp when available.
idstringReddit full post ID, including its t3_ prefix.
languageCodestring | nullLanguage code reported for the post.
permalinkstringRelative Reddit permalink path for this post.
postHintstring | nullPost presentation hint reported by Reddit when available.
postTitlestringTitle reported for the post.
thumbnailobject | nullPost thumbnail when included.
thumbnail.dimensionsobjectImage or player dimensions in pixels.
thumbnail.dimensions.heightintegerHeight in pixels.
thumbnail.dimensions.widthintegerWidth in pixels.
thumbnail.urlstringThumbnail image URL.
urlstringURL associated with the post.
Post body12 fields

data.search.dynamic.components.main.edges[].node.children[].post.content

Post body when Reddit supplies it. The value can be null.

FieldTypeDescription
htmlstringHTML representation of the post body when supplied.
markdownstringPost body in Markdown as returned by Reddit.
previewstringBody preview when supplied.
richtextstringSerialized Reddit rich text as a string when available.
richtextMediaarrayMedia items referenced in the post body rich text.
richtextMedia[]objectOne media item referenced in the post body.
richtextMedia[].heightintegerHeight of this media item, in pixels.
richtextMedia[].idstringMedia ID in the post body.
richtextMedia[].mimetypestringMIME type of the media item in the post body.
richtextMedia[].statusstringStatus reported for the media item in the post body.
richtextMedia[].urlstringURL for this media item in the post body.
richtextMedia[].widthintegerWidth of this media item, in pixels.
Author profile and flair25 fields

data.search.dynamic.components.main.edges[].node.children[].post

FieldTypeDescription
authorFlairobject | nullAuthor flair in this community, when available.
authorFlair.richtextstring | nullSerialized rich text of the author flair, when provided.
authorFlair.textstringDisplay text of the author flair.
authorInfoobjectPublic information for the post author.
authorInfo.accountTypestringAccount type reported for the author.
authorInfo.iconSmallobjectSmall author icon image.
authorInfo.iconSmall.dimensionsobjectImage dimensions in pixels.
authorInfo.iconSmall.dimensions.heightintegerHeight in pixels.
authorInfo.iconSmall.dimensions.widthintegerWidth in pixels.
authorInfo.iconSmall.urlstringImage URL.
authorInfo.idstringReddit full ID of the post author.
authorInfo.isCakeDayNowbooleanWhether Reddit marks it as the author's account anniversary.
authorInfo.namestringPublic Reddit username of the author.
authorInfo.newIconobjectAuthor icon image returned in the new icon field.
authorInfo.newIcon.dimensionsobjectImage dimensions in pixels.
authorInfo.newIcon.dimensions.heightintegerHeight in pixels.
authorInfo.newIcon.dimensions.widthintegerWidth in pixels.
authorInfo.newIcon.urlstringImage URL.
authorInfo.profileobjectPublic Reddit profile information associated with the author.
authorInfo.profile.isNsfwbooleanWhether Reddit marks the author's profile as NSFW.
authorInfo.snoovatarIconobject | nullSnoovatar image for the author, when available.
authorInfo.snoovatarIcon.dimensionsobjectImage dimensions in pixels.
authorInfo.snoovatarIcon.dimensions.heightintegerHeight in pixels.
authorInfo.snoovatarIcon.dimensions.widthintegerWidth in pixels.
authorInfo.snoovatarIcon.urlstringImage URL.
Subreddit information8 fields

data.search.dynamic.components.main.edges[].node.children[].post.subreddit

Community associated with the post when this section is returned.

FieldTypeDescription
idstringReddit community identifier.
isNsfwbooleanWhether Reddit marks the community as NSFW.
isQuarantinedbooleanWhether Reddit marks the community as quarantined.
namestringCommunity name.
prefixedNamestringCommunity name with its Reddit prefix.
subscribersCountintegerSubscriber count reported for the community.
titlestringCommunity display title.
typestringCommunity type reported by Reddit.
Post flags and permissions17 fields

data.search.dynamic.components.main.edges[].node.children[].post

FieldTypeDescription
flairobject | nullPost flair when available.
flair.richtextstring | nullSerialized rich text of the post flair, when provided.
flair.textstringDisplay text of the post flair.
flair.typestringPost-flair type reported by Reddit.
isArchivedbooleanWhether Reddit marks the post as archived.
isCommercialCommunicationbooleanWhether Reddit marks the post as a commercial communication.
isContestModebooleanWhether Reddit marks the post as being in contest mode.
isCrosspostablebooleanWhether Reddit marks the post as eligible for crossposting.
isLockedbooleanWhether Reddit marks the post as locked.
isNsfwbooleanWhether Reddit marks the post as not safe for work.
isPollIncludedbooleanWhether Reddit indicates that the post contains a poll.
isScoreHiddenbooleanWhether Reddit flags the score as hidden.
isSelfPostbooleanWhether Reddit marks this as a self post.
isSpoilerbooleanWhether Reddit marks the post as a spoiler.
isStickiedbooleanWhether Reddit marks the post as pinned.
isTranslatablebooleanWhether Reddit marks the post as translatable.
isTranslatedbooleanWhether Reddit marks the returned post as translated.
Engagement10 fields

data.search.dynamic.components.main.edges[].node.children[].post

FieldTypeDescription
awardingsarrayAward records returned for the post.
awardings[]objectOne award type and its count.
awardings[].awardobjectPublic details for the award type.
awardings[].award.idstringReddit award identifier.
awardings[].award.namestringAward display name.
awardings[].totalintegerCount of this award reported for the post.
commentCountintegerComment count reported for the post.
scoreintegerPost score reported by Reddit.
suggestedCommentSortstring | nullSuggested display ordering for comments when available.
upvoteRationumberPost upvote ratio reported as a fraction from 0 to 1.
Post images35 fields

data.search.dynamic.components.main.edges[].node.children[].post.media.still

Still images for the post, including a source and resized renditions.

FieldTypeDescription
largeobject | nullLarge image rendition.
large.dimensionsobjectImage or player dimensions in pixels.
large.dimensions.heightintegerHeight in pixels.
large.dimensions.widthintegerWidth in pixels.
large.urlstringStill image URL.
mediumobject | nullMedium image rendition.
medium.dimensionsobjectImage or player dimensions in pixels.
medium.dimensions.heightintegerHeight in pixels.
medium.dimensions.widthintegerWidth in pixels.
medium.urlstringStill image URL.
smallobject | nullSmall image rendition.
small.dimensionsobjectImage or player dimensions in pixels.
small.dimensions.heightintegerHeight in pixels.
small.dimensions.widthintegerWidth in pixels.
small.urlstringStill image URL.
sourceobjectSource still image.
source.dimensionsobjectImage or player dimensions in pixels.
source.dimensions.heightintegerHeight in pixels.
source.dimensions.widthintegerWidth in pixels.
source.urlstringStill image URL.
xlargeobject | nullExtra-large image rendition.
xlarge.dimensionsobjectImage or player dimensions in pixels.
xlarge.dimensions.heightintegerHeight in pixels.
xlarge.dimensions.widthintegerWidth in pixels.
xlarge.urlstringStill image URL.
xxlargeobject | nullDouble extra-large image rendition.
xxlarge.dimensionsobjectImage or player dimensions in pixels.
xxlarge.dimensions.heightintegerHeight in pixels.
xxlarge.dimensions.widthintegerWidth in pixels.
xxlarge.urlstringStill image URL.
xxxlargeobject | nullTriple extra-large image rendition.
xxxlarge.dimensionsobjectImage or player dimensions in pixels.
xxxlarge.dimensions.heightintegerHeight in pixels.
xxxlarge.dimensions.widthintegerWidth in pixels.
xxxlarge.urlstringStill image URL.
Video playback and downloads23 fields

data.search.dynamic.components.main.edges[].node.children[].post.media

Media included with the post, when present. Gallery media also has its own section.

FieldTypeDescription
downloadobject | nullDownload metadata when Reddit supplies it.
download.urlstringMedia download URL returned by Reddit.
packagedMediaobject | nullPackaged media when Reddit supplies it.
packagedMedia.muxedMp4sobject | nullPackaged MP4 renditions grouped by quality.
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.lowobjectLow-quality MP4 rendition.
packagedMedia.muxedMp4s.low.urlstringPackaged MP4 URL.
packagedMedia.muxedMp4s.mediumobjectMedium-quality MP4 rendition.
packagedMedia.muxedMp4s.medium.urlstringPackaged MP4 URL.
packagedMedia.muxedMp4s.recommendedobjectMP4 rendition recommended by Reddit.
packagedMedia.muxedMp4s.recommended.urlstringPackaged MP4 URL.
streamingobject | nullStream metadata when Reddit supplies it.
streaming.dashUrlstringDASH stream manifest URL.
streaming.dimensionsobjectImage or player dimensions in pixels.
streaming.dimensions.heightintegerHeight in pixels.
streaming.dimensions.widthintegerWidth in pixels.
streaming.durationintegerDuration value Reddit reports for the stream.
streaming.hlsUrlstringHLS stream manifest URL.
streaming.isGifbooleanWhether Reddit marks the stream as a GIF-style animation.
typeHintstring | nullMedia type hint reported by Reddit when available.
Post gallery39 fields

data.search.dynamic.components.main.edges[].node.children[].post.gallery

Gallery included with the post, when present.

FieldTypeDescription
itemsarrayMedia entries in the gallery.
items[]objectOne gallery entry.
items[].idstringIdentifier of the gallery entry.
items[].mediaobjectMedia for this gallery entry.
items[].media.heightintegerGallery media height in pixels.
items[].media.idstringReddit identifier for the gallery media.
items[].media.largeobjectLarge image rendition.
items[].media.large.dimensionsobjectImage or player dimensions in pixels.
items[].media.large.dimensions.heightintegerHeight in pixels.
items[].media.large.dimensions.widthintegerWidth in pixels.
items[].media.large.urlstringStill image URL.
items[].media.mediumobjectMedium image rendition.
items[].media.medium.dimensionsobjectImage or player dimensions in pixels.
items[].media.medium.dimensions.heightintegerHeight in pixels.
items[].media.medium.dimensions.widthintegerWidth in pixels.
items[].media.medium.urlstringStill image URL.
items[].media.mimetypestringMIME type of the gallery media.
items[].media.smallobjectSmall image rendition.
items[].media.small.dimensionsobjectImage or player dimensions in pixels.
items[].media.small.dimensions.heightintegerHeight in pixels.
items[].media.small.dimensions.widthintegerWidth in pixels.
items[].media.small.urlstringStill image URL.
items[].media.urlstringURL returned for the gallery media.
items[].media.widthintegerGallery media width in pixels.
items[].media.xlargeobjectExtra-large image rendition.
items[].media.xlarge.dimensionsobjectImage or player dimensions in pixels.
items[].media.xlarge.dimensions.heightintegerHeight in pixels.
items[].media.xlarge.dimensions.widthintegerWidth in pixels.
items[].media.xlarge.urlstringStill image URL.
items[].media.xxlargeobject | nullDouble extra-large image rendition.
items[].media.xxlarge.dimensionsobjectImage or player dimensions in pixels.
items[].media.xxlarge.dimensions.heightintegerHeight in pixels.
items[].media.xxlarge.dimensions.widthintegerWidth in pixels.
items[].media.xxlarge.urlstringStill image URL.
items[].media.xxxlargeobject | nullTriple extra-large image rendition.
items[].media.xxxlarge.dimensionsobjectImage or player dimensions in pixels.
items[].media.xxxlarge.dimensions.heightintegerHeight in pixels.
items[].media.xxxlarge.dimensions.widthintegerWidth in pixels.
items[].media.xxxlarge.urlstringStill image URL.

Response Example ​

Loading the response example...