Meet your demand and improve our service quality

We have the most professional technical team to provide you with consultation service 24/7, we can solve your problems easily and quickly

Instances of the DNSPod API calls

When calling API, the form of User-Agent must be ‘program’s English name / version (contact email)’ and forged browser is not allowed, otherwise the request may be denied by DNSPod fire wall.

More examples here:
Python
DNSPod DDNS Client source code in C# (not the latest, just for reference)

Example codes PHP + CURL (not the latest, just for reference)

The function for sending request:

function postData($url, $data) {
	$data	= http_build_query($data);
 
	$ch	= curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	// curl_setopt($ch, CURLOPT_HEADER, 1);
	// curl_setopt($ch, CURLOPT_VERBOSE, 1);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Name/Version');
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
 
	$response	= curl_exec($ch);
	curl_close($ch);
 
	return $response;
}

Add a new domain:

$data = array('login_email'		=> 'foo@bar.com',
			'login_password'	=> 'password',
			'format'			=> 'xml',
			'domain'			=> 'test.com');
 
echo postData("https://dnsapi.cn/Domain.Create", $data);

Fetch the record list of a domain:

$data = array('login_email'		=> 'foo@bar.com',
			'login_password'	=> 'password',
			'format'			=> 'xml',
			'domain_id'		=> '123456');
echo postData("https://dnsapi.cn/Record.List", $data);