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.
開始建置
具備統一驗證與用量追蹤的平台 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 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_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 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/reddit/app/subreddit-settings。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.001,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:subreddit_id (string)。 選填:need_format (boolean)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。Reddit App Subreddit Settings 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Reddit API 存取權。