PHPackages                             idammi/tiktok-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. idammi/tiktok-api

ActiveLibrary[API Development](/categories/api)

idammi/tiktok-api
=================

TikTok API wrapper for PHP

v1.0.2(3y ago)15722[1 issues](https://github.com/idammi/tiktok-api/issues)MITPHPPHP &gt;=7.0

Since Jul 10Pushed 3y ago2 watchersCompare

[ Source](https://github.com/idammi/tiktok-api)[ Packagist](https://packagist.org/packages/idammi/tiktok-api)[ Docs](https://github.com/idammi/tiktok-api)[ RSS](/packages/idammi-tiktok-api/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

[![](https://github.com/idammi/tiktok-api/raw/main/assets/tiktok.png)](https://github.com/idammi/tiktok-api/blob/main/assets/tiktok.png)

TikTok Private API
==================

[](#tiktok-private-api)

This library gives access to exclusive TikTok API functions: login, like, follow, comment, getting user (profile, followers, following, videos), upload, getting videos from hashtag, searching for sounds, search for users.
Installation via Composer
=========================

[](#installation-via-composer)

`composer require idammi/tiktok-api`

Usage
-----

[](#usage)

```
/////////// API  //////////
$debug = false;
$accessKey = 'YOUR_ACCESS_KEY';
$proxy = 'http://user:pass@proxy:port';
///////////////////////////
$tiktok = new \TikTokAPI\TikTok($debug);
$tiktok->setAccessKey($accessKey);
$tiktok->setProxy($proxy);
```

Available methods
-----------------

[](#available-methods)

- `login` - Login user/resume logged in session `login($username, $password)`
- `getComments` - Get comments on a post `getComments($awemeId, $cursor)`
- `getUserFeed` - Get user posts `getUserFeed($secUserId, $cursor)`
- `getUserFollowers` - Get user followers `getUserFollowers($secUserId, $max_time)`
- `getUserFollowing` - Get user following `getUserFollowing($secUserId, $max_time)`
- `getChallenge` - Get challenge feed `getChallenge($ch_id, $cursor)`
- `getMusic` - Get Music feed `getMusic($music_id, $cursor)`
- `getUserInfo` - Get user info `getUserInfo($secUserId)`
- `search` - General search `search($keyword)`

Example Login Response
----------------------

[](#example-login-response)

```
{
    "data": {
        "app_id": 1233,
        "avatar_url": "",
        "connects": [],
        "country_code": 234,
        "device_id": 0,
        "email": "",
        "has_password": 1,
        "is_kids_mode": 0,
        "mobile": "+234****3724",
        "name": "user5180781450262",
        "screen_name": "user5180781450262",
        "sec_user_id": "MS4wLjABAAAAdsnqxZXSEeRzp4ppOc8Zndo14IaYeNxiABwTPfbGkxYCWr4OCzQF90JgJPC33jD6",
        "session_key": "7f6f103535941dc2054baa0446a5cf3a",
        "user_id": 7058506727294240000,
        "user_id_str": "7058506727294239749",
        "user_verified": false
    },
    "message": "success",
    "status": "ok",
    "timestamp": 1657486200
}
```

API Access Key Usage
--------------------

[](#api-access-key-usage)

You can use `Authorization: Bearer ` in the request header or use `?key=` in the request parameter.

Private API backend functionalities
-----------------------------------

[](#private-api-backend-functionalities)

- Device registration for registering `device_id`, `install_id` also known as `iid` and `did`.

    - Proper `trace-id` header generation.
    - Proper `X-Gorgon` and `X-Khronos` header generation.
    - Proper `TTEncrypt`ing of data (v05).
    - Proper `XLog`ing of registered device\_id (v02).
- Account Login

    - Complete device registration when logging in for the first time.
    - Account Login with username/password.
    - Automated captcha solver.

How does this work?
-------------------

[](#how-does-this-work)

Monthly subscription of my private API service is required for this to function.

Subscription service pricing
----------------------------

[](#subscription-service-pricing)

PackageCost(per month)Account LimitQuota (requests/day)Quota (requests/month)**Starter**50 USD15,000~150,000**Pro** *(popular)*100 USD512,000~360,000**Business**200 USD1025,000~720,000**Custom**custom pricing???- These quota counts on successful responses (with status code 200).

Terms and conditions
--------------------

[](#terms-and-conditions)

- You will NOT use this API for marketing purposes (spam, botting, harassment, massive bulk messaging...).
- We do NOT give support to anyone who wants to use this API to send spam or commit other crimes.
- We reserve the right to block any user of this repository that does not meet these conditions.

Legal
-----

[](#legal)

This code is 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 API. Use at your own risk.

Disclaimer
----------

[](#disclaimer)

TikTok is always updating their API endpoints but I will keep updating this library. I take no responsibility if your IP or your acccount gets banned using this API. It's recommended that you use proxy.

If you want, you can reach me on Telegram:

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Total

4

Last Release

1210d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/138eb208e3ae4be2fcd70d1cc3e883cb2a77ec1e1fc9d3260c6341a93260d497?d=identicon)[idammi](/maintainers/idammi)

---

Top Contributors

[![idammi](https://avatars.githubusercontent.com/u/13967457?v=4)](https://github.com/idammi "idammi (30 commits)")

---

Tags

phpphp-fpmREST APIPHP7php8PHP LibraryTikTok scrappertiktok apitiktok-scrapertiktokapitiktok-automationtiktok-downloadertiktok-signaturettencryptnowatermarkxgorgonxkhonosxtyhonxladon

### Embed Badge

![Health badge](/badges/idammi-tiktok-api/health.svg)

```
[![Health](https://phpackages.com/badges/idammi-tiktok-api/health.svg)](https://phpackages.com/packages/idammi-tiktok-api)
```

###  Alternatives

[ssovit/tiktok-api

Unofficial TikTok API for PHP

15035.9k](/packages/ssovit-tiktok-api)[maxbeckers/amazon-alexa-php

Php library for amazon echo (alexa) skill development.

11554.0k2](/packages/maxbeckers-amazon-alexa-php)[alexwestergaard/php-ga4

PHP Library for Google Analytics 4 with Server Side Tagging

63144.7k1](/packages/alexwestergaard-php-ga4)[jeffreyhyer/bamboohr

PHP SDK for the BambooHR API

1077.3k1](/packages/jeffreyhyer-bamboohr)[jeffreyhyer/alpaca-trade-api-php

PHP SDK for the Alpaca trade API

285.0k](/packages/jeffreyhyer-alpaca-trade-api-php)[jstolpe/tiktok-api-php-sdk

TikTok API PHP SDK

369.4k](/packages/jstolpe-tiktok-api-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
