- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
Reddit's own search and comment search are not available.
You send query.
Part of the Reddit Scraper API: 7 Reddit endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/reddit/search" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'query=mechanical keyboard'1import os2import requests34params = {5 "query": "mechanical keyboard",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/reddit/search",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11 timeout=60,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/reddit/search");2url.search = new URLSearchParams({3 query: "mechanical keyboard",4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape Reddit search",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/reddit/search",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "query",19 "value": "mechanical keyboard"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Search terms. Also accepted as keyword, q. |
timeframe | string | Only posts from this window. Also accepted as t, time. | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are examples, not your data.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_9c85756efc6dcfd46a031c4b",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "post",13 "platform": "reddit",14 "id": "16cd18h",15 "url": "https://www.reddit.com/r/mac/comments/16cd18h/which_mechanical_keyboard_to_do_you_swear_is_the/",16 "type": "text",17 "author": {18 "id": "t2_4mfou",19 "handle": "CromulentSlacker",20 "name": "CromulentSlacker",21 "url": "https://www.reddit.com/user/CromulentSlacker/",22 "avatar_url": "https://styles.redditmedia.com/t5_boygb/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfYzhkM2EzYTgzYmRlNWRhZDA2ZDQzNjY5NGUzZTIyYWMzZTY0ZDU3N180OTA4MTAw_ra...",23 "verified": null24 },25 "title": "Which mechanical keyboard to do you swear is the best keyboard you have ever owned?",26 "text": "I broke my current keyboard so I need a replacement. My budget is around £200. I like clicky keys like Cherry MX Blues or Model M buckling springs keyboards.",27 "published_at": "2023-09-07T11:10:33.156000Z",28 "duration_seconds": null,29 "language": null,30 "hashtags": null,31 "mentions": null,32 "stats": {33 "views": null,34 "likes": 103,35 "comments": 185,36 "shares": null,37 "saves": null,38 "dislikes": null39 },40 "media": {41 "thumbnail_url": null,42 "video_url": null,43 "audio_url": null,44 "image_urls": null,45 "width": null,46 "height": null47 },48 "song": null,49 "location": null,50 "is_pinned": null,51 "is_sponsored": null,52 "extra": {53 "award_count": 0,54 "domain": "self.mac",55 "enriched": true,56 "post_type": "text",57 "score": 103,58 "search_position": 359 }60 },61 {62 "object": "post",63 "platform": "reddit",64 "id": "1bv7ap4",65 "url": "https://www.reddit.com/r/keyboards/comments/1bv7ap4/please_help_me_decide_which_mechanical_keyboard_i/",66 "type": "carousel",67 "author": {68 "id": "t2_39sfg654",69 "handle": "Frick-Fracker73",70 "name": "Frick-Fracker73",71 "url": "https://www.reddit.com/user/Frick-Fracker73/",72 "avatar_url": "https://styles.redditmedia.com/t5_wzelk/styles/profileIcon_snoo5311a7ff-f36d-4fbb-89a2-6582f5e61425-headshot.png?width=64&height=64&frame=1&auto=webp&crop=64...",73 "verified": null74 },75 "title": "Please help me decide which mechanical keyboard I should get.",76 "text": "I don’t have much experience with mechanical keyboards; the only one I have owned is the Logitech g613. I’ve been looking to get my first custom mechanical k...",77 "published_at": "2024-04-03T23:04:48.200000Z",78 "duration_seconds": null,79 "language": null,80 "hashtags": null,81 "mentions": null,82 "stats": {83 "views": null,84 "likes": 38,85 "comments": 100,86 "shares": null,87 "saves": null,88 "dislikes": null89 },90 "media": {91 "thumbnail_url": "https://preview.redd.it/please-help-me-decide-which-mechanical-keyboard-i-should-get-v0-k35jdaoiicsc1.jpg?width=640&crop=smart&auto=webp&s=94c98b742e34748f4c...",92 "video_url": null,93 "audio_url": null,94 "image_urls": [95 "https://preview.redd.it/please-help-me-decide-which-mechanical-keyboard-i-should-get-v0-k35jdaoiicsc1.jpg?width=640&crop=smart&auto=webp&s=94c98b742e34748f4c...",96 "https://preview.redd.it/please-help-me-decide-which-mechanical-keyboard-i-should-get-v0-wh09bboiicsc1.jpg?width=640&crop=smart&auto=webp&s=ab15feedf48740c721...",97 "https://preview.redd.it/please-help-me-decide-which-mechanical-keyboard-i-should-get-v0-g4ceyaoiicsc1.jpg?width=640&crop=smart&auto=webp&s=5115b645cace52e763..."98 ],99 "width": null,100 "height": null101 },102 "song": null,103 "location": null,104 "is_pinned": null,105 "is_sponsored": null,106 "extra": {107 "award_count": 0,108 "domain": "reddit.com",109 "enriched": true,110 "post_type": "gallery",111 "score": 38,112 "search_position": 5113 }114 }115 ],116 "cursor": "eyJwIjoyLCJmIjp7InEiOiJtZWNoYW5pY2FsIGtleWJvYXJkIHNpdGU6cmVkZGl0LmNvbSIsInMiOiIxMCIsIm5leHRQYXJhbXMiOiIiLCJ2IjoibCIsIm8iOiJqc29uIiwiZGMiOiIxMSIsImFwaSI6ImQua...",117 "has_more": true,118 "parent": null119 },120 "cursor": "eyJwIjoyLCJmIjp7InEiOiJtZWNoYW5pY2FsIGtleWJvYXJkIHNpdGU6cmVkZGl0LmNvbSIsInMiOiIxMCIsIm5leHRQYXJhbXMiOiIiLCJ2IjoibCIsIm8iOiJqc29uIiwiZGMiOiIxMSIsImFwaSI6ImQua...",121 "has_more": true122}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The Python client has client.reddit.search(...) and the TypeScript client client.reddit.search(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.