PHP code example of jsonscraper / tiktok-api-php

1. Go to this page and download the library: Download jsonscraper/tiktok-api-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jsonscraper / tiktok-api-php example snippets



ent = new TikTokRESTAPI\TikTok(getenv('JSONSCRAPER_TIKTOK_LICENSE_KEY'));
$client->setCacheTimeout(60);
$response = $client->getUserInfo('therock');
if ($response->isOk() && $response->getTiktok()?->isUser()) {
    echo $response->getTiktok()->getUser()->getUniqueId();
}

$video = $response->getTiktok()?->getAwemeDetail();
echo $video?->getAuthor()?->getNickname();
echo $video?->getStatistics()?->getPlayCount();
sh
composer