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/v1.0/whois?apiKey=API_KEY&whois=live&domainName=google.com");
		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/v1.0/whois?apiKey=API_KEY&whois=historical&domainName=google.com");
		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/v1.0/whois?apiKey=API_KEY&whois=reverse&keyword=youtube");
		curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
		curl_easy_perform(curl);
		curl_easy_cleanup(curl);
	}
	return 0;
}

Bulk Whois

#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/v1.0/bulkwhois?apiKey=API_KEY");
		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": ["amazon.ch","google.com","whoisfreaks.com","nic.dev","news.si"]}");
		curl_easy_perform(curl);
		curl_easy_cleanup(curl);
	}
	return 0;
}