subreddit_idstringจำเป็น
Subreddit ID with format starting with t5_, e.g., "t5_2qh0u" (can be obtained from the fetch_subreddit_info endpoint)
https://api.sandbase.ai/v1/api/reddit/app/subreddit-settingsReturns settings and configuration details for a specified Reddit subreddit, including posting rules, flair settings, and moderation configurations.
[
{
"data": {
"subredditInfoById": {
"__typename": "Subreddit",
"allAllowedPostTypes": [
"LINK",
"IMAGE",
"GALLERY"
],
"amaSettings": {
"postPermissions": "OFF"
},
"authorFlairSettings": {
"isEnabled": true,
"isSelfAssignable": false
},
"commentContributionSettings": {
"allowedMediaTypes": [
"GIPHY",
"STATIC",
"EXPRESSION",
"… 1 more items in the full response"
]
},
"countrySiteSettings": {
"countryCode": "",
"isCountrySiteEditable": true,
"languageCode": "",
"modMigrationAt": "2023-07-03T16:04:00.000000+0000"
},
"id": "t5_2qh0u",
"isArchivePostsEnabled": true,
"isDiscoveryAllowed": true,
"isSubredditChannelsEnabled": {
"isChatEnabled": false,
"isPostEnabled": true
},
"isTopListingAllowed": true,
"language": "en",
"postFlairSettings": {
"isEnabled": true,
"isSelfAssignable": false
}
}
}
}
]เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
Returns settings for one Reddit subreddit, such as allowed post types, flair settings, comment media types and channel options. It needs a subreddit_id that starts with t5_.
LINK, IMAGE, GALLERY) a subreddit accepts before you build a posting tool.curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/subreddit-settings" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subreddit_id": "t5_2qh0u"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
subreddit_id | string | Yes | Subreddit ID with format starting with t5_, e.g., "t5_2qh0u" (can be obtained from the fetch_subreddit_info endpoint) |
need_format | boolean | No | Whether to clean and format the data |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"subredditInfoById": {
"__typename": "Subreddit",
"allAllowedPostTypes": [
"LINK"
],
"amaSettings": {
"postPermissions": "OFF"
},
"authorFlairSettings": {
"isEnabled": true,
"isSelfAssignable": false
},
"commentContributionSettings": {
"allowedMediaTypes": [
"GIPHY"
]
},
"countrySiteSettings": {
"countryCode": "",
"isCountrySiteEditable": true,
"languageCode": "",
"modMigrationAt": "2023-07-03T16:04:00.000000+0000"
},
"id": "t5_2qh0u",
"isArchivePostsEnabled": true,
"isDiscoveryAllowed": true,
"isSubredditChannelsEnabled": {
"isChatEnabled": false,
"isPostEnabled": true
},
"isTopListingAllowed": true,
"language": "en"
}
}
| Field | Meaning |
|---|---|
subredditInfoById.id | The subreddit ID, in the same t5_ format as the input. |
subredditInfoById.allAllowedPostTypes[] | The post types the subreddit accepts, such as LINK, IMAGE and GALLERY. |
subredditInfoById.postFlairSettings.isEnabled / subredditInfoById.authorFlairSettings.isEnabled | Whether post flair and author flair are enabled in this subreddit. |
subredditInfoById.postFlairSettings.isSelfAssignable / subredditInfoById.authorFlairSettings.isSelfAssignable | Whether users can assign the flair to themselves. |
subredditInfoById.commentContributionSettings.allowedMediaTypes[] | The media types allowed in comments, such as GIPHY, STATIC and EXPRESSION. |
subredditInfoById.isSubredditChannelsEnabled.isChatEnabled / subredditInfoById.isSubredditChannelsEnabled.isPostEnabled | Whether chat channels and post channels are enabled for the subreddit. |
subredditInfoById.isDiscoveryAllowed / subredditInfoById.isTopListingAllowed | Whether the subreddit may appear in discovery and in top listings. |
subredditInfoById.isArchivePostsEnabled | Whether archiving of posts is enabled. |
subredditInfoById.language | The language code set for the subreddit, such as en. |
subredditInfoById.amaSettings.postPermissions | The AMA post permission setting. The value OFF is returned in this example. |
subreddit_id from the Reddit App Subreddit Info API. The ID starts with t5_, for example t5_2qh0u.need_format to true to clean and format the data. The default is false.countrySiteSettings.modMigrationAt is an ISO 8601 timestamp in UTC.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/subreddit-settings" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"need_format": false,
"subreddit_id": "t5_2qh0u"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
subreddit_idstringจำเป็นSubreddit ID with format starting with t5_, e.g., "t5_2qh0u" (can be obtained from the fetch_subreddit_info endpoint)
need_formatbooleanWhether to clean and format the data
ค่าเริ่มต้น: false
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"data": {
"subredditInfoById": {
"__typename": "Subreddit",
"allAllowedPostTypes": [
"LINK",
"IMAGE",
"GALLERY"
],
"amaSettings": {
"postPermissions": "OFF"
},
"authorFlairSettings": {
"isEnabled": true,
"isSelfAssignable": false
},
"commentContributionSettings": {
"allowedMediaTypes": [
"GIPHY",
"STATIC",
"EXPRESSION",
"… 1 more items in the full response"
]
},
"countrySiteSettings": {
"countryCode": "",
"isCountrySiteEditable": true,
"languageCode": "",
"modMigrationAt": "2023-07-03T16:04:00.000000+0000"
},
"id": "t5_2qh0u",
"isArchivePostsEnabled": true,
"isDiscoveryAllowed": true,
"isSubredditChannelsEnabled": {
"isChatEnabled": false,
"isPostEnabled": true
},
"isTopListingAllowed": true,
"language": "en",
"postFlairSettings": {
"isEnabled": true,
"isSelfAssignable": false
}
}
}
}
]สำรวจเพิ่มเติม
| 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 |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/reddit/app/subreddit-settings โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.001 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: subreddit_id (string). ตัวเลือก: need_format (boolean). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Reddit App Subreddit Settings ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Reddit API แยกต่างหาก