Invalid structure

The video page JSON loaded, but the item was missing or marked failed.

The error#

TikTok returned an invalid response structure.

Same class as the invalid-response page, InvalidResponseException, different message. Raised from video.info in two spots after __UNIVERSAL_DATA_FOR_REHYDRATION__ has been parsed:

  • webapp.video-detail.statusCode is present and not 0
  • itemInfo.itemStruct is missing

error_code is the HTTP status of the page, which was 200 on this path (a non-200 already raised the other message).

What triggers it#

The HTML contained the hydration script, json.loads succeeded, and the video object TikTok usually puts in itemStruct was absent or flagged. A deleted, private or region-blocked video often arrives this way. This version does not map statusCode onto a narrower exception. NotFoundException exists and is not raised.

How to confirm#

The message ends with structure, not just invalid response. Open the same URL in a browser while signed out. If the watch page has no video, the structure error matches the page you see.

Fixes#

There is no parameter on video.info that selects another hydration key. Changing headless or the proxy helps when the HTML was a bot wall. It does not restore itemStruct for a video TikTok is not serving. Check the URL, then treat a repeated structure error as the video being unavailable.

SocialScrape#

Profile is GET /v1/tiktok/profile. Video is GET /v1/tiktok/video. Transcript is GET /v1/tiktok/video/transcript: TikTok's captions when they exist, otherwise AI transcription of the audio.

Failed requests cost 0 credits. New accounts get 100 credits on signup, no card.

Questions

Is statusCode 0 success?

The code treats a missing statusCode as 0, and raises when the value is anything else.

Does SocialScrape transcribe a video with no captions?

GET /v1/tiktok/video/transcript uses TikTok's captions, then AI transcription of the audio.