Detect hosting providers programatically
Fetch our data with curl, guzzle or your favorite HTTP client.
https://www.who-hosts-this.com/APIEndpoint/Detect?key=YOUR-API-KEY&url=en.wikipedia.org
curl -G https://www.who-hosts-this.com/APIEndpoint/Detect \ --data-urlencode key="Your-api-key" \ --data-urlencode url="en.wikipedia.org"
The API query requires two parameters: the url you want to check and your api key.
Name | Description | Example Values |
---|---|---|
url | The url of the page to check. Required |
|
key | Your unique api key. Required | Get A Free API Key |
All API responses are JSON encoded and have the following format.
{ "request": "https://www.who-hosts-this.com/others/Who-Hosts-This/APIEndpoint/Detect?key=YOUR-API-KEY&url=en.wikipedia.org", "request_web": "https://www.who-hosts-this.com/?s=en.wikipedia.org", "result": { "code": 200, "msg": "Success: CMS or Host Found" }, "results": [ { "ip": "2620:0:861:ed1a::1", "type": "AAAA", "isp_id": "544", "isp_name": "Wikimedia Foundation Inc.", "isp_url": "https://localhost/others/Who-Hosts-This/544-Wikimedia-Foundation-Inc" }, { "ip": "198.35.26.96", "type": "A", "isp_id": "544", "isp_name": "Wikimedia Foundation Inc.", "isp_url": "https://localhost/others/Who-Hosts-This/544-Wikimedia-Foundation-Inc" } ] }
The who-hosts-this-php wrapper can help you easily integrate hosting provider detections into any PHP application. This package is open source and hosted on Github.
We recommended installing who-hosts-this-php through Composer.
curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version:
php composer.phar require whatcms/who-hosts-this-php
Once installed, you can use the WhoHostsThis class to fetch results:
require 'vendor/autoload.php'; $key = 'Your API Key'; $detector = new \WhoHostsThis\WhoHostsThis($key); $check_url = 'en.wikipedia.org'; $result = $detector->CheckUrl($check_url); print_r($result);
You can use the status endpoint for checking your account totals.
https://www.who-hosts-this.com/APIEndpoint/Detect?key=YOUR-API-KEY
{ "request": "https://whatcms.org/APIEndpoint/Status?key=YOUR-API-KEY", "result": { "code": 200, "msg": "Success", "period_start": 1520722943, "period_end": 1523401343, "period_quota": 10000, "period_requests": 406, "period_remaining": 9594 } }
As we open up our API to more and more usage, the rate limits will help make sure our system will remain stable and available to everyone.
Please note, some API queries will require us to fetch the requested url. If the server for the requested url is slow to respond, our results will also be delayed. We allow up to 20 seconds for responses to complete.
Code | Message |
---|---|
0 | Server Failure |
100 | API Key Not Set |
101 | Invalid API Key |
102 | Request not authenticated: %s |
110 | Url Parameter Not Set |
111 | Invalid Url |
112 | Missing required parameter: %s |
113 | Invalid value for required parameter: %s |
120 | Too Many Requests |
121 | You have exceeded your monthly request quota |
123 | Account disabled per violation of Terms and Conditions |
200 | Success |
201 | Failed: CMS or Host Not Found |
202 | Requested Url Was Unavailable |