Get comments in batch
curl --request POST \
--url https://api.konbiniapi.com/v1/reddit/comments/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityIds": [
"hxcf648",
"hxc8s0c"
]
}
'import requests
url = "https://api.konbiniapi.com/v1/reddit/comments/batch"
payload = { "entityIds": ["hxcf648", "hxc8s0c"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({entityIds: ['hxcf648', 'hxc8s0c']})
};
fetch('https://api.konbiniapi.com/v1/reddit/comments/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.konbiniapi.com/v1/reddit/comments/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entityIds' => [
'hxcf648',
'hxc8s0c'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.konbiniapi.com/v1/reddit/comments/batch"
payload := strings.NewReader("{\n \"entityIds\": [\n \"hxcf648\",\n \"hxc8s0c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.konbiniapi.com/v1/reddit/comments/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityIds\": [\n \"hxcf648\",\n \"hxc8s0c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.konbiniapi.com/v1/reddit/comments/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityIds\": [\n \"hxcf648\",\n \"hxc8s0c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"@context": [
"https://www.w3.org/ns/activitystreams#",
"https://konbiniapi.com/ns/social#"
],
"type": "Collection",
"itemCount": 10,
"items": [
{
"type": "Note",
"id": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/hxcf648/",
"content": "Hi everyone,\n\nHere is the [Talk](https://www.reddit.com/talk/9acbd3a2-99ef-4820-893f-fcf23ff8a541). I'll do my best to address some of the more nuanced questions live.\n\n(It's our first time using this format, bear with us!)",
"likeCount": 1,
"url": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/hxcf648/",
"entityId": "hxcf648",
"published": "2022-02-17T19:06:31.000Z",
"isPinned": true,
"isSponsored": false,
"hasReplies": true,
"score": 1,
"voteCount": 1,
"isControversial": false,
"attributedTo": {
"type": "Person",
"id": "https://www.reddit.com/user/spez/",
"url": "https://www.reddit.com/user/spez/",
"preferredUsername": "spez",
"name": "spez",
"isPremium": true,
"role": "admin",
"tag": [
{
"type": "Tag",
"name": "reddit",
"href": "https://www.reddit.com/r/reddit/",
"icon": {
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
}
}
]
},
"inReplyTo": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/",
"context": {
"type": "Note",
"id": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/",
"url": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/",
"name": "Reddit Community Values",
"attributedTo": {
"type": "Person",
"id": "https://www.reddit.com/user/spez/",
"url": "https://www.reddit.com/user/spez/",
"preferredUsername": "spez",
"name": "spez",
"isPremium": true,
"role": "admin",
"tag": [
{
"type": "Tag",
"name": "reddit",
"href": "https://www.reddit.com/r/reddit/",
"icon": {
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
}
}
]
}
},
"image": {
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
},
"attachment": [
{
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
}
]
}
]
}
}{
"errors": [
{
"code": "validation_error",
"message": "Validation error"
}
],
"data": null
}{
"errors": [
{
"code": "missing_api_key",
"message": "Invalid API key"
}
],
"data": null
}{
"errors": [
{
"code": "credits_exhausted",
"message": "Credits exhausted. Upgrade your plan at konbiniapi.com"
}
],
"data": null
}{
"errors": [
{
"code": "api_key_disabled",
"message": "API key is disabled"
}
],
"data": null
}{
"errors": [
{
"code": "not_found",
"message": "Not found"
}
],
"data": null
}{
"errors": [
{
"code": "validation_error",
"message": "Request body too large"
}
],
"data": null
}{
"errors": [
{
"code": "internal_error",
"message": "Internal error"
}
],
"data": null
}{
"errors": [
{
"code": "platform_error",
"message": "Platform error"
}
],
"data": null
}{
"errors": [
{
"code": "service_unavailable",
"message": "Service unavailable"
}
],
"data": null
}{
"errors": [
{
"code": "platform_error",
"message": "Platform error"
}
],
"data": null
}Posts
Get comments in batch
Returns up to 100 Reddit comments by ID in a single request. Costs 1 credit per ID submitted.
POST
/
v1
/
reddit
/
comments
/
batch
Get comments in batch
curl --request POST \
--url https://api.konbiniapi.com/v1/reddit/comments/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityIds": [
"hxcf648",
"hxc8s0c"
]
}
'import requests
url = "https://api.konbiniapi.com/v1/reddit/comments/batch"
payload = { "entityIds": ["hxcf648", "hxc8s0c"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({entityIds: ['hxcf648', 'hxc8s0c']})
};
fetch('https://api.konbiniapi.com/v1/reddit/comments/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.konbiniapi.com/v1/reddit/comments/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entityIds' => [
'hxcf648',
'hxc8s0c'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.konbiniapi.com/v1/reddit/comments/batch"
payload := strings.NewReader("{\n \"entityIds\": [\n \"hxcf648\",\n \"hxc8s0c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.konbiniapi.com/v1/reddit/comments/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityIds\": [\n \"hxcf648\",\n \"hxc8s0c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.konbiniapi.com/v1/reddit/comments/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityIds\": [\n \"hxcf648\",\n \"hxc8s0c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"@context": [
"https://www.w3.org/ns/activitystreams#",
"https://konbiniapi.com/ns/social#"
],
"type": "Collection",
"itemCount": 10,
"items": [
{
"type": "Note",
"id": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/hxcf648/",
"content": "Hi everyone,\n\nHere is the [Talk](https://www.reddit.com/talk/9acbd3a2-99ef-4820-893f-fcf23ff8a541). I'll do my best to address some of the more nuanced questions live.\n\n(It's our first time using this format, bear with us!)",
"likeCount": 1,
"url": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/hxcf648/",
"entityId": "hxcf648",
"published": "2022-02-17T19:06:31.000Z",
"isPinned": true,
"isSponsored": false,
"hasReplies": true,
"score": 1,
"voteCount": 1,
"isControversial": false,
"attributedTo": {
"type": "Person",
"id": "https://www.reddit.com/user/spez/",
"url": "https://www.reddit.com/user/spez/",
"preferredUsername": "spez",
"name": "spez",
"isPremium": true,
"role": "admin",
"tag": [
{
"type": "Tag",
"name": "reddit",
"href": "https://www.reddit.com/r/reddit/",
"icon": {
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
}
}
]
},
"inReplyTo": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/",
"context": {
"type": "Note",
"id": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/",
"url": "https://www.reddit.com/r/reddit/comments/suvhyq/reddit_community_values/",
"name": "Reddit Community Values",
"attributedTo": {
"type": "Person",
"id": "https://www.reddit.com/user/spez/",
"url": "https://www.reddit.com/user/spez/",
"preferredUsername": "spez",
"name": "spez",
"isPremium": true,
"role": "admin",
"tag": [
{
"type": "Tag",
"name": "reddit",
"href": "https://www.reddit.com/r/reddit/",
"icon": {
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
}
}
]
}
},
"image": {
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
},
"attachment": [
{
"type": "Image",
"url": "https://external-preview.redd.it/WSqGR2511AQXIN172aycw9idD-3ENHc5hT_1a0M_2UQ.jpg?auto=webp&s=e4d15f89f1797d8111aeddd772534952d0adae50",
"entityId": "nYKpDhp2hxECJAtPQcH3bEnaXSyk_O8cQKeLCmKEzyw",
"width": 1536,
"height": 528
}
]
}
]
}
}{
"errors": [
{
"code": "validation_error",
"message": "Validation error"
}
],
"data": null
}{
"errors": [
{
"code": "missing_api_key",
"message": "Invalid API key"
}
],
"data": null
}{
"errors": [
{
"code": "credits_exhausted",
"message": "Credits exhausted. Upgrade your plan at konbiniapi.com"
}
],
"data": null
}{
"errors": [
{
"code": "api_key_disabled",
"message": "API key is disabled"
}
],
"data": null
}{
"errors": [
{
"code": "not_found",
"message": "Not found"
}
],
"data": null
}{
"errors": [
{
"code": "validation_error",
"message": "Request body too large"
}
],
"data": null
}{
"errors": [
{
"code": "internal_error",
"message": "Internal error"
}
],
"data": null
}{
"errors": [
{
"code": "platform_error",
"message": "Platform error"
}
],
"data": null
}{
"errors": [
{
"code": "service_unavailable",
"message": "Service unavailable"
}
],
"data": null
}{
"errors": [
{
"code": "platform_error",
"message": "Platform error"
}
],
"data": null
}Authorizations
Body
application/json