以下為PHP語言調用去水印接口的示例,分別展示GET請求方式和POST請求方式的調用方式。示例代碼中用到的userId和secretKey請前往開發者接口管理中心獲取。
接口文檔:https://jx.henghengmao.com/page/apidoc
GET請求方式調用接口示例:
$url = 'https://v.douyin.com/JjEFdHT/';
//請把此處的userId和secretKey換成你自己的 這是GET請求方式
$api = 'https://api.henghengmao.com/video?userId=C81E728D9DC2F636F06CC14862CsecretKey=eac9587cb785c2dd70cd07e116curl=' . urlencode($url);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $api);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //這個是重點
$data = curl_exec($curl);
curl_close($curl);
$arrdata = json_decode($data,true); //返回的是json
print_r($arrdata);
POST請求方式調用接口示例:
$api = "https://api.henghengmao.com/video"; //視頻提取接口
$userId = "C81E728D9DC2F636F06CC14862C"; //這里改成你自己的 userId
$secretKey = "eac9587cb785c2dd70cd07e116c"; //這里改成你自己的 secretKey
//參數
$url = "https://vt.tiktok.com/rDHxU3/";
function file_get_contents_post($url, $post) {
$options = array(
"http"=> array(
"method"=>"POST",
"header" => "Content-type: application/x-www-form-urlencoded",
"content"=> http_build_query($post)
),
);
$result = file_get_contents($url,false, stream_context_create($options));
return $result;
}
$param = array("url" => $url, "userId" => $userId, "secretKey" => $secretKey);
$data = file_get_contents_post($api, $param);
var_dump($data);
總結
到此這篇關于PHP語言對接抖音快手小紅書視頻/圖片去水印API接口源碼的文章就介紹到這了,更多相關PHP對接抖音快手小紅書視頻內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:- PHP封裝XML和JSON格式數據接口操作示例
- PHP調用全國天氣預報數據接口查詢天氣示例
- php的api數據接口書寫實例(推薦)
- PHP實現chrome表單請求數據轉換為接口使用的json數據
- PHP實現騰訊短網址生成api接口實例
- PHP接入支付寶接口失效流程詳解
- PHP預定義接口——Iterator用法示例
- php與阿里云短信接口接入操作案例分析
- PHP開發API接口簽名生成及驗證操作示例
- PHP接口類(interface)的定義、特點和應用示例
- 微信小程序開發之獲取用戶手機號碼(php接口解密)
- PHP 對象接口簡單實現方法示例
- PHP開發api接口安全驗證操作實例詳解
- 如何用PHP編寫簡單的api數據接口