API Instagram Post caption translation
Stato di salute dell'API
- Operatività nelle ultime 24 ore
- Normale
- Buono / normale
- Disponibile
- Limitato
- Quasi del tutto inattivo
Ultime 24 ore
Ultimi 30 giorni
Translate the caption of one Instagram post into target_language (default en), from its url or media_id. Returns the original text, the translation and the detected source_language.
Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su instagram e action impostato su post_translation. Prezzo $6.39 per 1.000 richieste ($0.006389 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 Instagram Post caption translation di EveryInfra (instagram/post_translation).
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 instagram e action su post_translation, e inserisci i parametri in params.
- Nessun parametro obbligatorio.
- Parametri facoltativi:
- media_id: The numeric post ID (the id in post results). Pass this or url.
- target_language: The language to translate into, as a language code such as en, zh-CN, zh-TW, ja, ko, es, pt-BR, fr or de. Defaults to en. A caption already in that language comes back as it is.
- url: A post or Reel link, such as https://www.instagram.com/p/<shortcode>/ or https://www.instagram.com/reel/<shortcode>/. Pass url or media_id; when both are given, url is used.
- Restituisce un oggetto. Campi principali: media_id (The numeric post ID), shortcode (The post shortcode: the part of the pos…), url, author_username, text, translation (The machine translation), source_language (The detected language code of the origi…), target_language (The language code translated into: the…).
- Esempio di corpo della richiesta:
{
"platform": "instagram",
"action": "post_translation",
"params": {
"url": "https://www.instagram.com/p/DbYmqpplO_N/"
}
}
- Prezzo: $6.39 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ì | instagram | Identificativo della piattaforma, valore fisso. |
action | body | string | Sì | post_translation | Identificativo della funzionalità, valore fisso. |
media_id | body.params | string | No | - | The numeric post ID (the id in post results). Pass this or url. |
target_language | body.params | string | No | - | The language to translate into, as a language code such as en, zh-CN, zh-TW, ja, ko, es, pt-BR, fr or de. Defaults to en. A caption already in that language comes back as it is. |
url | body.params | string | No | - | A post or Reel link, such as https://www.instagram.com/p/<shortcode>/ or https://www.instagram.com/reel/<shortcode>/. Pass url or media_id; when both are given, url is used. |
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": "instagram",
"action": "post_translation",
"params": {
"url": "https://www.instagram.com/p/DbYmqpplO_N/"
}
}'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": "instagram", "action": "post_translation", "results": { "media_id": "3952078729724096461", "shortcode": "DbYmqpplO_N", "url": "https://www.instagram.com/reel/DbYmqpplO_N/", "author_username": "n•••a", "text": "The Sun and Moon are coming together to put on a show for Earth, and we'll be sharing it with you. 😎\n\nOn Aug. 12, a total solar eclipse will pass over Earth, and we'll be broadcasting it live along the path of totality. Check our link in bio to learn how to watch along with us!\n\n…", "translation": "The Sun and Moon are coming together to put on a show for Earth, and we'll be sharing it with you. 😎\n\nOn Aug. 12, a total solar eclipse will pass over Earth, and we'll be broadcasting it live along the path of totality. Check our link in bio to learn how to watch along with us!\n\n…", "source_language": "en", "target_language": "en", "platform": "instagram" }, "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 |
|---|---|
media_id | The numeric post ID. oembed gives it as postID_authorID. |
shortcode | The post shortcode: the part of the post link after /p/ or /reel/. |
url | Link al record sulla piattaforma. |
author_username | Username dell'autore (@handle), di solito utilizzabile negli URL. |
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). |
translation | The machine translation. Absent when the post has no caption. |
source_language | The detected language code of the original text, such as en; und when it cannot be detected. |
target_language | The language code translated into: the target_language you passed, or en. |
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.