Introducing TikTok Direct Publishing, Analytics, and Commenting

We are excited to announce that in partnership with TikTok, Ayrshare now has direct TikTok publishing, advanced post analytics, and managing comments with the TikTok API.

What does this mean and why it is better?

Here is a quick summary:

Key features:

  • Direct video publishing. Previously you had to receive a TikTok mobile notification, open the TikTok app, enter text, and click through a few screens to publish the video. Now videos are automatically posted, with the caption text, and directly shown in your TikTok feed.
  • The caption text sent with the post is now added to the video. Previously you had to manually enter the text in the TikTok mobile app.
  • Set a thumbnail on the video.
  • Get, add, and delete comments on a TikTok posts.
  • Advanced demographic analytics data, such as the countries and age range of the video viewers.
  • Hashtag recommendations directly from TikTok.

In the next sections, we’ll dive into the details.

Direct TikTok Publishing

Previously posting a TikTok video meant making an API request, waiting for a push notification to occur on your mobile phone, opening the TikTok mobile app, and manually enter caption text and approve the video.

That is a lot of effort for your users!

Important for Existing Connected TikTok Accounts: All user who currently have connected TikTok with Ayrshare will remain with this previous TikTok workflow. To use the new direct publishing workflow, unlink and relink your social account or use the /unlink endpoint.

Ayrshare’s partnership with TikTok gives access to directly post TikTok videos. With a simple API call you can add caption text, include a video, and select a thumbnail image for your TikTok video, and the video will be published automatically on TikTok, or you can schedule posts for later.

Here is a sample of a post using the Ayrshare social API:

POST https://app.ayrshare.com/api/post
{
    "post": "This is the best caption for a TikTok video",
    "platforms": ["tiktok"],
    "mediaUrls": ["https://img.ayrshare.com/012/tiktok.mp4"],
    "tikTokOptions": {
        "thumbNailOffset": 3000 // milliseconds
    }
}

Advanced Analytics

In addition to direct publishing of videos, our TikTok API access provides advanced analytics data both at the account level, which includes likes, follower counts, demographic audience data, and more:

