pricing background

C++ API Integration

api

Live

#include <curl/curl.h>
#include <stdio.h>

int main() {
	CURL *curl = curl_easy_init();
	if(curl) {
		curl_easy_setopt(curl, CURLOPT_URL, "https://api.whoisfreaks.com/v2.0/dns/live?apiKey=API_KEY&domainName=whoisfreaks.com&ipAddress=8.8.8.8&type=all");
		curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
		curl_easy_perform(curl);
		curl_easy_cleanup(curl);
	}
	return 0;
}

Historical

#include <curl/curl.h>
#include <stdio.h>

int main() {
	CURL *curl = curl_easy_init();
	if(curl) {
		curl_easy_setopt(curl, CURLOPT_URL, "https://api.whoisfreaks.com/v2.0/dns/historical?apiKey=API_KEY&domainName=whoisfreaks.com&type=all&page=1");
		curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
		curl_easy_perform(curl);
		curl_easy_cleanup(curl);
	}
	return 0;
}

Reverse

#include <curl/curl.h>
#include <stdio.h>

int main() {
	CURL *curl = curl_easy_init();
	if(curl) {
		curl_easy_setopt(curl, CURLOPT_URL, "https://api.whoisfreaks.com/v2.1/dns/reverse?apiKey=API_KEY&format=json&value=8.8.8.8&type=a");
		curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
		curl_easy_perform(curl);
		curl_easy_cleanup(curl);
	}
	return 0;
}

Bulk DNS

#include <curl/curl.h>
#include <stdio.h>

int main() {
	CURL *curl = curl_easy_init();
	if(curl) {
		curl_easy_setopt(curl, CURLOPT_URL, "https://api.whoisfreaks.com/v2.0/dns/bulk/live?apiKey=API_KEY&type=all&format=json");
		curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
		struct curl_slist *headers = NULL;
		headers = curl_slist_append(headers, "Content-Type: application/json");
		curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
		curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{"domainNames": ["whoisfreaks.com","jfreaks.com"],"ipAddresses": ["1.1.1.1","8.8.8.8"]}");
		curl_easy_perform(curl);
		curl_easy_cleanup(curl);
	}
	return 0;
}