net3000.tiktok 1.0.0

dotnet add package net3000.tiktok --version 1.0.0
                    
NuGet\Install-Package net3000.tiktok -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="net3000.tiktok" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="net3000.tiktok" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="net3000.tiktok" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add net3000.tiktok --version 1.0.0
                    
#r "nuget: net3000.tiktok, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package net3000.tiktok@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=net3000.tiktok&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=net3000.tiktok&version=1.0.0
                    
Install as a Cake Tool

Net3000.TikTok

Overview

The Net3000.TikTok library provides comprehensive integration with the TikTok API for Net3000 solutions. This library enables video uploads, channel feed retrieval, and TikTok content management.

Features

  • Video Upload: Upload videos directly to TikTok with customizable privacy settings
  • Feed Retrieval: Retrieve video lists from a user's TikTok channel
  • Video Information: Get detailed information about specific videos
  • Upload Status: Check the processing status of uploaded videos
  • Privacy Controls: Configure comment, duet, and stitch settings for uploads

Installation

dotnet add package net3000.tiktok

Dependencies

  • net3000.common (v9.0.11)
  • net3000.common.models (v1.0.7)

Configuration

Add your TikTok API credentials to your configuration:

{
  "TikTok": {
    "ClientKey": "your-client-key",
    "ClientSecret": "your-client-secret",
    "ApiVersion": "v2"
  }
}

Authentication

TikTok uses OAuth 2.0 for authentication. You'll need to:

  1. Register your application at TikTok Developer Portal
  2. Implement OAuth flow to obtain user access tokens
  3. Set the AccessToken and OpenId properties before making API calls

Required Scopes

  • video.upload - For uploading videos
  • video.list - For retrieving video lists
  • user.info.basic - For accessing user information

Usage

Basic Setup

using net3000.tiktok;

// Initialize the service
var tiktokService = new lib(configuration);

// Set credentials (obtained through OAuth)
tiktokService.AccessToken = "user-access-token";
tiktokService.OpenId = "user-open-id";

Uploading Videos

// Read video file
byte[] videoData = File.ReadAllBytes("path/to/video.mp4");

// Upload with settings
var uploadResult = await tiktokService.UploadVideo(
    videoData: videoData,
    title: "My Awesome Video!",
    description: "Check out this amazing content",
    privacyLevel: "PUBLIC_TO_EVERYONE",
    disableComment: false,
    disableDuet: false,
    disableStitch: false
);

if (uploadResult.success)
{
    var publishId = uploadResult.data.publish_id;
    Console.WriteLine($"Video uploaded! Publish ID: {publishId}");
    
    // Check upload status
    var statusResult = await tiktokService.CheckVideoStatus(publishId);
    if (statusResult.success)
    {
        Console.WriteLine($"Status: {statusResult.data.data.status}");
    }
}

Retrieving Channel Videos

// Get user's videos
var videosResult = await tiktokService.GetUserVideos(maxCount: 20);

if (videosResult.success)
{
    foreach (var video in videosResult.data.data.videos)
    {
        Console.WriteLine($"Video ID: {video.id}");
        Console.WriteLine($"Title: {video.title}");
        Console.WriteLine($"Views: {video.view_count}");
        Console.WriteLine($"Likes: {video.like_count}");
        Console.WriteLine($"Share URL: {video.share_url}");
        Console.WriteLine($"Created: {video.CreatedDate}");
        Console.WriteLine("---");
    }
    
    // Pagination
    if (videosResult.data.data.has_more)
    {
        var nextCursor = videosResult.data.data.cursor;
        var nextPage = await tiktokService.GetUserVideos(maxCount: 20, cursor: nextCursor);
    }
}

Getting Video Details

// Get detailed information about a specific video
var videoInfo = await tiktokService.GetVideoInfo("video-id-here");

if (videoInfo.success)
{
    var video = videoInfo.data;
    Console.WriteLine($"Title: {video.title}");
    Console.WriteLine($"Duration: {video.duration} seconds");
    Console.WriteLine($"Resolution: {video.width}x{video.height}");
    Console.WriteLine($"Description: {video.video_description}");
    Console.WriteLine($"Engagement: {video.like_count} likes, {video.comment_count} comments");
}

Alternative Setup (Without Configuration)

// Initialize without configuration
var tiktokService = new lib();

// Set credentials manually
tiktokService.ClientKey = "your-client-key";
tiktokService.ClientSecret = "your-client-secret";
tiktokService.AccessToken = "user-access-token";
tiktokService.OpenId = "user-open-id";
tiktokService.ApiVersion = "v2";

API Reference

lib (Main Service Class)

Main service class for TikTok API integration.

