How to Scrape TikTok User Data with PHP

Published on December 5, 2025

Introduction

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.

Prerequisites

  • A TikLiveAPI Key (Get one from the Pricing page)
  • PHP installed on your server
  • cURL enabled

Step 1: Get Your API Key

First, sign up and get your API key. This key is required to authenticate your requests.

Step 2: The PHP Code

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;

Conclusion

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.