Api
in package
TikTok Private API Wrapper
Table of Contents
Properties
- $api_base : string
- API Base
- $_config : array<string|int, mixed>
- Config
- $cacheEnabled : bool
- If Cache is enabled
- $cacheEngine : object
- Cache Engine
- $defaults : array<string|int, mixed>
- Default config
Methods
- __construct() : void
- Class Constructor
- getChallenge() : object|false
- Get Challenge detail
- getChallengeFeed() : object|false
- Get Challenge Feed
- getChallengeID() : string|false
- Get Challenge ID By Challenge name
- getComments() : object|false
- Get video comments
- getForYou() : object|false
- Trending Feed
- getMusic() : object|false
- Get Music detail
- getMusicFeed() : object|false
- Get music feed
- getUser() : object|false
- Get user detail by username
- getUserByID() : object|false
- Get User detail by ID
- getUserFeed() : object|false
- Get user feed
- getUserFollowers() : object|false
- Get User Followers
- getUserFollowings() : object|false
- Get User Followings
- getUserFromSearch() : object|false
- Get user detail from search by username as keyword
- getUserID() : string|false
- Get user id by username
- getVideoByID() : object|false
- Get video by video id
- getVideoByUrl() : object|false
- Get Video by TikTok URL
- searchChallenge() : object|false
- Search challenge by challenge name
- searchUser() : object|false
- Search User by username
- checkAPIKey() : void
- Check if api key is provided
- failure() : false
- Failure
- finalUrl() : string
- Get final redirect URL
- remote_call() : object|false
- Make remote call
Properties
$api_base
API Base
protected
string
$api_base
= "https://api-3.wppress.net"
$_config
Config
private
array<string|int, mixed>
$_config
= []
$cacheEnabled
If Cache is enabled
private
bool
$cacheEnabled
= false
$cacheEngine
Cache Engine
private
object
$cacheEngine
$defaults
Default config
private
array<string|int, mixed>
$defaults
= ["proxy" => null, "cache_timeout" => 3600, "transform_result" => false]
- proxy @link https://docs.guzzlephp.org/en/stable/request-options.html#proxy
- cache_timeout Cache Timeout
- transfrom_result If to transform result or not
Methods
__construct()
Class Constructor
public
__construct([array<string|int, mixed> $config = [] ][, object|false $cacheEngine = false ]) : void
Parameters
- $config : array<string|int, mixed> = []
-
API Config
- $cacheEngine : object|false = false
getChallenge()
Get Challenge detail
public
getChallenge(string $challenge_id) : object|false
Parameters
- $challenge_id : string
-
Challenge ID
Return values
object|false —Returns object or false on failure
getChallengeFeed()
Get Challenge Feed
public
getChallengeFeed(string $challenge_id[, int $cursor = 0 ]) : object|false
Parameters
- $challenge_id : string
-
Challenge ID
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
getChallengeID()
Get Challenge ID By Challenge name
public
getChallengeID(string $challenge_name) : string|false
Parameters
- $challenge_name : string
-
Challenge Name
Return values
string|false —Returns challenge ID or false on failure
getComments()
Get video comments
public
getComments(string $video_id[, int $cursor = 0 ]) : object|false
Parameters
- $video_id : string
-
Video ID
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
getForYou()
Trending Feed
public
getForYou([mixed $cursor = 0 ]) : object|false
Parameters
- $cursor : mixed = 0
Return values
object|false —Returns object or false on failure
getMusic()
Get Music detail
public
getMusic(string $music_id) : object|false
Parameters
- $music_id : string
-
Music ID
Return values
object|false —Returns object or false on failure
getMusicFeed()
Get music feed
public
getMusicFeed(string $music_id[, int $cursor = 0 ]) : object|false
Parameters
- $music_id : string
-
Music ID
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
getUser()
Get user detail by username
public
getUser(string $username) : object|false
Parameters
- $username : string
Return values
object|false —Returns object or false on failure
getUserByID()
Get User detail by ID
public
getUserByID(string $user_id) : object|false
Parameters
- $user_id : string
-
User ID
Return values
object|false —Returns object or false on failure
getUserFeed()
Get user feed
public
getUserFeed(string $user_id[, int $cursor = 0 ]) : object|false
Parameters
- $user_id : string
-
User ID
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
getUserFollowers()
Get User Followers
public
getUserFollowers(string $user_id[, int $cursor = 0 ]) : object|false
Parameters
- $user_id : string
-
User ID
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
getUserFollowings()
Get User Followings
public
getUserFollowings(string $user_id[, int $cursor = 0 ]) : object|false
Parameters
- $user_id : string
-
User ID
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
getUserFromSearch()
Get user detail from search by username as keyword
public
getUserFromSearch(string $username) : object|false
Parameters
- $username : string
Return values
object|false —Returns object or false on failure
getUserID()
Get user id by username
public
getUserID(string $username) : string|false
Parameters
- $username : string
-
Username
Return values
string|false —Returns user ID or false on failure
getVideoByID()
Get video by video id
public
getVideoByID(string $video_id) : object|false
Parameters
- $video_id : string
-
Video ID
Return values
object|false —Returns object or false on failure
getVideoByUrl()
Get Video by TikTok URL
public
getVideoByUrl(string $url) : object|false
Parameters
- $url : string
-
Video URL
Return values
object|false —Returns object or false on failure
searchChallenge()
Search challenge by challenge name
public
searchChallenge(string $keyword[, int $cursor = 0 ]) : object|false
Parameters
- $keyword : string
-
Search Keyword
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
searchUser()
Search User by username
public
searchUser(string $keyword[, int $cursor = 0 ]) : object|false
Parameters
- $keyword : string
-
Serch Keyword
- $cursor : int = 0
-
Offset Cursor
Return values
object|false —Returns object or false on failure
checkAPIKey()
Check if api key is provided
private
checkAPIKey() : void
failure()
Failure
private
failure() : false
Be a man and accept the failure.
Return values
false —Returns false
finalUrl()
Get final redirect URL
private
finalUrl(string $url) : string
Parameters
- $url : string
-
Video Post URL
Return values
string —Returns final redirect url
remote_call()
Make remote call
private
remote_call(string $path[, array<string|int, mixed> $params = [] ]) : object|false
Parameters
- $path : string
-
Remote path
- $params : array<string|int, mixed> = []
-
Parameters
Return values
object|false —Returns object or false on failure