Download the PHP package haianibrahim/tiktok-scraper without Composer
On this page you can find all versions of the php package haianibrahim/tiktok-scraper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download haianibrahim/tiktok-scraper
More information about haianibrahim/tiktok-scraper
Files in haianibrahim/tiktok-scraper
Download haianibrahim/tiktok-scraper
More information about haianibrahim/tiktok-scraper
Files in haianibrahim/tiktok-scraper
Vendor haianibrahim
Package tiktok-scraper
Short Description Custom TikTok scraper for video posts, photo posts and user profiles (PHP 8, PSR-4, Guzzle)
License GPL-3.0
Package tiktok-scraper
Short Description Custom TikTok scraper for video posts, photo posts and user profiles (PHP 8, PSR-4, Guzzle)
License GPL-3.0
Please rate this library. Is it a good library?
Informations about the package tiktok-scraper
TikTok Custom PHP Scraper
Scrape basic details from public TikTok video posts, photo posts and user profiles in PHP. This is a cleaned-up, PSR‑4, PHP 8 rewrite using Guzzle and zero private APIs.
Features
- Public video posts (
/video/): canonical URL, IDs, username, nickname, description, thumbnail and counters - Public photo posts (
/photo/): same normalized shape as videos - Public user profiles: identity, avatars, bio, verification and follower/heart/video stats
- PSR‑4 autoloaded library with typed, immutable DTO output
- Pluggable Guzzle client for testing and timeouts
- No headless browser, no TikTok private API usage
Installation
Install via Composer:
Quick Start
Post output shape (VideoDetails):
- status: "ok"
- link
- user (nickname)
- username
- user_id
- video_id
- video_desc
- thumbnail
- views, likes, comments, shares, favorites
Scraping User Profiles
Fetch public profile information by bare username, @username, or a full profile URL:
Profile output shape (UserInfo):
- status: "ok"
- user_id, sec_uid, username, nickname
- signature (bio)
- avatar_thumb, avatar_medium, avatar_larger
- verified, private_account
- create_time, region
- follower_count, following_count, heart_count, video_count, digg_count, friend_count
- profile_url
- share_title, share_desc
API
- TikTokScraper::scrape(string $url): VideoDetails — video and photo posts
- TikTokScraper::scrapeUser(string $usernameOrUrl): UserInfo — user profiles
- VideoDetails::toArray(): array
- UserInfo::toArray(): array
Exceptions
- Base: Hki98\TikTok\Exception\TikTokScraperException (catch-all)
- Specific:
- Hki98\TikTok\Exception\InvalidUrlException
- Hki98\TikTok\Exception\HttpRequestException
- Hki98\TikTok\Exception\EmptyResponseException
- Hki98\TikTok\Exception\ParseException
Notes
- TikTok frequently changes HTML structure; this scraper parses the rehydration JSON in a script tag. If the key paths change, update the normalization method.
- Respect robots.txt and terms of service in your jurisdiction.
Development
- PHP 8.1+
- PSR‑12 coding style recommended
- Autoload: PSR‑4 under namespace
Hki98\\TikTok(src/)
Run autoload dump after cloning:
Credit
- Original author: Haian K. Ibrahim (https://github.com/haianibrahim)
- HTML parsing here is regex-based for one script tag; the bundled
simple_html_dom.phpis kept for historical context but not used by the new class.
License
GPL-3.0
All versions of tiktok-scraper with dependencies
PHP Build Version
Package Version
The package haianibrahim/tiktok-scraper contains the following files
Loading the files please wait ...