TikTokPhoto post imagesAPI
APIの稼働状況
- 24時間の稼働状況
- 正常
- 良好/正常
- 利用可能
過去24時間
過去30日間
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.
POST https://api.everyinfra.com/api/v1/socialを送信し、platformにtiktok、actionにphotosを指定します。 料金は1,000リクエストあたり$0.56(1回あたり$0.000556)です。失敗した呼び出しと空の結果には課金されません。 同期処理です。時間のかかるジョブでは、ボディに"mode": "async"を追加し、job_idを取得してポーリングしてください。
AIプロンプト
#EveryInfraのTikTok Photo post imagesエンドポイント(tiktok/photos)を使ったデータ収集スクリプトの作成を手伝ってください。
エンドポイントの仕組み:
- リクエスト:ヘッダーにAuthorization: Bearer <API key>を指定して、https://api.everyinfra.com/api/v1/socialにPOSTします。APIキーは環境変数EVERYINFRA_API_KEYから読み込み、ハードコードしないでください。
- リクエストボディでplatformにtiktok、actionにphotosを指定し、パラメータはparamsの中に入れます。
- 必須パラメータ:
- 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.
- 1つのオブジェクトを返します。主なフィールド: 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(投稿者のプロフィール紹介文です)。フィールドは全部で59個です。一覧はhttps://api.everyinfra.com/api/v1/social/catalog?platform=tiktokを参照してください。.
- リクエストボディの例:
{
"platform": "tiktok",
"action": "photos",
"params": {
"url": "https://www.tiktok.com/@tiktok/photo/7701866987609197837"
}
}
- 料金:1,000リクエストあたり$0.56。失敗時および結果が空の場合は課金されません。
- 対象が数十〜数百件ある場合は、ボディに"mode": "async"を追加します。すぐにjob_idが返されるので、GET https://api.everyinfra.com/api/v1/jobs/{job_id}をポーリングして結果を取得します。
- 422の場合は、エラーに含まれる推奨パラメータ名と指定可能な値を使ってリクエストを修正します。429または503の場合は、Retry-Afterの指定に従って待ってから再試行します。
コードを書く前に、必要な対象とその件数、必要なフィールド、希望する出力形式を私に質問してください。そのうえで、計画と概算費用を私に確認してください。リクエストパラメータ
#| 名前 | 場所 | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|---|
Authorization | header | string | はい | - | Bearerの後にAPIキーを続けます。APIキーはコンソールで作成してください。URLやコードリポジトリには絶対に含めないでください。 |
platform | body | string | はい | tiktok | プラットフォームの識別子です。値は固定です。 |
action | body | string | はい | photos | 機能の識別子です。値は固定です。 |
url | body.params | string | はい | - | 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. |
コードサンプル
#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"
}
}'OpenAPI定義(JSON)サンプルは環境変数EVERYINFRA_API_KEYからAPIキーを読み込みます。コピーしたコードにAPIキーが含まれることはありません。
レスポンス例
#{ "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": { … }}
レスポンスフィールド
#業務データはresultsに含まれます。この表はレコードに含まれうるフィールドの一覧です。プラットフォームに表示されない値を作り出すことはありません。
| フィールド | 意味 |
|---|---|
id | プラットフォーム上でのレコードの一意なIDです。一意性は1つのプラットフォーム内に限られ、プラットフォームが異なるとIDが重複する場合があります。 |
url | プラットフォーム上のレコードへのリンクです。 |
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 | 投稿日時です。ISO 8601形式のUTCで返されます(例:2026-08-07T12:34:56+00:00)。プラットフォームから非標準の文字列が返された場合はそのまま渡されるため、パース処理は堅牢に実装してください。nullはプラットフォームが公開していないことを示します。 |
text | HTMLを除去した本文です。省略されることなく全文が返されます(一部のプラットフォームでは一覧結果自体に抜粋しか含まれません。その場合は各プラットフォームのフィールドの注記に記載しています)。 |
language | プラットフォームが判定したコンテンツの言語コードです(例:zh、en)。誤っている場合があります。 |
location | 位置情報の説明で、そのまま渡されます。形式はプラットフォームによって異なります。 |
media_type | Post type (photos): always photo. |
author_username | 投稿者のユーザー名(@ハンドル)で、通常はURLに使用できます。 |
author_name | 投稿者の表示名です。 |
author_bio | 投稿者のプロフィール紹介文です。リクエストによっては返されず、user_videosの結果では含まれない場合があります。 |
music_title | Title of the background music (photos). |
music_author | Name of the background music's author (photos). |
author_id | プラットフォーム上での投稿者の一意なIDです。 |
author_sec_uid | 音楽の作成者アカウントのsecUid(music_detail)です。オリジナルサウンドの場合のみ含まれます。 |
music_id | ID of the post's background music (photos). |
author_url | プラットフォーム上の投稿者プロフィールへのリンクです。 |
author_avatar_url | 投稿者のアバター画像のリンク(ほとんどのプラットフォームで署名付きのため、有効期限があります)。 |
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 | 閲覧数または再生数です。nullは非公開を示し、0ではありません。 |
like_count | いいね数です。nullはプラットフォームまたはこの機能が公開していないことを示し、0ではありません。 |
comment_count | コメント数です。nullは非公開を示し、0ではありません。 |
share_count | シェア数です。nullは非公開を示し、0ではありません。 |
bookmark_count | Number of bookmarks (photos). |
repost_count | リポスト数です(引用投稿とは区別されます)。nullは非公開を示します。 |
author_follower_count | 投稿者のフォロワー数です。nullは非公開を示します。 |
author_following_count | 投稿者がフォローしているアカウント数です。リクエストによっては返されません。 |
author_like_count | 投稿者のプロフィールが受け取った累計いいね数です。リクエストによっては返されません。 |
author_video_count | 投稿者が投稿した動画の総数です。リクエストによっては返されません。 |
duration_sec | 秒単位の再生時間で、duration_secondsと同じ値です(両方の名前で返されます)。動画の行では動画の長さ、music_search、music_chart、music_detailではサウンドの長さを表します。 |
duration_seconds | 再生時間(秒)です。動画または音声ではないコンテンツの場合はnullです。 |
music_duration_sec | Length of the background music in seconds (photos). |
category_type | The post's category type (photos). |
author_is_verified | 投稿者が認証バッジを持っているかどうかです。リクエストによっては返されません。 |
author_is_private | 投稿者のアカウントが非公開かどうか。 |
author_is_seller | 投稿者がTikTok Shopの販売者かどうか。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 | 動画が広告かどうか。検索結果では通常含まれず、user_videosの結果では含まれない場合があります。 |
is_private | アカウントが非公開かどうか。 |
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 | 本文中のハッシュタグで、出現順に並びます。ない場合はフィールド自体が含まれません。 |
mentions | Accounts mentioned with @ in the post (photos). |
suggested_words | Suggested words on the post (photos). |
platform | 取得元プラットフォームの識別子で、リクエストのplatformと同じです(例:xiaohongshu、tiktok)。 |
エラーと課金
#- 401
- キーが未指定か無効です。
- 402
- 残高が不足しています。先にチャージしてください。
- 422
- パラメータ名または値が無効です。エラーに含まれる候補を参考に修正してください。課金はされません。
- 429
- 1分あたりのリクエスト上限に達しました。Retry-Afterの指定に従って待ってから再試行してください。
- 503
- 処理を完了できませんでした。保留中の請求額は残高に戻されます。結果が不明な場合は、再試行する前に確認してください。
- 200(空)
- データがありません。課金はされません。