{"record":{"id":"5838cba4b0b7b178","repo":"jackwener/OpenCLI","slug":"tiktok-studio-item-list-returned-videos-without-st","errorCode":null,"errorMessage":"TikTok Studio item_list returned videos without stable video_id","messagePattern":"TikTok Studio item_list returned videos without stable video_id","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/tiktok/creator-videos.js","lineNumber":238,"sourceCode":"    for (let pageIndex = 0; pageIndex < maxPages && rows.length < limit; pageIndex += 1) {\n        const data = await fetchCreatorVideosPage(page, nextCursor, pageSize);\n        const items = Array.isArray(data.item_list) ? data.item_list : [];\n        for (const item of items) {\n            const row = normalizeRow(item);\n            if (!row) {\n                skippedMissingId += 1;\n                continue;\n            }\n            rows.push(row);\n            if (rows.length >= limit) break;\n        }\n        if (!data.has_more || items.length === 0) break;\n        nextCursor = requireCursor(data.cursor);\n        await page.wait(250);\n    }\n\n    if (rows.length === 0 && skippedMissingId > 0) {\n        throw new CommandExecutionError('TikTok Studio item_list returned videos without stable video_id');\n    }\n    if (rows.length === 0) {\n        throw new EmptyResultError('tiktok creator-videos', 'No creator videos were returned. Confirm the current Chrome profile is logged in to TikTok Studio and has published content.');\n    }\n    return rows.slice(0, limit);\n}\n\nexport const creatorVideosCommand = cli({\n    site: 'tiktok',\n    name: 'creator-videos',\n    access: 'read',\n    description: 'TikTok Studio creator content list (views/likes/comments/saves/shares)',\n    domain: 'www.tiktok.com',\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: STUDIO_CONTENT_URL,\n    args: [\n        { name: 'limit', type: 'int', default: DEFAULT_LIMIT, help: `Number of creator videos to return (max ${MAX_LIMIT})` },","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/tiktok/creator-videos.js#L220-L256","documentation":"After paginating through item_list, every returned row lacked a stable video id, so no usable rows could be produced even though items existed (skippedMissingId > 0). The library throws because silently returning zero rows would hide an API response-shape change.","triggerScenarios":"items were returned by item_list but each item's video_id/id field was missing or unstable (e.g. TikTok renamed the id field or moved it into a nested object), causing all items to be skipped.","commonSituations":"TikTok changed the item_list JSON schema (id key renamed/moved), draft/scheduled posts lacking ids, or a regional API variant returning a different item shape.","solutions":["Update this library — a schema change in TikTok's item_list response usually needs a parser fix","Log one raw item payload to check which id field is actually present (id vs video_id vs aweme_id)","Exclude drafts/pending posts from the query — some may legitimately lack ids","Report the raw item shape to the maintainers if the schema changed"],"exampleFix":"// before\nconst id = item.video_id;\n// after\nconst id = item.video_id || item.id || item.aweme_id;\nif (id) rows.push({ id, ... }); else skippedMissingId++;","handlingStrategy":"validation","validationCode":"// Sanity-check one raw item has an id before bulk pagination\nconst probe = await listCreatorVideos(page, { limit: 1 });\nif (!probe[0]?.id) throw new Error('item_list item shape changed: no id field');","typeGuard":"function hasVideoId(item) { return !!item && typeof item === 'object' && typeof (item.video_id || item.id || item.aweme_id) === 'string'; }","tryCatchPattern":"try {\n  rows = await listCreatorVideos(page, opts);\n} catch (e) {\n  if (/without stable video_id/.test(e.message)) {\n    console.error('TikTok item_list schema changed — update the CLI library');\n  }\n  throw e;\n}","preventionTips":["Keep the library updated against TikTok API schema changes","Log a raw item payload when this error appears to identify the new id field","Avoid mixing drafts/scheduled posts into queries when they lack ids"],"tags":["tiktok","schema-change","missing-field","api"],"backgroundTag":"missing-required-field","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}