TikTok Display API video query: read is_aigc on 20 posts per call
TikTok's Query Videos endpoint returns is_aigc and counts for up to 20 video ids per call. Short Python audit, and where Sume fits.

To read how TikTok shows your AI posts, call POST https://open.tiktokapis.com/v2/video/query/ with up to 20 video ids and a fields list that includes is_aigc. It needs the video.list scope and returns details only for videos that belong to the authorizing user.
That makes it a cheap audit: one call checks the label state and the view, like, comment and share counts for a page of posts. Sume does not read your TikTok account; the audit is a TikTok-side step, and Sume comes in when you decide which posts to re-edit.
What does the Query Videos endpoint return?
TikTok's reference lists these selectable fields: id, create_time, cover_image_url, share_url, video_description, duration, height, width, title, embed_html, embed_link, like_count, comment_count, share_count, view_count and is_aigc. The fields parameter is mandatory and goes in the query string, and the video ids go in the JSON body under filters.video_ids. The response nests the videos under data.videos with an error object whose code reads ok on success.
The List Videos endpoint is the companion for discovery. It uses the same video.list scope and returns public videos sorted by create_time descending, with max_count defaulting to 10 and capped at 20, a cursor for the next page and a has_more flag. List first to collect ids, then query in groups of 20 for the fields you need.
How do you audit labels with a short script?
The script below sends one page of ids and prints the label and view count. It reads the token from the environment and exits early if it is missing.
import json, os, sys, urllib.request
token = os.environ.get("TIKTOK_ACCESS_TOKEN")
if not token:
sys.exit("set TIKTOK_ACCESS_TOKEN")
ids = sys.argv[1:21]
if not ids:
sys.exit("pass up to 20 video ids")
url = ("https://open.tiktokapis.com/v2/video/query/"
"?fields=id,title,is_aigc,view_count")
req = urllib.request.Request(
url,
data=json.dumps({"filters": {"video_ids": ids}}).encode(),
headers={"Authorization": f"Bearer {token}",
"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as resp:
body = json.load(resp)
if body["error"]["code"] != "ok":
sys.exit(body["error"]["message"])
for v in body["data"]["videos"]:
print(v["id"], v.get("is_aigc"), v.get("view_count"))What should you do with the results?
Compare is_aigc with your own log. If you disclosed a clip at upload and it reads true, nothing to do. If you did not disclose and it reads true, note it and review your upload flow. If it reads false for a clip you made with an avatar, decide whether your own caption or sticker disclosure is enough under TikTok's current rules, and check the policy pages rather than assuming.
Then use the counts. Sort the page by view_count and note the top and bottom performers by hook. The point is to learn which hook earned attention, so the next batch starts from evidence.
Two cautions on reading the numbers. A new post has had little time to collect views, so audit posts that are at least a few days old before you compare them. And counts describe attention, not label effect: TikTok's pages I read do not say how an AI label changes distribution, so do not conclude from one account's numbers that a label helped or hurt. Keep the label and the metric side by side in your log and look for a pattern across many posts before you change your process.
Where does Sume come in?
Sume starts after you choose. Trim a winning clip to a shorter cut with video trim, or re-burn a different caption style with video captions. Both work on a clip that already lives on media.sume.com, so import your own source file first through POST /v1/media-imports, as the docs require.
Be clear about the limits. Direct Post and this audit are TikTok's, under its own scopes, authorization and limits. Sume does not call them for you, and the audit above works with or without any Sume job.
The ids themselves come from two places. The List Videos response carries them for public posts, and your own publishing log carries them if you stored the id when a post went live. Using your log is better for an audit, because it covers private and recently posted clips too. If a call returns fewer videos than ids you sent, compare the lists: the endpoint verifies ownership, so an id that is not on the authorizing account will not come back.
Batch the work. A hundred posts is five calls of 20, so a nightly job is enough for most accounts. Write the output to a file with the date, then diff it against the previous night to spot a post whose is_aigc value changed since you last looked. That change is the event worth investigating.
Sources
Related posts
More in Developers
- TikTok oEmbed: embed a posted clip, or host the MP4 yourself?
TikTok's oEmbed endpoint turns a video URL into an embed blockquote. When that beats hosting the file, and what a Sume-made MP4 changes about the choice.
- Transactional outbox for paid API calls in Python (Sume)
Write the Sume request and its Idempotency-Key in the order's transaction, drain later: a tested Python outbox that survives crashes, 429s and 409s.
- Transcribe a three-hour recording when the API caps at ten minutes
Streaming sessions end at an hour; Sume STT jobs take up to 600 seconds. Split with Timeline audio, transcribe 18 chunks, and stitch word times back together.
- Translate an SRT and burn it in: Sume caption cues, limits, Python
Sume takes no SRT upload, but caption cues take the same text and times. A Python converter, the 200-cue and 60-second limits, and which fonts apply.
Written by Sume