The following is an example of calling the watermark interface in PHP language, which shows the calling method of the GET request method and the POST request method respectively. For userId and secretKey used in the sample code, please go to the Developer Interface Management Center to obtain it.
Interface documentation:/page/apidoc
Example of GET request method calling interface:
$url = '/JjEFdHT/'; //Please change the userId and secretKey here to your own. This is the GET request method$api = '/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); //This is the key$data = curl_exec($curl); curl_close($curl); $arrdata = json_decode($data,true); //The return is jsonprint_r($arrdata);
Example of POST request method calling interface:
$api = "/video"; //Video Extraction Interface$userId = "C81E728D9DC2F636F06CC14862C"; //Change it to your own userId$secretKey = "eac9587cb785c2dd70cd07e116c"; //Change it to your own secretKey //parameter$url = "/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);
Summarize
This is the article about PHP language docking Douyin Kuaishou Xiaohongshu video/picture watermark API interface source code. For more related PHP docking Douyin Kuaishou Xiaohongshu video content, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!