API TikTok Photo post images
Stato di salute dell'API
- Operatività nelle ultime 24 ore
- Normale
- Buono / normale
- Disponibile
Ultime 24 ore
Ultimi 30 giorni
Get every image of a TikTok photo post (photo mode or carousel) from its url, in the post's order: images with each image's url, width and height in pixels, plus image_urls, the same links as a list. The row also carries the post's text, posted_at, counts, author fields and background music fields. Image links expire, so download the ones you keep soon. A video, a missing post or a deleted post returns 503 and is not charged; use video for videos.
Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su tiktok e action impostato su photos. Prezzo $0.56 per 1.000 richieste ($0.000556 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 TikTok Photo post images di EveryInfra (tiktok/photos).
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 tiktok e action su photos, e inserisci i parametri in params.
- Parametri obbligatori:
- url: A TikTok photo post link with the post ID, such as https://www.tiktok.com/@<user>/photo/<ID> (the /video/<ID> form works too), or the 15 to 21 digit post ID.
- Restituisce un oggetto. Campi principali: id, url, images (Every image of a photo post (photos), i…), image_urls (Link to each image in a photo (carousel…), posted_at, text, language, location, media_type (Post type (photos): always photo), author_username, author_name, author_bio (La bio del profilo dell'autore); 59 campi in totale, elenco completo su https://api.everyinfra.com/api/v1/social/catalog?platform=tiktok.
- Esempio di corpo della richiesta:
{
"platform": "tiktok",
"action": "photos",
"params": {
"url": "https://www.tiktok.com/@tiktok/photo/7701866987609197837"
}
}
- Prezzo: $0.56 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ì | tiktok | Identificativo della piattaforma, valore fisso. |
action | body | string | Sì | photos | Identificativo della funzionalità, valore fisso. |
url | body.params | string | Sì | - | A TikTok photo post link with the post ID, such as https://www.tiktok.com/@<user>/photo/<ID> (the /video/<ID> form works too), or the 15 to 21 digit post ID. Short links such as vm.tiktok.com are not recognized, and a value in the wrong form is rejected (422) before you are 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": "tiktok",
"action": "photos",
"params": {
"url": "https://www.tiktok.com/@tiktok/photo/7701866987609197837"
}
}'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": "tiktok", "action": "photos", "results": { "id": …, "url": …, "images": …, "image_urls": …, "posted_at": …, "text": …, "language": …, "location": …, "media_type": …, "author_username": …, "author_name": …, "author_bio": …, "music_title": …, "music_author": …, "author_id": …, "author_sec_uid": …, "music_id": …, "author_url": …, "author_avatar_url": …, "cover_url": …, "music_url": …, "music_cover_url": …, "image_count": …, "view_count": …, "like_count": …, "comment_count": …, "share_count": …, "bookmark_count": …, "repost_count": …, "author_follower_count": …, "author_following_count": …, "author_like_count": …, "author_video_count": …, "duration_sec": …, "duration_seconds": …, "music_duration_sec": …, "category_type": …, "author_is_verified": …, "author_is_private": …, "author_is_seller": …, "music_is_original": …, "share_enabled": …, "view_count_estimated": …, "like_count_estimated": …, "comment_count_estimated": …, "share_count_estimated": …, "author_follower_count_estimated": …, "author_following_count_estimated": …, "author_like_count_estimated": …, "author_video_count_estimated": …, "is_ad": …, "is_private": …, "is_aigc": …, "comments_disabled": …, "duet_enabled": …, "stitch_enabled": …, "hashtags": …, "mentions": …, "suggested_words": …, "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 |
|---|---|
id | ID univoco del record sulla piattaforma. È univoco solo all'interno di una piattaforma; gli ID possono ripetersi tra piattaforme diverse. |
url | Link al record sulla piattaforma. |
images | Every image of a photo post (photos), in the post's order: [{url, width, height}], with width and height in pixels. Image links expire, so download the ones you keep soon. |
image_urls | Link to each image in a photo (carousel) post (video_download, photos; in photos the same images as images, in the post's order); links to all of a product's main images (shop_search, shop_category_products, shop_products); on shop_search the first is the same as cover_url. |
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. |
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). |
language | Codice della lingua del contenuto (ad esempio zh, en) secondo la piattaforma; può essere errato. |
location | Descrizione della località passata così com'è; il formato varia in base alla piattaforma. |
media_type | Post type (photos): always photo. |
author_username | Username dell'autore (@handle), di solito utilizzabile negli URL. |
author_name | Nome visualizzato dell'autore. |
author_bio | La bio del profilo dell'autore; non restituita in alcune richieste e può essere assente nei risultati di user_videos. |
music_title | Title of the background music (photos). |
music_author | Name of the background music's author (photos). |
author_id | ID univoco dell'autore sulla piattaforma. |
author_sec_uid | secUid dell'account dell'autore della musica (music_detail); solo per i suoni originali. |
music_id | ID of the post's background music (photos). |
author_url | Link al profilo dell'autore sulla piattaforma. |
author_avatar_url | Link all'immagine dell'avatar dell'autore (nella maggior parte delle piattaforme firmato e con scadenza). |
cover_url | Link to the post's cover image (photos). |
music_url | Link to the background music (photos). |
music_cover_url | Link to the background music's cover image (photos). |
image_count | Number of images in the photo post (photos), the same as the length of images. |
view_count | Visualizzazioni o riproduzioni. null significa non rese note, non 0. |
like_count | Like. null significa che la piattaforma o questa funzionalità non li rende noti; non equivale a 0. |
comment_count | Commenti. null significa non resi noti, non 0. |
share_count | Condivisioni. null significa non rese note, non 0. |
bookmark_count | Number of bookmarks (photos). |
repost_count | Repost (distinti dai post con citazione). null significa non resi noti. |
author_follower_count | Numero di follower dell'autore. null significa non reso noto. |
author_following_count | Quanti account segue l'autore; non restituito in alcune richieste. |
author_like_count | Totale dei Mi piace ricevuti dal profilo dell'autore; non restituito in alcune richieste. |
author_video_count | Numero totale di video pubblicati dall'autore; non restituito in alcune richieste. |
duration_sec | Durata in secondi, lo stesso valore di duration_seconds (vengono restituiti entrambi i nomi): la lunghezza del video nelle righe dei video, la lunghezza del suono in music_search, music_chart e music_detail. |
duration_seconds | Durata in secondi. null per i contenuti che non sono video o audio. |
music_duration_sec | Length of the background music in seconds (photos). |
category_type | The post's category type (photos). |
author_is_verified | Indica se l'autore ha il badge di verifica; non restituito in alcune richieste. |
author_is_private | Indica se l'account dell'autore è privato. |
author_is_seller | Indica se l'autore è un venditore TikTok Shop. Di solito assente nei risultati di user_videos. |
music_is_original | Whether the background music is an original sound, the creator's own audio (photos). |
share_enabled | Whether the post can be shared (photos). |
view_count_estimated | Whether view_count is an approximate figure (photos): from 10,000 up, TikTok's page shows a rounded count (35.2K is stored as 35200) and this is true. |
like_count_estimated | Whether like_count is an approximate figure (photos), by the same rule as view_count_estimated. |
comment_count_estimated | Whether comment_count is an approximate figure (photos), by the same rule as view_count_estimated. |
share_count_estimated | Whether share_count is an approximate figure (photos), by the same rule as view_count_estimated. |
author_follower_count_estimated | Whether author_follower_count is an approximate figure (photos), by the same rule as view_count_estimated. |
author_following_count_estimated | Whether author_following_count is an approximate figure (photos), by the same rule as view_count_estimated. |
author_like_count_estimated | Whether author_like_count is an approximate figure (photos), by the same rule as view_count_estimated. |
author_video_count_estimated | Whether author_video_count is an approximate figure (photos), by the same rule as view_count_estimated. |
is_ad | Indica se il video è una pubblicità. Di solito assente nei risultati di ricerca; può essere assente nei risultati di user_videos. |
is_private | Indica se l'account è privato. |
is_aigc | Whether the post is AI-generated content (photos). |
comments_disabled | Whether comments are turned off on the post (photos). |
duet_enabled | Whether Duet is allowed on the post (photos). |
stitch_enabled | Whether Stitch is allowed on the post (photos). |
hashtags | Hashtag presenti nel testo, in ordine di apparizione; assente se non ce ne sono. |
mentions | Accounts mentioned with @ in the post (photos). |
suggested_words | Suggested words on the post (photos). |
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.