POST https://app.ayrshare.com/api/analytics/social
{
    "tiktok": {
        "analytics": {
            "audienceCountries": [
                {
                    "percentage": 0.25,
                    "country": "NG"
                },
                {
                    "percentage": 0.75,
                    "country": "US"
                }
            ],
            "audienceGenders": [
                {
                    "percentage": 0.25,
                    "gender": "Female"
                },
                {
                    "percentage": 0.5,
                    "gender": "Male"
                },
                {
                    "percentage": 0.25,
                    "gender": "Other"
                }
            ],
            "bio": "My TikTok account",
            "commentCountTotal": 33,       
            "displayName": "Me and You",
            "durationAverage": "10.72",   
            "followerCount": 34,          
            "followingCount": 39,          
            "isVerified": false,     
            "shareCountTotal": 4, 
            "url": "https://vm.tiktok.com/ZTRuw5kM6/",
            "userImage": "https://p16-sign-va.tiktokcdn.com/tos-maliv",
            "username": "@ayrshare",
            "videoCountTotal": 18,
            "viewCountTotal": 149
    },
    "status": "success"
}

and analytics for a particular video post, which included demographic, view, and more:

POST https://app.ayrshare.com/api/analytics/post
{
    "id": "0IJsldvtkGwohT3s",
    "status": "success",
    "tiktok": {
        "id": "721971891198",
        "postUrl": "https://www.tiktok.com/@ayrshare/video/721971891198",
        "analytics": {
            "audienceCountries": [
                {
                    "country": "US",
                    "percentage": 1
                }
            ],
            "averageTimeWatched": 68.2,
            "caption": "Let's see this new TikTok Post happen.",
            "comments": 1,
            "created": "2023-04-08T16:37:10Z",
            "embedUrl": "https://www.tiktok.com/static/profile-video?id=721971891198",
            "fullVideoWatchedRate": 0.8,
            "impressionSources": [
                {
                    "percentage": 0.3,
                    "impression_source": "Hashtag"
                },
                {
                    "percentage": 0.6,
                    "impression_source": "Personal Profile"
                },
                {
                    "percentage": 0.4,
                    "impression_source": "Search"
                },
                {
                    "percentage": 0,
                    "impression_source": "Sound"
                },
                {
                    "percentage": 0,
                    "impression_source": "Follow"
                },
                {
                    "percentage": 0,
                    "impression_source": "For You"
                }
            ],
            "itemId": "72197930961198",
            "likes": 1,
            "mediaType": "video",
            "name": "Ayrshare",
            "postUrl": "https://www.tiktok.com/@ayrshare/video/721971891198",
            "reach": 1,
            "shareUrl": "https://www.tiktok.com/@ayrshare/video/721971891198",
            "shares": 0,
            "tags": [],
            "thumbnailHeight": 1024,
            "thumbnailUrl": "https://p16-sign.tiktokcdn-us.com/obj/tos-useast5",
            "thumbnailWidth": 576,
            "totalTimeWatched": 341,
            "url": "https://www.tiktok.com/@ayrshare",
            "videoDuration": 15,
            "videoViews": 5
        }
    }
}

TikTok Comment Management

Ayrshare now offers the ability to create, get, and delete comments on a TikTok video post.

Let’s first see how to add a comment to a post:

POST https://app.ayrshare.com/api/comments/
{
    "id": "WMhZJDWbTkb5rAEvXb4C", // ID from the post
    "platforms": ["tiktok"],
    "comment":"I love this post"
}

Next, let’s get the comments on this post:

GET https://app.ayrshare.com/api/comments/WMhZJDWbTkb5rAEvXb4C
{
    "tiktok": [
        {
            "comment": "I love this post",
            "commentId": "7219724709370577710",
            "created": "2023-04-08T16:59:30Z",
            "liked": false,
            "likes": 0,
            "owner": false,
            "pinned": false,
            "platform": "tiktok",
            "profileImage": "https://p16-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx",
            "replies": 0,
            "status": "PUBLIC",
            "userId": "51e0cb95a8b14",
            "username": "ayrshare",
            "videoId": "7219723656732101931"
        }
    ],
    "status": "success",
    "id": "WMhZJDWbTkb5rAEvXb4C"
}

Finally, let’s delete the comment:

DELETE https://app.ayrshare.com/api/comments/WMhZJDWbTkb5rAEvXb4C

With the new advanced TikTok API access, Ayrshare is able to provide and unparalleled publishing, analytic insights, and comment management.

Check out the full Ayrshare API docs for more information.

Generate TikTok Hashtags

One final new capability is generating TikTok hashtags based on a keyword. These recommendations and hashtag view counts come directly from TikTok.

For example we can get suggested hashtags on the keyword “apple”:

GET https://app.ayrshare.com/api/hashtags/recommend?keyword=apple

Returned are suggest hashtags and their number of views:

{
    "keyword": "apple",
    "recommendations": [
        {
            "viewCount": 71950998550, // The number of views that the recommended hashtag has received.
            "name": "apple"           // Suggested hashtag
        },
        {
            "viewCount": 6318280101,
            "name": "applewatch"
        },
        {
            "viewCount": 2486358394,
            "name": "applepencil"
        },
        {
            "viewCount": 2142842131,
            "name": "applemusic"
        },
        {
            "viewCount": 1506224079,
            "name": "applesquad"
        },
        {
            "viewCount": 1307287255,
            "name": "apples"
        },
        {
            "viewCount": 1008293028,
            "name": "applepie"
        },
        {
            "viewCount": 788388838,
            "name": "applejuice"
        },
        {
            "viewCount": 1024901638,
            "name": "appletv"
        },
        {
            "viewCount": 679033194,
            "name": "applechallenge"
        }
    ]
}

The new TikTok direct publishing, comment management, analytics, and hashtags are powerful additions to Ayrshare’s social media APIs. If you have questions, let us know; we’re here to help.