TikTok guide

How can an AI agent extract information from a TikTok link and return JSON?

Send a TikTok URL, a prompt, and a JSON Schema to mamitsu. It watches the video, hears the audio, reads the caption, and returns the information you need as structured JSON.

The request tells mamitsu what to understand

Give it a URL, a prompt, and a schema.

The TikTok URL selects the content. The prompt tells mamitsu what to look for. The schema defines the JSON contract your application receives. The mamitsu API reference documents these as the required url, prompt, and schema fields.

This example asks mamitsu to extract information from the content, not just return post metadata.

TikTok request
curl https://usemamitsu.com/api/v1/extract \
  -H "Authorization: Bearer $XTRAKT_USER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://www.tiktok.com/@creator/video/1234567890",
  "prompt": "Extract every product visibly shown or explicitly named in the video. Include the brand when it is stated and summarize the recommendation in one sentence. Do not infer products that are not present.",
  "schema": {
    "type": "object",
    "properties": {
      "products": {
        "type": "array",
        "description": "Products visibly shown or explicitly named in the video",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The product name as shown or said"
            },
            "brand": {
              "type": [
                "string",
                "null"
              ],
              "description": "The product brand, or null when it is not stated"
            },
            "recommendation": {
              "type": [
                "string",
                "null"
              ],
              "description": "What the video recommends or says about the product, or null when no recommendation is made"
            }
          },
          "required": [
            "name",
            "brand",
            "recommendation"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "products"
    ],
    "additionalProperties": false
  }
}'
Prompt
Extract every product visibly shown or explicitly named in the video. Include the brand when it is stated and summarize the recommendation in one sentence. Do not infer products that are not present.

The result contains your data and the source

Your JSON comes back under data.

A successful response returns the object shaped by your schema and identifies the source provider and URL that were processed.

The example values are illustrative. Check the values that matter before using them in a customer-facing or automated workflow.

JSON Schema
{
  "type": "object",
  "properties": {
    "products": {
      "type": "array",
      "description": "Products visibly shown or explicitly named in the video",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The product name as shown or said"
          },
          "brand": {
            "type": ["string", "null"],
            "description": "The product brand, or null when it is not stated"
          },
          "recommendation": {
            "type": ["string", "null"],
            "description": "What the video recommends or says about the product, or null when no recommendation is made"
          }
        },
        "required": ["name", "brand", "recommendation"],
        "additionalProperties": false
      }
    }
  },
  "required": ["products"],
  "additionalProperties": false
}
Response, 200
{
  "extraction_id": "ext_example",
  "data": {
    "products": [
      {
        "name": "Example trail snack",
        "brand": null,
        "recommendation": "The creator recommends it for day hikes."
      }
    ]
  },
  "source": {
    "provider": "tiktok",
    "url": "https://www.tiktok.com/@creator/video/1234567890"
  }
}

How mamitsu reads the source

mamitsu reads the content, not only the page metadata

The URL is only the input. The mamitsu homepage describes the workflow as watching frames, hearing audio, and reading the caption. mamitsu interprets the content available in the TikTok post:

  • Frames can provide visual evidence such as products, labels, scenes, or on-screen text.
  • Audio can provide spoken claims, instructions, or product names.
  • The caption can provide context that is not spoken in the video.

This is content understanding, not only retrieval

A metadata or transcript-only pipeline can tell you what a post record contains. mamitsu's extract workflow is designed for the next step: interpret the content available at the URL against your prompt and return the result in the schema your application requested. That is useful when the answer depends on what appears in the video, what is said, and what the caption adds.

Keep the result honest

Allow missing facts instead of forcing guesses.

Videos do not always state every field. Use a nullable type when a value may be absent. The API reference says mamitsu returns null for a value that is not in the video when the schema allows it. Without a nullable field, the result may require a best guess. For facts that affect decisions, treat the returned content as data to review, not as independent verification.

Nullable field
{
  "type": ["string", "null"],
  "description": "The value, or null when the source does not state it"
}

Build the edge cases into your agent

Know which URLs and limits apply.

Public posts and videos work. TikTok photo posts are not supported. A request times out after 90 seconds, and TikTok videos over 5 minutes return url_video_too_long. Other failures return an error object instead of data, with codes such as unsupported_url, url_source_inaccessible, invalid_schema, or extraction_failed. The request body can be up to 64 KB. Schemas can be up to 16 KB, 8 levels deep, and 200 nodes.

  • tiktok.com/@user/video/...
  • vm.tiktok.com/...
  • vt.tiktok.com/...
  • tiktok.com/t/...

TikTok is one input to the same mamitsu workflow used for Instagram, YouTube, and X. Your agent sends a URL, a prompt, and a schema. mamitsu interprets the content available at that URL and returns the requested JSON with a source record.

Back to API reference

Sources

The extraction endpoint is POST /api/v1/extract. Read the API reference for the complete schema and error-code list.

TikTok to JSON · mamitsu