Properties
  • AccessToken - TikTok user access token (required for all operations)
  • ClientKey - TikTok application client key
  • ClientSecret - TikTok application client secret
  • ApiVersion - API version (default: "v2")
  • OpenId - TikTok Open ID (user identifier)
Methods
UploadVideo

Uploads a video to TikTok.

Parameters:

  • videoData (byte[]) - Video file as byte array
  • title (string) - Video title/caption (required)
  • description (string?) - Video description (optional)
  • privacyLevel (string) - Privacy level: "PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "SELF_ONLY"
  • disableComment (bool) - Whether to disable comments
  • disableDuet (bool) - Whether to disable duet
  • disableStitch (bool) - Whether to disable stitch

Returns: apiResponse<VideoUploadResponse>

GetUserVideos

Retrieves video list from user's channel.

Parameters:

  • maxCount (int) - Maximum number of videos to retrieve (default: 20, max: 20)
  • cursor (long?) - Cursor for pagination (optional)

Returns: apiResponse<VideoListResponse>

GetVideoInfo

Retrieves detailed information about a specific video.

Parameters:

  • videoId (string) - TikTok video ID

Returns: apiResponse<VideoInfo>

CheckVideoStatus

Checks the processing status of an uploaded video.

Parameters:

  • publishId (string) - Publish ID returned from UploadVideo

Returns: apiResponse<VideoStatusResponse>

Models

VideoInfo

Contains detailed information about a TikTok video.

Properties:

  • id - Unique video identifier
  • title - Video title
  • video_description - Video description/caption
  • share_url - Shareable URL
  • cover_image_url - Cover image URL
  • duration - Duration in seconds
  • width / height - Video dimensions
  • view_count - Number of views
  • like_count - Number of likes
  • comment_count - Number of comments
  • share_count - Number of shares
  • create_time - Creation timestamp (Unix)
  • CreatedDate - Creation date (DateTime)
VideoUploadResponse

Contains information about an uploaded video.

Properties:

  • publish_id - Unique identifier for tracking upload status
  • upload_url - URL where video was uploaded
VideoListResponse

Contains a list of videos and pagination information.

Properties:

  • data.videos - List of VideoInfo objects
  • data.cursor - Cursor for next page
  • data.has_more - Whether more results exist
VideoStatusData

Contains upload processing status.

Properties:

  • status - Status: "PUBLISH_COMPLETE", "PROCESSING_UPLOAD", "FAILED", etc.
  • fail_reason - Failure reason (if applicable)
  • publicly_available_post_id - Video ID after publishing completes

Privacy Levels

  • PUBLIC_TO_EVERYONE - Anyone can view the video
  • MUTUAL_FOLLOW_FRIENDS - Only mutual followers can view
  • SELF_ONLY - Only the creator can view (private)

Upload Status Values

  • PROCESSING_UPLOAD - Video is being processed
  • PUBLISH_COMPLETE - Video is published and available
  • FAILED - Upload or processing failed

Error Handling

The library provides comprehensive error handling with detailed error messages from the TikTok API. All methods return apiResponse<T> objects with success/failure status and detailed error information.

Common errors:

  • Missing access token or Open ID
  • Invalid video format or size
  • Insufficient API permissions
  • Rate limit exceeded
  • Network errors

Rate Limiting

TikTok API has rate limits. The library respects these limits but does not implement automatic retry logic. Monitor response headers and implement appropriate backoff strategies in your application.

Video Requirements

  • Format: MP4, WebM, or MOV
  • Size: Maximum 4GB
  • Duration: 3 seconds to 10 minutes (varies by account type)
  • Resolution: Minimum 720p recommended, maximum 4K
  • Aspect Ratio: 9:16 (portrait) recommended

Testing

  1. Create a TikTok developer account
  2. Register your application
  3. Use test accounts for development
  4. Test uploads with small video files first

Best Practices

  1. Always check apiResponse.success before accessing data
  2. Implement OAuth token refresh logic
  3. Handle rate limiting gracefully
  4. Validate video files before upload
  5. Use appropriate privacy levels
  6. Monitor upload status for long videos

License

This library is proprietary to Net3000. Usage is restricted to Net3000.ca solutions and authorized affiliates. Redistribution, sublicensing, or integration with third-party products outside the Net3000 ecosystem is prohibited without written consent from Net3000.

Support

For support and questions, contact the Net3000 development team or visit net3000.ca.

Changelog

v1.0.0

  • Initial release with TikTok API integration
  • Video upload functionality
  • Channel feed retrieval
  • Video information queries
  • Upload status tracking
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on net3000.tiktok:

Package Downloads
net3000.servicecoordinator

Service coordination library for Net3000 solutions. Provides API connection management and service orchestration capabilities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 185 6/30/2026

Initial release of Net3000 TikTok library with API integration for video upload and feed retrieval.