usernamestring必填
Reddit username
https://api.sandbase.ai/v1/api/reddit/app/user-active-subredditsReturns a list of Reddit communities where a specified user participates most actively. Supports optional response formatting.
[
{
"data": {
"redditorInfoByName": {
"__typename": "Redditor",
"activeSubreddits": []
}
}
}
]選擇一個範例,將其輸入與結果載入 playground。
Returns the Reddit communities where a given user is most active. It needs a Reddit username, such as spez. The sample call for spez returned the user object with activeSubreddits set to null.
activeSubreddits value across several usernames to see which accounts have data.curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/user-active-subreddits" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "spez"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Reddit username |
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.
{
"redditorInfoByName": {
"__typename": "Redditor",
"activeSubreddits": null
}
}
| Field | Meaning |
|---|---|
redditorInfoByName | The user record that matches the username you sent. |
redditorInfoByName.__typename | The object type. The value Redditor confirms the lookup found a Reddit user account. |
redditorInfoByName.activeSubreddits | The list of communities where the user is most active. It is null in the sample response for spez, so no active subreddits came back for that call. |
username without the u/ prefix, as in the example spez.null value in activeSubreddits in your code, since the sample response for spez returned no list.$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/user-active-subreddits" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "example"
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
usernamestring必填Reddit username
need_formatbooleanWhether to clean and format the data
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
[
{
"data": {
"redditorInfoByName": {
"__typename": "Redditor",
"activeSubreddits": []
}
}
}
]探索更多
| 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/user-active-subreddits。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.001,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:username (string)。 選填:need_format (boolean)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。Reddit User Active Subreddits 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Reddit API 存取權。