Reddit Downloader API
Posts from Reddit, resolved into direct links. Videos come back with every rendition Reddit encoded, and the audio track alongside them.
https://api.gapi.dev/redditRequires the X-API-Key header · responds in JSON
Parameters
urlrequiredstringPublic Reddit post: reddit.com/r/…/comments/… works, as do redd.it short links.
e.g. https://www.reddit.com/r/IndieDev/comments/10hgvjq/vr_has_been_punishing_for_particlesResponses
{
"platform": "reddit",
"type": "video",
"title": "VR has been punishing for particles performance-wise…",
"author": "peterfrance",
"thumbnail": "https://external-preview.redd.it/…",
"duration": 24,
"media": [
{ "type": "video", "url": "https://v.redd.it/…/DASH_1080.mp4", "quality": "1080p", "ext": "mp4" },
{ "type": "video", "url": "https://v.redd.it/…/DASH_720.mp4", "quality": "720p AVC", "ext": "mp4" },
{ "type": "audio", "url": "https://v.redd.it/…/DASH_audio.mp4", "quality": "126kbps", "ext": "mp4" }
]
}Try it
https://api.gapi.dev/redditcurl -G 'https://api.gapi.dev/reddit' \
--data-urlencode 'url=https://www.reddit.com/r/IndieDev/comments/10hgvjq/vr_has_been_punishing_for_particles' \
-H 'X-API-Key: YOUR_KEY'What each link gives you
| You send | type | media contains |
|---|---|---|
| a post with a video | video | every rendition, plus the audio as a separate item |
| a post with an image | image | the image at full resolution |
| a gallery post | album | every image in it |
What it does not do
Subreddit listings, comment threads, user pages and anything on a private or quarantined subreddit. This endpoint takes a link to one post.
Field-by-field detail is on the response shape page.
Picking a height and its sound
Reddit returns every height it holds as a separate silent mp4, and the sound as one audio entry. Take the tallest video and the audio, then join the two. The quality value is a label such as 720p AVC rather than a number, so read the digits before the p.
data = response.json()
video = max(
(m for m in data["media"] if m["type"] == "video" and m["quality"][0].isdigit()),
key=lambda m: int(m["quality"].split("p")[0]),
)
audio = next((m for m in data["media"] if m["type"] == "audio"), None)
# Reddit keeps them apart; ffmpeg joins them without re-encoding.
# ffmpeg -i video.mp4 -i audio.mp4 -c copy out.mp4Code examples
The same request in four languages. Swap in the key from your dashboard and it runs as it is.
curl -G 'https://api.gapi.dev/reddit' \
--data-urlencode 'url=https://www.reddit.com/r/IndieDev/comments/10hgvjq/vr_has_been_punishing_for_particles' \
-H 'X-API-Key: gapi_live_your_key_here'One call, one request
A carousel with ten slides costs the same as a single photo: one charge against your balance. You pay for calls, not for files.