TikTok is a goldmine of data for marketers and developers. In this tutorial, we'll show you how to use TikLiveAPI to scrape user data programmatically using PHP.
First, sign up and get your API key. This key is required to authenticate your requests.
Here is a simple script to fetch user details:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.tikliveapi.com/userid/?username=tiktok',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'X-Api-Key: YOUR_API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
That's it! You now have a JSON response containing all the user's public data. You can parse this JSON to display follower counts, bio, and more on your own dashboard.