How to Get Product and Video Information Using ZOCAILMINE API
A developer's guide to programmatically fetching TikTok public data without headless browsers.
Introduction
Accessing TikTok data programmatically is notoriously difficult due to aggressive anti-scraping measures and dynamic encryption. Developers often struggle with signature generation (_signature) or maintaining headless browser farms. ZOCAILMINE simplifies this by providing a RESTful gateway to raw TikTok data.
In this guide, we will explore how to fetch public profile data and video details using a simple HTTP request, abstracting away the complex reverse engineering.
Concept: The URL-to-Data Pipeline
The core concept is "Input URL, Output JSON." Instead of navigating the DOM, you pass a clean TikTok URL to our endpoints. Based on the logic in our client SDK, we categorize requests into distinct types such as posts-url (for single video data) and profile (for user stats).
Comparison: Official API vs. ZOCAILMINE
| Feature | Official TikTok Display API | ZOCAILMINE Scraper API |
|---|---|---|
| Approval | Requires App Review | Instant Access |
| Scope | Logged-in User Data Only | Any Public Data |
| Rate Limits | Strict per-user limits | Flexible based on API Key plan |
| Endpoints | Limited to basic profile | Profile, Feed, Comments, Search |
Code Example: Fetching a Profile
To get profile information, we target the /api/v1/tiktok/profile endpoint. You only need the target user's URL.
// Example using Axios (similar to the executeApi function in our SDK)
import axios from 'axios';
const getProfile = async (targetUrl: string, apiKey: string) => {
try {
const response = await axios.post('[https://api.zocailmine.com/api/v1/tiktok/profile](https://api.zocailmine.com/api/v1/tiktok/profile)', {
url: targetUrl
}, {
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json'
}
});
return response.data;
} catch (error) {
console.error("Scraping failed:", error.message);
}
};
// Usage
getProfile('[https://www.tiktok.com/@tiktok](https://www.tiktok.com/@tiktok)', 'YOUR_API_KEY');