need_formatboolean
Whether to clean and format the data
Predefinito: 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"
]
}
}
}
]Seleziona un esempio per caricare i suoi input e il risultato nel 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.
Inizia a costruire
Endpoint API della piattaforma con autenticazione unificata e tracciamento dell'utilizzo.
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"
}'Imposta la tua SandBase API key nell'ambiente del server. Le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la tua key sul server. Non esporla nel codice del browser.
need_formatbooleanWhether to clean and format the data
Predefinito: false
rangestringTime range, supports HOUR, DAY, WEEK, MONTH, YEAR, ALL
Predefinito: "DAY"
sortstringSort method, supports HOT, NEW, TOP, CONTROVERSIAL, RISING
Predefinito: "HOT"
subreddit_namestringSubreddit name
Predefinito: "pics"
Risposta di esempio salvata per questa API; durante la visualizzazione non viene eseguita alcuna richiesta live.
[
{
"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"
]
}
}
}
]Esplora altro
| API | Prezzo | Risposta |
|---|---|---|
Reddit App Subreddit Post ChannelsQuesta API Reddit | $0.001 per chiamata | JSON |
Reddit | $0.001 per chiamata | JSON |
Reddit | $0.001 per chiamata | JSON |
Reddit | $0.001 per chiamata | JSON |
Reddit | $0.001 per chiamata | JSON |
Reddit | $0.001 per chiamata | JSON |
Domande
Invia una richiesta POST a https://api.sandbase.ai/v1/api/reddit/app/subreddit-post-channels con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.
$0.001 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.
Nessun parametro richiesto. Facoltativi: need_format (boolean), range (string), sort (string) e subreddit_name (string). La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.
Una risposta JSON restituita nella stessa richiesta HTTP (sincrona). Il README di questa pagina include una risposta di esempio.
No. Reddit App Subreddit Post Channels funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API Reddit.