Laravel TikTok API
Scraper TikTok (tiktok.com) using this Laravel framework package (Laravel).
Requirement
- Laravel >= 7
- PHP >= 7.2.5
Install
Install package.
composer require daaner/tiktok
Add provider and facade in config/app.php
.
Daaner\TikTok\TikTokServiceProvider::class,
// ---
'TikTok' => Daaner\TikTok\Facades\TikTok::class,
Publish the config and localization files with the command:
php artisan vendor:publish --provider="Daaner\TikTok\TikTokServiceProvider"
Configuration
No special settings are needed. Queries also work with default settings. If you need finer settings, change the config file config/tiktok.php
after
If necessary, write the settings to a .env
.
Used
Use the model you want and get an array.
Model - UserInfo
-
getUser($userName)
- Get user data by name (full array) -
getUserInfo($userName)
- Get simple user data by name (only main and secondary array)
use Daaner\TikTok\Models\UserInfo;
$tt = new UserInfo;
$user = $tt->getUser('tiktok');
//or
$user = $tt->getUser('@tiktok');
// or for simple info
$user = $tt->getUserInfo('tiktok');
dd($user);
Model - TagInfo
-
getTag($tag)
- Get tag info -
getTagInfo($tag)
- Get tag simple info
use Daaner\TikTok\Models\TagInfo;
$tt = new TagInfo;
$tag = $tt->getTag('apple');
//or
$tag = $tt->getTag('#apple');
// or for simple
$tag = $tt->getTagInfo('apple');
dd($tag);
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.