API Reddit Risposte ai commenti
Stato di salute dell'API
- Operatività nelle ultime 24 ore
- Normale
- Buono / normale
- Disponibile
Ultime 24 ore
Ultimi 30 giorni
Read the replies under one Reddit comment from its link in url (the url of a comments or comments_lookup row). One call returns one batch of about 10 replies, including replies to replies, as a flat list with the same fields as comments plus reply_to_id and depth. There is no paging: when a row's has_more_replies is true, call again with that row's url. A comment with no replies returns an empty result and is not charged.
Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su reddit e action impostato su comment_replies. Prezzo $0.79 per 1.000 richieste ($0.000792 per chiamata). Le chiamate non riuscite e i risultati vuoti non vengono addebitati. Sincrona. Per i job più lenti, aggiungi "mode": "async" al corpo della richiesta, recupera il job_id ed esegui il polling.
Prompt per l'AI
#Aiutami a scrivere uno script di raccolta dei dati con l'endpoint Reddit Risposte ai commenti di EveryInfra (reddit/comment_replies).
Come funziona l'endpoint:
- Richiesta: POST https://api.everyinfra.com/api/v1/social con l'header Authorization: Bearer <chiave API>. Leggi la chiave dalla variabile d'ambiente EVERYINFRA_API_KEY e non scriverla mai direttamente nel codice.
- Nel corpo della richiesta imposta platform su reddit e action su comment_replies, e inserisci i parametri in params.
- Parametri obbligatori:
- url: One Reddit comment link, such as the url of a row from comments or comments_lookup (…/comments/<post ID>/comment/<comment ID>/). A bare comment ID is not enough.
- Parametri facoltativi:
- limit: Numero massimo di righe da restituire in questa chiamata: un intero pari o superiore a 1. Se lo ometti, viene applicato il valore predefinito; una chiamata può restituire meno righe.
- Restituisce un elenco di record. Campi principali di ogni record: id, text, author_username, like_count, community, url, posted_at, reply_to_id (ID of the comment this reply answers (c…), depth (Level under the post (comment_replies):…), has_more_replies (Whether this reply has more replies not…).
- Esempio di corpo della richiesta:
{
"platform": "reddit",
"action": "comment_replies",
"params": {
"url": "https://www.reddit.com/r/pics/comments/1xwxo1e/comment/19sogasefdc5g/"
}
}
- Prezzo: $0.79 per 1.000 richieste; le richieste non riuscite e i risultati vuoti non vengono addebitati.
- Per decine o centinaia di target, aggiungi "mode": "async" al corpo: ricevi subito un job_id ed esegui il polling su GET https://api.everyinfra.com/api/v1/jobs/{job_id} per ottenere il risultato.
- In caso di 422, correggi la richiesta usando i nomi dei parametri e i valori consentiti suggeriti nell'errore; in caso di 429 o 503, attendi il tempo indicato da Retry-After e riprova.
Prima di scrivere il codice, chiedimi quali target mi servono, quanti, quali campi e quale formato di output voglio; poi conferma con me il piano e il costo indicativo.Parametri della richiesta
#| Nome | Posizione | Tipo | Obbligatorio | Predefinito | Descrizione |
|---|---|---|---|---|---|
Authorization | header | string | Sì | - | Bearer seguito dalla tua chiave API. Creala nella console; non inserirla mai in un URL o in un repository di codice. |
platform | body | string | Sì | reddit | Identificativo della piattaforma, valore fisso. |
action | body | string | Sì | comment_replies | Identificativo della funzionalità, valore fisso. |
url | body.params | string | Sì | - | One Reddit comment link, such as the url of a row from comments or comments_lookup (…/comments/<post ID>/comment/<comment ID>/). A bare comment ID is not enough. |
limit | body.params | integer (1–) | No | - | Numero massimo di righe da restituire in questa chiamata: un intero pari o superiore a 1. Se lo ometti, viene applicato il valore predefinito; una chiamata può restituire meno righe. |
Esempi di codice
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "reddit",
"action": "comment_replies",
"params": {
"url": "https://www.reddit.com/r/pics/comments/1xwxo1e/comment/19sogasefdc5g/"
}
}'Definizione OpenAPI (JSON)Gli esempi leggono la chiave dalla variabile d'ambiente EVERYINFRA_API_KEY; il codice copiato non contiene mai la tua chiave.
Esempio di risposta
#{ "id": "req_…", "platform": "reddit", "action": "comment_replies", "results": [ { "id": "19soioec1l0ar", "text": "He stretch", "author_username": "E•••t", "like_count": 21, "community": "pics", "url": "https://www.reddit.com/r/pics/comments/1xwxo1e/comment/19soioec1l0ar/", "posted_at": "2026-11-15T16:14:37.802000+00:00", "platform": "reddit", "reply_to_id": "19sogasefdc5g", "depth": 1, "has_more_replies": true }, { "id": "19sol335umo5e", "text": "stremtch", "author_username": "S•••h", "like_count": 5, "community": "pics", "url": "https://www.reddit.com/r/pics/comments/1xwxo1e/comment/19sol335umo5e/", "posted_at": "2026-11-15T17:08:37.130000+00:00", "platform": "reddit", "reply_to_id": "19soioec1l0ar", "depth": 2, "has_more_replies": false } ], "count": 4, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Campi della risposta
#I dati di business si trovano in results. La tabella elenca i campi che un record può contenere; i valori che la piattaforma non mostra non vengono mai inventati.
| Campo | Significato |
|---|---|
id | ID univoco del record sulla piattaforma. È univoco solo all'interno di una piattaforma; gli ID possono ripetersi tra piattaforme diverse. |
text | Testo del contenuto senza HTML, restituito per intero e mai troncato (su alcune piattaforme i risultati degli elenchi contengono solo un estratto; lo indicano le note sui campi della piattaforma). |
author_username | Username dell'autore (@handle), di solito utilizzabile negli URL. |
like_count | Like. null significa che la piattaforma o questa funzionalità non li rende noti; non equivale a 0. |
community | Mantiene il significato attribuito dalla piattaforma |
url | Link al record sulla piattaforma. |
posted_at | Data e ora di pubblicazione in formato ISO 8601, UTC (ad esempio 2026-08-07T12:34:56+00:00). Le stringhe non standard della piattaforma vengono passate così come sono, quindi esegui il parsing in modo difensivo. null significa che la piattaforma non le rende note. |
platform | Identificativo della piattaforma di origine, uguale a platform nella richiesta (ad esempio xiaohongshu, tiktok). |
reply_to_id | ID of the comment this reply answers (comment_replies); for direct replies it is the comment you asked about. |
depth | Level under the post (comment_replies): 0 is a comment on the post, 1 a reply to it, and so on. |
has_more_replies | Whether this reply has more replies not included (comment_replies); if true, call comment_replies with this row's url. |
Errori e addebiti
#- 401
- Chiave mancante o non valida.
- 402
- Saldo insufficiente. Effettua prima una ricarica.
- 422
- Nome o valore del parametro non valido. Correggilo seguendo i suggerimenti dell'errore. Nessun addebito.
- 429
- Raggiunto il limite di richieste al minuto. Attendi il tempo indicato da Retry-After, poi riprova.
- 503
- Impossibile completare. L'importo trattenuto torna sul tuo saldo. Se l'esito è incerto, verificalo prima di riprovare.
- Risposta 200 vuota
- Nessun dato. Nessun addebito.