PHP語言對接抖音快手小紅書視頻/圖片去水印API接口源碼
以下為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=C81E728D9DC2F636F06CC14862C&secretKey=eac9587cb785c2dd70cd07e116c&url=' . 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ù)接口
相關(guān)文章
PHP頁面跳轉(zhuǎn)實現(xiàn)延時跳轉(zhuǎn)的方法
下面小編就為大家?guī)硪黄狿HP頁面跳轉(zhuǎn)實現(xiàn)延時跳轉(zhuǎn)的方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-12-12Zend Framework教程之Zend_Db_Table表關(guān)聯(lián)實例詳解
這篇文章主要介紹了Zend Framework教程之Zend_Db_Table表關(guān)聯(lián)用法,結(jié)合實例形式較為詳細的分析了Zend_Db_Table表關(guān)聯(lián)的定義,實現(xiàn)方法與相關(guān)注意事項,需要的朋友可以參考下2016-03-03