{"name":"Reddit Subreddit Search API","description":"Search one subreddit's posts by keyword: each post's title, author, score, comment count, date and link.","api_id":"generated_e995d5999f3462c337011ac0","slug":"reddit-subreddit-search-api","source":{"name":"Reddit","domain":"reddit.com","url":"https://www.reddit.com/"},"category":"social_communities","countries":[],"languages":[],"record_types":[],"tags":[],"limitations":[],"updated":"2026-11-22","note":"Sample records are saved samples, not a live run. CleanedWeb is not affiliated with the source.","version":"1.0","versions":[{"major":1,"latest_minor":"1.0","status":"current","sunset_at":null}],"changelog":[{"version":"1.0","date":"2026-11-21T10:51:14.000Z","kind":"major","changes":[]}],"version_note":"Pin a major with \"version\": N in the run body (an integer). Leave it out and the call runs on the latest major. A sunset major runs on the latest major and the response says rerouted. An unknown major answers 404 catalog_version_not_found and lists the available majors.","endpoints":[{"endpoint_id":"generated_e995d5999f3462c337011ac0_search","name":"Search Reddit Subreddits","description":"Return records within the accepted scope.","definition_version":"421980a58535040c29888ac217fca7c8418437e342f1efa2c05cc387da3ee8fc","method":"POST","path":"/v1/catalog/public/apis/generated_e995d5999f3462c337011ac0/endpoints/generated_e995d5999f3462c337011ac0_search/run","url":"https://api.cleanedweb.com/v1/catalog/public/apis/generated_e995d5999f3462c337011ac0/endpoints/generated_e995d5999f3462c337011ac0_search/run","authentication":{"type":"bearer","scheme":"Authorization: Bearer <API key>","scope":"run","note":"Reading this file and the live catalog needs no credential. A run needs a CleanedWeb account and uses the credits of its workspace.","docs":"https://cleanedweb.com/docs/run-catalog-api/"},"required_headers":[{"name":"Authorization","value":"Bearer YOUR_API_KEY","description":"An API key with the run scope."},{"name":"Idempotency-Key","value":"UNIQUE_REQUEST_ID","description":"Required. Save it before you send; reuse it only to retry the same request and to read the result. 1-200 characters: letters, numbers, . _ : -"},{"name":"Content-Type","value":"application/json","description":"The body is JSON."}],"request_body":{"input":"An object that follows input_schema.","max_items":"Optional. Stop after this many records.","timeout_seconds":"Optional, 60-86400, default 10800.","wait_seconds":"Optional, 0-86400, default 90. How long the request waits before answering 202.","version":"Optional integer major. Leave it out for the latest major."},"input_schema":{"type":"object","properties":{"enrich_records":{"type":"boolean","default":true,"description":"true: read each returned record's product/detail page and merge its fields into the record. false: return list/search-level fields only, with no detail page reads. Every returned record's detail page is read within the run's time budget; records the time budget leaves unread are returned without detail fields, and summary.record_enrichment reports how many records were enriched and why any were not (run_time_budget). Detail fields are optional."},"search":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\x00-\\x1f\\x7f]+$","description":"Required. Text sent to the site's own search form; its result pages are read and revalidated like the collection."},{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\x00-\\x1f\\x7f]+$","description":"Required. Text sent to the site's own search form; its result pages are read and revalidated like the collection."}}],"description":"Required. Text sent to the site's own search form; its result pages are read and revalidated like the collection. Supply an array to union distinct results from each source search, in query order.","default":"django","x-source-key":"q"},"type":{"x-enum-labels":["Posts","Media","Comments"],"x-value-status":["verified","observed","observed"],"description":"Optional. One observed value of the site's own filter; the pasted page is read with only this value changed and revalidated like the collection. Omit for the pasted page.","x-input-proof":{"evidence":"declared","key":"type","notes":["same_records_as_collection"],"read":"listing","rule":"request_structure_v1","value":"posts","where":"query"},"x-source-key":"type","type":"string","enum":["posts","media","comments"],"x-input-type":{"kind":"enum"}},"t":{"x-enum-labels":["Past year","Past month","Past week","Today","Past hour"],"x-value-status":["verified","observed","observed","observed","observed"],"description":"Optional. One observed value of the site's own filter; the pasted page is read with only this value changed and revalidated like the collection. Omit for the pasted page.","x-input-proof":{"evidence":"declared","key":"t","read":"listing","rule":"request_structure_v1","value":"year","where":"query"},"x-source-key":"t","type":"string","enum":["year","month","week","day","hour"],"x-input-type":{"kind":"enum"}},"cid":{"description":"Filter toggle (Posts): true sends cId=d40b8f38-b549-4323-bd5b-e146a3174b64; false or omitted leaves it off, like the pasted page. Applies only within type=posts: sent alone it selects type=posts too; with another type the call is refused.","x-input-proof":{"evidence":"declared","key":"cId","notes":["same_records_as_collection"],"read":"listing","rule":"request_structure_v1","value":"d40b8f38-b549-4323-bd5b-e146a3174b64","where":"query"},"x-source-key":"cId","type":"boolean","x-toggle-label":"Posts","x-source-checkbox-value":"d40b8f38-b549-4323-bd5b-e146a3174b64","x-applies-with":{"input":"type","value":"posts"},"x-input-type":{"kind":"boolean"}},"subreddit":{"x-enum-labels":["Python","learnprogramming"],"x-value-status":["observed","verified"],"x-source-key":"subreddit","type":"string","pattern":"^[A-Za-z0-9][A-Za-z\\-_0-9]{0,31}$","minLength":1,"maxLength":32,"examples":["Python","learnprogramming"],"x-open-values":true,"description":"Required. The name of a page of the same kind as the pages the pasted one links (any name that fits the pattern; the examples are the names it links). The site decides: a name it does not serve is refused as input_value_unverified.","not":{"type":"string","pattern":"\\n"},"x-source-route":"path_segment","x-input-type":{"kind":"string"}},"sort":{"x-input-proof":{"evidence":"declared","key":"sort","kind":"sort_choices","notes":["same_records_as_collection"],"read":"listing","rule":"request_structure_v1","value":"relevance","where":"query"},"type":"string","enum":["relevance","hot","top","new","comments"],"x-enum-labels":{"relevance":"Relevance","hot":"Hot","top":"Top","new":"New","comments":"Comment count"},"x-source-keys":["sort"],"x-value-status":"verified","x-combination":"unproven","description":"Order of the collection, as the site's own sort control offers it; omitted keeps the site's default order."}},"required":["subreddit","search"],"additionalProperties":false,"allOf":[{"anyOf":[{"not":{"required":["cid"]}},{"properties":{"type":{"anyOf":[{"const":"posts"},{"type":"array","items":{"const":"posts"},"minItems":1}]}}}]},{"not":{"required":["search"],"properties":{"search":{"type":"array"}}}},{"not":{"required":["search"],"properties":{"search":{"type":"array"}}}},{"not":{"required":["search"],"properties":{"search":{"type":"array"}}}},{"not":{"required":["search"],"properties":{"search":{"type":"array"}}}}]},"output_schema":{"type":"object","additionalProperties":false,"required":["title","url"],"properties":{"comments":{"type":"integer"},"date":{"type":"string"},"post_title_text":{"type":"string"},"score":{"type":"integer"},"subreddit":{"type":"string","format":"date-time","x-precision":"second","description":"ISO 8601 value computed from the source's relative date text (such as '3 months ago') at delivery time; precise to about one second."},"thingid":{"type":["string"]},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"comment_count":{"type":"string","description":"comment count"},"award_count":{"type":"string","description":"award count"},"created_timestamp":{"type":"string","description":"created timestamp"},"domain":{"type":"string","description":"domain"},"post_type":{"type":"string","description":"post type"},"upvote_ratio":{"type":"string","description":"upvote ratio"},"subreddit_prefixed_name":{"type":"string","description":"subreddit prefixed name"},"author_id":{"type":"string","description":"author id"},"author":{"type":"string","description":"author"},"icon":{"type":"string","description":"icon"},"subreddit_name":{"type":"string","description":"subreddit name"},"flair":{"type":"string","description":"flair"},"body":{"type":"string"},"post_id":{"type":"string"},"permalink":{"type":"string"},"content_href":{"type":"string","description":"content href"},"typed_award_count":{"type":"integer","minimum":0,"description":"Reviewed numeric reading of award_count; source value is preserved."},"typed_comment_count":{"type":"integer","minimum":0,"description":"Reviewed numeric reading of comment_count; source value is preserved."},"typed_comments":{"type":"integer","minimum":0,"description":"Reviewed numeric reading of comments; source value is preserved."}}},"examples":[{"kind":"saved_validation_records","saved_at":"2026-11-21T10:51:14.008Z","live_verified":false,"request":{"input":{}},"records_shown":2,"records_saved":2,"records":[{"author":"_khi4","author_id":"t2_164ydjlpnx","award_count":"0","body":"Hey, I am working on django development my client would prefer to slef host the app instead of hosting it on our servers, we dont mind however we would like to make sure we give them a build rather than plain code so we dont expose our code base I came across compiling with Cython or Nuitka, I cant decide which to use? Second ask, I heard that I should not compile my whole django apps and rather than that I better do that carefully not to mess up our different imports, how correct is that ? Thanks in advance","comment_count":"18","comments":18,"content_href":"https://www.reddit.com/r/Python/comments/1xadd8u/compiling_django_with_nuitka_or_cython/","created_timestamp":"2026-10-20T00:06:54.710000+0000","date":"2026-10-20T00:06:54.710000+0000","domain":"self.Python","flair":"Discussion","icon":"https://www.redditstatic.com/avatars/defaults/v2/avatar_default_5.png","permalink":"/r/Python/comments/1xadd8u/compiling_django_with_nuitka_or_cython/","post_id":"t3_1xadd8u","post_title_text":"Compiling django with Nuitka or Cython ?","post_type":"text","score":12,"subreddit":"2026-10-20T00:06:54Z","subreddit_name":"Python","subreddit_prefixed_name":"r/Python","thingid":"t3_1xadd8u","title":"Compiling django with Nuitka or Cython ?","upvote_ratio":"0.7142857142857143","url":"https://www.reddit.com/r/Python/comments/1xadd8u/compiling_django_with_nuitka_or_cython/","typed_award_count":0,"typed_comment_count":18},{"author":"lutian","author_id":"t2_19aonwg5","award_count":"0","body":"I've build an intricate image generation tool and, while I started with django (I have a svelte+django template I use for all my projects), I slowly started to extract certain parts of it, most relevant one is the \"engine\". here's an overview: - backend: django, django-allauth, django-drf, celery workers, celery beat, sqlite (WAL mode for speed), etc. - engine (where the magic happens): fastapi with sqlalchemy (still with sqlite w/ WAL) - frontend: svelte static site, server via nginx under docker - metabase (analytics): reads my sqlite from django and provides nice graphs backend handles all the requests and crud, while engine actually does what users want. the reason I separated them is that now I can have multiple engine instances, nicely orchestrated by django (I don't have that yet, and it'll take some time as I can just beef up my vps until huge scale hits me, but still it's good to have). I'm still very fond of using python instead of node (I'm not a js dev). you have so many ai/ml/charting libs in python, and can prototype really fast directly in django, like running some kind of expensive ml task dierectly as part of the processing of the request, just to test things out, but of course you can then defer them to celery workers, and when you need more power just ad more celery workers. you can sustain pretty high loads this way, also use gunicorn with uvicorn worker type for even better process management all these under a single docker compose on my hetzner vps","comment_count":"16","comments":16,"content_href":"https://www.reddit.com/r/Python/comments/1nlw9dz/its_not_always_about_django_vs_fastapiflask_you/","created_timestamp":"2025-09-20T11:56:18.555000+0000","date":"2025-09-20T11:56:18.555000+0000","domain":"self.Python","flair":"Discussion","icon":"https://styles.redditmedia.com/t5_ii9nl/styles/profileIcon_snoo1ac6a093-d681-4215-8758-3a345ea6f119-headshot.png?width=64&height=64&frame=1&auto=webp&crop=64%3A64%2Csmart&s=fc4a2faae317765d7208d031160043b3a7a4539a","permalink":"/r/Python/comments/1nlw9dz/its_not_always_about_django_vs_fastapiflask_you/","post_id":"t3_1nlw9dz","post_title_text":"it's not always about django vs fastapi/flask, you can use both","post_type":"text","score":6,"subreddit":"2025-09-20T11:56:18Z","subreddit_name":"Python","subreddit_prefixed_name":"r/Python","thingid":"t3_1nlw9dz","title":"it's not always about django vs fastapi/flask, you can use both","upvote_ratio":"0.6363636363636364","url":"https://www.reddit.com/r/Python/comments/1nlw9dz/its_not_always_about_django_vs_fastapiflask_you/","typed_award_count":0,"typed_comment_count":16}]}],"request_example":{"body":{"input":{"search":"django","subreddit":"Python","type":"posts"},"version":1,"max_items":25},"curl":"curl -X POST https://api.cleanedweb.com/v1/catalog/public/apis/generated_e995d5999f3462c337011ac0/endpoints/generated_e995d5999f3462c337011ac0_search/run \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Idempotency-Key: UNIQUE_REQUEST_ID\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"input\": {\n    \"search\": \"django\",\n    \"subreddit\": \"Python\",\n    \"type\": \"posts\"\n  },\n  \"version\": 1,\n  \"max_items\": 25\n}'"},"result":{"method":"GET","url":"https://api.cleanedweb.com/v1/catalog/public/apis/generated_e995d5999f3462c337011ac0/endpoints/generated_e995d5999f3462c337011ac0_search/result","note":"A run that does not end within wait_seconds answers 202. Read the result with the same API key and the same Idempotency-Key."},"links":{"page":"https://cleanedweb.com/catalog/reddit-subreddit-search-api/","markdown":"https://cleanedweb.com/catalog/reddit-subreddit-search-api/index.md","live_contract":"https://app.cleanedweb.com/api/catalog/apis/generated_e995d5999f3462c337011ac0/endpoints/generated_e995d5999f3462c337011ac0_search/contract","run_docs":"https://cleanedweb.com/docs/run-catalog-api/"}}],"links":{"page":"https://cleanedweb.com/catalog/reddit-subreddit-search-api/","markdown":"https://cleanedweb.com/catalog/reddit-subreddit-search-api/index.md","contract":"https://cleanedweb.com/catalog/reddit-subreddit-search-api/contract.json","catalog":"https://cleanedweb.com/catalog/","index":"https://cleanedweb.com/catalog/index.json","openapi":"https://cleanedweb.com/catalog/openapi.json"}}
