need_formatboolean
Whether to clean and format the data
डिफ़ॉल्ट: false
https://api.sandbase.ai/v1/api/reddit/app/subreddit-post-channelsReturns post channel and flair details for a target subreddit. Supports custom sort methods and time range filters.
[
{
"data": {
"subredditInfoByName": {
"__typename": "Subreddit",
"postFlairTemplates": [
{
"id": "f988392c-41f4-11ea-856e-0e3f43166111",
"isModOnly": false,
"richtext": null,
"text": "Arts/Crafts"
},
{
"id": "260873e0-c9b8-11e5-be06-0ecbb6f4dd8d",
"isModOnly": false,
"richtext": null,
"text": "Politics"
},
{
"id": "66cf8d7a-8718-11e9-803a-0e44312dcdb8",
"isModOnly": false,
"richtext": null,
"text": "Misleading Title"
},
"… 16 more items in the full response"
]
}
}
}
]प्लेग्राउंड में इसके इनपुट और परिणाम लोड करने के लिए कोई उदाहरण चुनें।
Returns the post flair templates for a subreddit. You send the subreddit name in subreddit_name. The request also accepts sort, range and need_format.
id values to their text labels when you group posts by category.curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/subreddit-post-channels" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
need_format | boolean | No | Whether to clean and format the data |
range | string | No | Time range, supports HOUR, DAY, WEEK, MONTH, YEAR, ALL |
sort | string | No | Sort method, supports HOT, NEW, TOP, CONTROVERSIAL, RISING |
subreddit_name | string | No | Subreddit name |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"subredditInfoByName": {
"__typename": "Subreddit",
"postFlairTemplates": [
{
"id": "260873e0-c9b8-11e5-be06-0ecbb6f4dd8d",
"isModOnly": false,
"richtext": null,
"text": "Politics"
}
]
}
}
| Field | Meaning |
|---|---|
subredditInfoByName | Top-level object for the requested subreddit. |
subredditInfoByName.__typename | Object type. The value is Subreddit. |
subredditInfoByName.postFlairTemplates[] | List of post flair templates that the subreddit defines. |
subredditInfoByName.postFlairTemplates[].id | Unique ID of the flair template, in UUID format. |
subredditInfoByName.postFlairTemplates[].text | Display label of the flair, such as Politics or Backstory. |
subredditInfoByName.postFlairTemplates[].isModOnly | Boolean. When true, only moderators can use this flair. In the sample it is false for every flair. |
subredditInfoByName.postFlairTemplates[].richtext | Rich text version of the flair label. It is null in the sample, so the plain text field holds the label. |
subreddit_name is pics, sort is HOT, range is DAY and need_format is false.sort accepts HOT, NEW, TOP, CONTROVERSIAL and RISING. range accepts HOUR, DAY, WEEK, MONTH, YEAR and ALL.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/subreddit-post-channels" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sort": "HOT",
"range": "DAY",
"need_format": false,
"subreddit_name": "pics"
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
need_formatbooleanWhether to clean and format the data
डिफ़ॉल्ट: false
rangestringTime range, supports HOUR, DAY, WEEK, MONTH, YEAR, ALL
डिफ़ॉल्ट: "DAY"
sortstringSort method, supports HOT, NEW, TOP, CONTROVERSIAL, RISING
डिफ़ॉल्ट: "HOT"
subreddit_namestringSubreddit name
डिफ़ॉल्ट: "pics"
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
[
{
"data": {
"subredditInfoByName": {
"__typename": "Subreddit",
"postFlairTemplates": [
{
"id": "f988392c-41f4-11ea-856e-0e3f43166111",
"isModOnly": false,
"richtext": null,
"text": "Arts/Crafts"
},
{
"id": "260873e0-c9b8-11e5-be06-0ecbb6f4dd8d",
"isModOnly": false,
"richtext": null,
"text": "Politics"
},
{
"id": "66cf8d7a-8718-11e9-803a-0e44312dcdb8",
"isModOnly": false,
"richtext": null,
"text": "Misleading Title"
},
"… 16 more items in the full response"
]
}
}
}
]और जानें
| API | कीमत | प्रतिक्रिया |
|---|---|---|
Reddit | $0.001 प्रति कॉल | JSON |
Reddit | $0.001 प्रति कॉल | JSON |
Reddit | $0.001 प्रति कॉल | JSON |
Reddit | $0.001 प्रति कॉल | JSON |
Reddit | $0.001 प्रति कॉल | JSON |
Reddit | $0.001 प्रति कॉल | JSON |
प्रश्न
https://api.sandbase.ai/v1/api/reddit/app/subreddit-post-channels पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.001 प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
कोई parameters आवश्यक नहीं हैं। वैकल्पिक: need_format (boolean), range (string), sort (string) और subreddit_name (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।
नहीं। Reddit App Subreddit Post Channels SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से Reddit API access के लिए आवेदन करने की आवश्यकता नहीं है।