Download the PHP package robert-grubb/tiktok-php without Composer
On this page you can find all versions of the php package robert-grubb/tiktok-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download robert-grubb/tiktok-php
More information about robert-grubb/tiktok-php
Files in robert-grubb/tiktok-php
Package tiktok-php
Short Description TikTok Scraper in PHP
License MIT
Homepage https://github.com/RobertGrubb/tiktok-php
Informations about the package tiktok-php
TikTok Scraper in PHP
1.9.14
Updates to the user->account
method have been made. No changes in the response object.
1.9.13
Introducing $scraper->user->videoFromEmbed('id');
This will return video data from the embed endpoint. Right now it's more stable than the normal video route. The only catch is that it does not return
1.9.12
Setting verifyFp manually is now an option, as captcha verification has been taking TikTok by storm. You can set it like so:
If you do not set one, by default, the scraper will attempt to generate the following cookies for you:
However, in most cases at this moment, the fp token will end up being a trigger for captcha.
Cookie File
In v1.8.0
, the scraper now sets cookies by default, which means that you must provide writable permissions for a cookies.json
file, and then set it in the configuration (see example config below).
Need to disable cookies? Set 'disableCookies' => true
in the configuration.
Installation
Instantiation
Configuration Explained
Search for a user
User data
User videos
All User Videos
Specific User Video
Download User Video
Discover
Trending
Music Data
Music Videos
Download Music by ID
Hashtag Data
Hashtag Videos
Signing a URL
2 methods of signing the URL is provided.
-
You can use nodejs, this package will look to see if you have it installed, however, if you do not, it will attempt to install it.
- You can use the datafet.ch api that I have personally built to accept requests from anyone to sign a tiktok url. (This package handles it automatically if you set
'signMethod' => 'datafetch'
in the configuration.)
DataFetch API Key
DataFetch API does rate limit your requests at a max of 100 requests per 15 minutes. This can be avoided by obtaining an API key, which will then give you access to unlimited requests. You can obtain access by contacting me at matt [at] grubb [dot] com
.
Errors
If anything error happens throughout the scraper, it will set the error at the following:
Which will return the following structure:
Also, the method you called will also return false
.
If there was no error, two things you will notice:
$scraper->error
is set tofalse
- The method you called will not return
false
Legal
This repo and it's contents are in no way affiliated with, authorized, maintained, sponsored or endorsed by TikTok or any of its affiliates or subsidiaries. This is an independent and unofficial package. Use at your own risk.