JSPM

@rediska1114/tiktok-api

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 54
    • Score
      100M100P100Q78898F
    • License ISC

    TikTok API library for fetching user profiles, posts, and challenges

    Package Exports

    • @rediska1114/tiktok-api
    • @rediska1114/tiktok-api/_virtual/__vite-browser-external
    • @rediska1114/tiktok-api/api/getChallenge/index
    • @rediska1114/tiktok-api/api/getChallenge/params
    • @rediska1114/tiktok-api/api/getChallenge/types
    • @rediska1114/tiktok-api/api/getUser/index
    • @rediska1114/tiktok-api/api/getUser/params
    • @rediska1114/tiktok-api/api/getUser/types
    • @rediska1114/tiktok-api/api/getUserPosts/index
    • @rediska1114/tiktok-api/api/getUserPosts/params
    • @rediska1114/tiktok-api/api/getUserPosts/types
    • @rediska1114/tiktok-api/constants/errors
    • @rediska1114/tiktok-api/constants/retry
    • @rediska1114/tiktok-api/constants/tokens
    • @rediska1114/tiktok-api/constants/urls
    • @rediska1114/tiktok-api/index
    • @rediska1114/tiktok-api/utils/helpers
    • @rediska1114/tiktok-api/utils/signUrl
    • @rediska1114/tiktok-api/utils/xbogus
    • @rediska1114/tiktok-api/utils/xgnarly

    Readme

    @rediska1114/tiktok-api

    TikTok API library for fetching user profiles, posts, and challenges.

    Installation

    npm install @rediska1114/tiktok-api

    Peer Dependencies

    This library requires the following peer dependencies:

    npm install axios cheerio qs async-retry https-proxy-agent

    Usage

    ES Modules

    import { getUser, getUserPosts, getChallenge } from '@rediska1114/tiktok-api';
    
    // Get user profile
    const user = await getUser('username');
    console.log(user);
    
    // Get user posts
    const posts = await getUserPosts('user_sec_uid', undefined, 10);
    console.log(posts);
    
    // Get challenge/hashtag info
    const challenge = await getChallenge('fyp');
    console.log(challenge);

    CommonJS

    const { getUser, getUserPosts, getChallenge } = require('@rediska1114/tiktok-api');
    
    // Get user profile
    getUser('username').then(user => {
      console.log(user);
    });

    API

    getUser(username: string, proxy?: string)

    Fetches user profile information.

    Parameters:

    • username - TikTok username (with or without @)
    • proxy (optional) - HTTP proxy URL

    Returns: Promise<TiktokStalkUserResponse>

    getUserPosts(secUid: string, proxy?: string, postLimit?: number)

    Fetches user posts.

    Parameters:

    • secUid - User's secure ID (obtained from getUser)
    • proxy (optional) - HTTP proxy URL
    • postLimit (optional) - Maximum number of posts to fetch

    Returns: Promise<TiktokUserPostsResponse>

    getChallenge(hashtag: string, proxy?: string)

    Fetches challenge/hashtag information.

    Parameters:

    • hashtag - Hashtag/challenge name
    • proxy (optional) - HTTP proxy URL

    Returns: Promise<{ error?: string; statusCode?: number; data: TiktokChallengeResponse | null }>

    Types

    All TypeScript types are exported from the main module:

    import type {
      TiktokStalkUserResponse,
      UserProfile,
      TiktokUserPostsResponse,
      Posts,
      TiktokChallengeResponse,
      TiktokError
    } from '@rediska1114/tiktok-api';

    License

    ISC