以下為PHP語言調(diào)用去水印接口的示例,分別展示GET請求方式和POST請求方式的調(diào)用方式。示例代碼中用到的userId和secretKey請前往開發(fā)者接口管理中心獲取。
接口文檔:https://jx.henghengmao.com/page/apidoc
GET請求方式調(diào)用接口示例:
$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請求方式調(diào)用接口示例:
$api = "https://api.henghengmao.com/video"; //視頻提取接口
$userId = "C81E728D9DC2F636F06CC14862C"; //這里改成你自己的 userId
$secretKey = "eac9587cb785c2dd70cd07e116c"; //這里改成你自己的 secretKey
//參數(shù)
$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);
總結(jié)
到此這篇關(guān)于PHP語言對接抖音快手小紅書視頻/圖片去水印API接口源碼的文章就介紹到這了,更多相關(guān)PHP對接抖音快手小紅書視頻內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:- PHP封裝XML和JSON格式數(shù)據(jù)接口操作示例
- PHP調(diào)用全國天氣預(yù)報數(shù)據(jù)接口查詢天氣示例
- php的api數(shù)據(jù)接口書寫實例(推薦)
- PHP實現(xiàn)chrome表單請求數(shù)據(jù)轉(zhuǎn)換為接口使用的json數(shù)據(jù)
- PHP實現(xiàn)騰訊短網(wǎng)址生成api接口實例
- PHP接入支付寶接口失效流程詳解
- PHP預(yù)定義接口——Iterator用法示例
- php與阿里云短信接口接入操作案例分析
- PHP開發(fā)API接口簽名生成及驗證操作示例
- PHP接口類(interface)的定義、特點和應(yīng)用示例
- 微信小程序開發(fā)之獲取用戶手機號碼(php接口解密)
- PHP 對象接口簡單實現(xiàn)方法示例
- PHP開發(fā)api接口安全驗證操作實例詳解
- 如何用PHP編寫簡單的api數(shù)據(jù)接口