API Reddit Trascrizioni dei post video
Stato di salute dell'API
- Operatività nelle ultime 24 ore
- Normale
- Buono / normale
- Disponibile
Ultime 24 ore
Ultimi 30 giorni
Read the captions Reddit provides for a video post hosted on Reddit, from the post link in url: text for the full text and segments sentence by sentence with start and end seconds. It reads captions only and does not transcribe speech. A post with no captions, or a caption file that could not be read this time, returns 503 and is not charged.
Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su reddit e action impostato su post_transcript. 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 Trascrizioni dei post video di EveryInfra (reddit/post_transcript).
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 post_transcript, e inserisci i parametri in params.
- Parametri obbligatori:
- url: The link of a video post hosted on Reddit. It returns the captions Reddit provides for the video and does not transcribe speech. A link that is not recognized returns 422 and is not charged.
- Restituisce un oggetto. Campi principali: post_id (ID del post in cui è stato lasciato il…), url, title, media_type (Type of the post (post_transcript)), has_transcript (Whether the post has captions (post_tra…), reason (Why there are no captions (post_transcr…), source (Source of the captions (post_transcript…), language, text, segment_count (Number of entries in segments (post_tra…), segments (The captions sentence by sentence (post…), caption_url (Link to the caption file (post_transcri…); 14 campi in totale, elenco completo su https://api.everyinfra.com/api/v1/social/catalog?platform=reddit.
- Esempio di corpo della richiesta:
{
"platform": "reddit",
"action": "post_transcript",
"params": {
"url": "https://www.reddit.com/r/TikTokCringe/comments/1y4o37g/road_rage_between_bmw_and_cyclists/"
}
}
- 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ì | post_transcript | Identificativo della funzionalità, valore fisso. |
url | body.params | string | Sì | - | The link of a video post hosted on Reddit. It returns the captions Reddit provides for the video and does not transcribe speech. A link that is not recognized returns 422 and is not charged; a post without captions returns 503 and is not charged. |
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": "post_transcript",
"params": {
"url": "https://www.reddit.com/r/TikTokCringe/comments/1y4o37g/road_rage_between_bmw_and_cyclists/"
}
}'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": "post_transcript", "results": { "post_id": …, "url": …, "title": …, "media_type": …, "has_transcript": …, "reason": …, "source": …, "language": …, "text": …, "segment_count": …, "segments": …, "caption_url": …, "duration_sec": …, "duration_seconds": …, "platform": … }, "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 |
|---|---|
post_id | ID del post in cui è stato lasciato il commento (user_comments). |
url | Link al record sulla piattaforma. |
title | Titolo. null quando la piattaforma non prevede titoli (ad esempio post di solo testo). |
media_type | Type of the post (post_transcript). |
has_transcript | Whether the post has captions (post_transcript); when it is false, reason says why. |
reason | Why there are no captions (post_transcript): no_caption (a video without captions), not_video (no video in the post) or external_video (the video is on another site). |
source | Source of the captions (post_transcript). |
language | Codice della lingua del contenuto (ad esempio zh, en) secondo la piattaforma; può essere errato. |
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). |
segment_count | Number of entries in segments (post_transcript). |
segments | The captions sentence by sentence (post_transcript): [{start_sec, end_sec, duration_sec, text}], with start_sec, end_sec and duration_sec in seconds and text the sentence. |
caption_url | Link to the caption file (post_transcript); it may stop working. |
duration_sec | Length of the video in seconds (post_transcript). |
duration_seconds | Durata in secondi. null per i contenuti che non sono video o audio. |
platform | Identificativo della piattaforma di origine, uguale a platform nella richiesta (ad esempio xiaohongshu, tiktok). |
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.