Skip to main content
Glama

get_tiktok_user_videos

Fetch recent videos from a TikTok user profile using authenticated browser cookies. Specify username and limit to retrieve video content programmatically.

Instructions

Fetch recent videos from a TikTok user profile. Uses Chrome cookies for authentication.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesTikTok username (with or without @)
limitNoMax videos to return (default 15)

Implementation Reference

  • Registration and implementation of the 'get_tiktok_user_videos' tool, which fetches TikTok user videos.
    server.tool(
      'get_tiktok_user_videos',
      'Fetch recent videos from a TikTok user profile. Uses Chrome cookies for authentication.',
      {
        username: z.string().describe('TikTok username (with or without @)'),
        limit: z.number().min(1).max(30).default(15).describe('Max videos to return (default 15)'),
      },
      async ({ username, limit }) => {
        const depErr = checkDeps();
        if (depErr) return errorResult(depErr);
    
        const handle = username.startsWith('@') ? username : `@${username}`;
        const url = `https://www.tiktok.com/${handle}`;
    
        try {
          const result = await fetchFeed(url, limit);
          const videos = (result.entries || []).map((e) => ({
            title: e.title,
            url: e.url,
            duration: e.duration,
            view_count: e.view_count,
            like_count: e.like_count,
            comment_count: e.comment_count,
            uploader: e.uploader,
          }));
          return textResult({ username: handle, count: videos.length, videos });
        } catch (err) {
          return errorResult(`Error: ${err instanceof Error ? err.message : String(err)}`);
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ronantakizawa/social-video-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server