Skip to Content

Search Media

Image and video posts matching a query, about 7 a page.

GET
/v1/reddit/search/media

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

query*string

What to search for.

sort?string

relevance (the default), hot, top, new or comments.

Value in"relevance""hot""top""new""comments"
time?string

hour, day, week, month, year or all (the default).

Value in"hour""day""week""month""year""all"
cursor?string

nextCursor of the previous page.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.

data*array<>
pagination*
Example Request
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.reddit.searchMedia({ query: "espresso" });
Example Response
{  "data": [    {      "id": "1xoogji",      "url": "https://www.reddit.com/r/espresso/comments/1xoogji/finally_happy_with_a_home_espresso_setup_under_600/",      "text": null,      "createdAt": null,      "author": {        "id": "1w5q10h42h",        "username": "Tall_Lie_7683",        "displayName": null,        "avatarUrl": null,        "verified": false,        "url": "https://www.reddit.com/user/Tall_Lie_7683/"      },      "stats": {        "views": null,        "likes": null,        "comments": null,        "shares": null,        "saves": null,        "engagementRate": null      },      "media": [],      "hashtags": [],      "mentions": [],      "ext": {        "title": "Finally happy with a home espresso setup. (Under $600)",        "kind": "text",        "subreddit": "espresso",        "score": null,        "upvoteRatio": null,        "link": null,        "domain": null,        "flair": null,        "nsfw": false,        "spoiler": false,        "locked": false,        "stickied": false,        "crossposts": null,        "crosspostOf": null,        "awards": null,        "editedAt": null,        "snippet": null      }    },    {      "id": "upk2me",      "url": "https://www.reddit.com/r/espresso/comments/upk2me/respresso_starter_pack/",      "text": null,      "createdAt": null,      "author": {        "id": "76nqkhwa",        "username": "Icy_Ad4208",        "displayName": null,        "avatarUrl": null,        "verified": false,        "url": "https://www.reddit.com/user/Icy_Ad4208/"      },      "stats": {        "views": null,        "likes": null,        "comments": null,        "shares": null,        "saves": null,        "engagementRate": null      },      "media": [],      "hashtags": [],      "mentions": [],      "ext": {        "title": "r/Espresso starter pack",        "kind": "text",        "subreddit": "espresso",        "score": null,        "upvoteRatio": null,        "link": null,        "domain": null,        "flair": null,        "nsfw": false,        "spoiler": false,        "locked": false,        "stickied": false,        "crossposts": null,        "crosspostOf": null,        "awards": null,        "editedAt": null,        "snippet": null      }    }  ],  "pagination": {    "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28mdHlwZT1tZWRpYSZzb3J0PXJlbGV2YW5jZSZ0PWFsbCZjdXJzb3I9ZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa0lqb2llMXdpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpCZloyeHZZbUZzWDIxdlpHbG1hV1Z5YzF3aU9sd2lNVndpTEZ3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6RmZiRzlqWVd4ZmJXOWthV1pwWlhKelhDSTZYQ0l5WENJc1hDSnpaV04wYVc5dVh6SmZjR2x3Wld4cGJtVmZNbDl3YjNOMFgzTmxZWEpqYUZ3aU9sd2lOMXdpZlNJc0ltVjRjR1Z5…",    "hasMore": true  }}