need_formatboolean
Whether to clean and format the data
Default: 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"
]
}
}
}
]Pilih contoh untuk memuat input dan hasilnya ke playground.
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.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
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"
}'Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
need_formatbooleanWhether to clean and format the data
Default: false
rangestringTime range, supports HOUR, DAY, WEEK, MONTH, YEAR, ALL
Default: "DAY"
sortstringSort method, supports HOT, NEW, TOP, CONTROVERSIAL, RISING
Default: "HOT"
subreddit_namestringSubreddit name
Default: "pics"
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
[
{
"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"
]
}
}
}
]Jelajahi lebih lanjut
| API | Harga | Respons |
|---|---|---|
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Reddit | $0.001 per panggilan | JSON |
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/reddit/app/subreddit-post-channels dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.
$0.001 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Tidak ada parameter yang wajib. Opsional: need_format (boolean), range (string), sort (string) dan subreddit_name (string). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.
Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.
Tidak. Reddit App Subreddit Post Channels berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Reddit secara terpisah.