Skip to main content
Use client.media.matchTextStyle with ugcinc 5.1.0. Restricted API keys need content:analyze. The image URL must be publicly downloadable. Coordinates refer to the displayed image in pixels, after EXIF orientation.

Match a TikTok caption

Include the complete caption and its outline inside the box, with some margin. Supply text explicitly when emoji or precise line breaks matter. Native fitting supports the tiktok-classic-ios-47 profile: white letters with a dark outline, including supported emoji. It can fit captions over photographs. Other colors, unoutlined text, ambiguous backgrounds, or unsupported scripts can return unavailable. This is a bounded profile matcher, not a universal font identifier.

Inputs

image-editor fits the existing image-editor text settings on a plain, approximately uniform background. It returns up to three candidates containing an element and previewConfig. auto tries that path for ASCII and falls back to native fitting when it is unavailable; Unicode text goes directly to native.

Interpret the result

Native results use version: 2, surface: 'native-text-sticker', and an empty candidates array. A fitted result contains nativeResult:
  • stickerUrl: clean native RGBA PNG, without pixels copied from the reference.
  • settings: native points and renderer profile; the native output uses three pixels per point.
  • composition: top-left x, y, displayed width, height, and scale. Scale applies to the PNG’s intrinsic pixel dimensions. Place the whole PNG at these coordinates; do not trim its transparent margins without adjusting them.
  • maskIoU: white letter-fill overlap, separately from outline overlap in diagnostics.outlineIoU.
  • foregroundMae: residual against an estimated background composite.
  • quality: close or approximate; fontIdentity remains unverified.
The comparison difference is restricted to segmented text, outline, and supported warm-colored emoji evidence. It does not measure every background pixel or prove pixel identity against a compressed reference. Inspect the preview alongside the metrics. Approximate results are usable candidates, not exact font claims. Generic results retain version: 1 and surface: 'image-editor-element'. Both paths include renders, fitAttempted, reasonCode, and nextActions. renders: 0 means a preprocessing or support check rejected the input before any candidate was fitted. Follow the suggested action rather than repeatedly resubmitting smaller crops that clip the caption.

HTTP and agent tools

Send the same input JSON to POST /media/analysis/match-text-style at https://api.ugc.inc. Poll POST /media/analysis/status with { "jobId": "…" } until completed or failed. Responses use the standard { code, data } envelope. Use your API key as a bearer token and provide your organization in the orgId query parameter. The agent tools are match_text_style and get_media_analysis; the matching tool accepts the same input fields.