承接 restyler/tiktok-simple-scraper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

restyler/tiktok-simple-scraper

Composer 安装命令:

composer require restyler/tiktok-simple-scraper

包简介

Simple Guzzle TikTok scraper, using Rapid API.

README 文档

README

This library is a Guzzle-based wrapper around RapidAPI solution which scrapes Tiktok.

Get your access key here: https://rapidapi.com/restyler/api/tiktok12

See /examples folder for examples

Installation

composer require restyler/tiktok-simple-scraper

Quick example:

getUserInfo(): Get user info by username

use TiktokScraper\Client;

$tiktokClient = new Client([
        'rapidapi_key' => 'YOUR-RAPID-API_KEY'
    ]
);

$response = $tiktokClient->getUserInfo([
    'username' => 'realmadrid',
    // 'second-proxy' => '1',  - use fallback proxy in case you see weird errors like 404 for existing accounts. Every method supports this.
]);

print_r($response);
// response now contains array of user info.
/*
Array
(
    [secUid] => MS4wLjABAAAAdi4wJZtAiIre_rQ1KiFteDmtrGBDIyoleHRNsjL14-Enf8aVfkLUJ0l_LcJPZkiv
    [userId] => 6693776501107033094
    [isSecret] => 
    [uniqueId] => realmadrid
    [nickName] => Real Madrid C.F.
    [signature] => ⚽️ The official Real Madrid C.F. account
🏆 13 times European Champions
    [covers] => Array
        (
            [0] => https://p77-sign-sg.tiktokcdn.com/imgurl
            [1] => https://p77-sign-sg.tiktokcdn.com/imgurl2
        )

    [coversMedium] => Array
        (
            [0] => https://p77-sign-sg.tiktokcdn.com/imgurl3
            [1] => https://p77-sign-sg.tiktokcdn.com/imgurl4
        )

    [following] => 8
    [fans] => 3800000
    [heart] => 28900000
    [video] => 338
    [verified] => 1
    [digg] => 0
    [ftc] => 
    [relation] => -1
    [openFavorite] => 
) */

getUserFeed(): Get user feed by username

use TiktokScraper\Client;

$tiktokClient = new Client([
        'rapidapi_key' => 'YOUR-RAPID-API_KEY'
    ]
);

$response = $tiktokClient->getUserFeed([
    'username' => 'realmadrid',
    'limit' => '10'
]);

print_r($response);
// response now contains array of user feed items.

getVideoInfo(): Get video info by video url

use TiktokScraper\Client;
$tiktokClient = new Client([
        'rapidapi_key' => 'YOUR-RAPID-API_KEY'
    ]
);
$response = $tiktokClient->getVideoInfo([
    'url' => 'https://www.tiktok.com/@tuzelitydance/video/6867065857240026369?sender_device=pc&sender_web_id=6842368731214956037&is_from_webapp=1'
]);

print_r($response);
// response now contains video result.

getMusicInfo(): Get music info by video url

use TiktokScraper\Client;
$tiktokClient = new Client([
        'rapidapi_key' => 'YOUR-RAPID-API_KEY'
    ]
);
$response = $tiktokClient->getMusicInfo([
    'url' => 'https://www.tiktok.com/music/Bad-Liar-6613051741099280390?lang=en'
]);

print_r($response);
// response now contains music result.

Proxy Fallback

This RapidAPI API uses fastest proxy available for the moment. It is problematic to detect when Tiktok bans some ip address, so if you use the API heavily Tiktok may start throwing 404 responses for existing resources. This can be mitigated by using distributed proxy network via &second-proxy=1 query param (available for all library public methods). Distributed proxy network is typically slower but ipractically impossible to ban.

Examples, Error Handling

See full example file here.

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固