usernamestringwajib
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": []
}
}
}
]Pilih contoh untuk memuat input dan hasilnya ke 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.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
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"
}'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.
usernamestringwajibReddit username
need_formatbooleanWhether to clean and format the data
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
[
{
"data": {
"redditorInfoByName": {
"__typename": "Redditor",
"activeSubreddits": []
}
}
}
]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/user-active-subreddits 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.
Wajib: username (string). Opsional: need_format (boolean). 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 User Active Subreddits 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.