One API - Many Operations

We have created only 1 API that can do all the jobs related to geo-location details.

This is the API URL: https://ranger-api.appit.cyou/api/v1.0.4/track?ip={IP_TO_CKECK}

 

GET Get Geo IP details by IP Address


  • Pass the IP address in the query parameter ip that you want to check.
  • The API Response contains the details of proxy detection too. If proxy is detected, the response will look something like this
  • If we are not able to determine one or more fields then the value of those fields will be "Unknown" in the API response
  • CORS is allowed to all the origins. No need to worry about `CORS issues` anymore.
https://ranger-api.appit.cyou/api/v1.0.4/track?ip={IP_TO_CKECK}
curl "https://ranger-api.appit.cyou/api/v1.0.4/track?ip=8.8.4.4" -X GET 
 {
	"ipAddress": "8.8.4.4",
	"ipVersion": "IPV4",
	"geoIpData": {
		"countryCode": "US",
		"countryName": "United States of America",
		"regionName": "California",
		"cityName": "Mountain View",
		"latitude": 37.405991,
		"longitude": -122.078514,
		"zipCode": "94043",
		"timeZone": "-08:00"
	},
	"proxyDetected": false
}

 

GET "What is my IP address" feature


  • Don't pass any value in the query parameter ip and the response will be for your (the caller's) IP details.
  • This is usefull if you want to track IP address of visitor from any Web Page.
  • CORS is allowed to all the origins. No need to worry about `CORS issues` anymore.
https://ranger-api.appit.cyou/api/v1.0.4/track
curl "https://ranger-api.appit.cyou/api/v1.0.4/track" -X GET 

 

GET Get Geo IP details of a domain


  • Pass a valid domain name in the query parameter ip and the response will be for the DNS resolved IP's Geo-Location details.
  • This is usefull if you want to check the origin of a domain/ip associated with.
  • Do not pass protocol/scheme of a web address eg. https://google.com will give error, whereas google.com will work.
  • CORS is allowed to all the origins. No need to worry about `CORS issues` anymore.
https://ranger-api.appit.cyou/api/v1.0.4/track?ip={VALID_DOMAIN_NAME}
curl "https://ranger-api.appit.cyou/api/v1.0.4/track?=google.com" -X GET 
{
	"ipAddress": "172.217.169.14",
	"ipVersion": "IPV4",
	"geoIpData": {
		"countryCode": "US",
		"countryName": "United States of America",
		"regionName": "California",
		"cityName": "Mountain View",
		"latitude": 37.405991,
		"longitude": -122.078514,
		"zipCode": "94043",
		"timeZone": "-08:00"
	},
	"proxyDetected": false
}

 

GET Example of 'Proxy detected' IP address


  • This is an example of FULL response.
  • If we could detect a proxy, the proxyDetected field will be true
  • If we could detect a proxy, we'll send the details of proxy in proxyDetails field.
https://ranger-api.appit.cyou/api/v1.0.4/track?ip={IP_TO_CHECK}
curl "https://ranger-api.appit.cyou/api/v1.0.4/track?=140.227.210.163" -X GET 
{
	"ipAddress": "140.227.210.163",
	"ipVersion": "IPV4",
	"geoIpData": {
		"countryCode": "JP",
		"countryName": "Japan",
		"regionName": "Tokyo",
		"cityName": "Tokyo",
		"latitude": 35.689507,
		"longitude": 139.691696,
		"zipCode": "105-0003",
		"timeZone": "+09:00"
	},
	"proxyDetected": true,
	"proxyDetails": {
		"typeOfProxy": "PUB",
		"domain": "suitepro.jp",
		"typeOfIsp": "DCH",
		"asId": "2514",
		"as": "NTT PC Communications Inc.",
		"threatType": "SPAM"
	}
}

 

ERROR Error format of the failed API response


  • The error format is very common, only the HTTP Status Code & reason will change based on the error cause.
{
  "errorMessage": "We're sorry that we are not able to process your request currently.",
  "errorCode": "ERROR_UNABLE_TO_PROCESS",
  "reason": "REFER_TABLE"
}
Reason HTTP Status Code
Cannot resolve domain. 400
Bad ip/domain supllied. 400
Invalid ip/domain name. If you think it's valid, please contact support team to fix it. 400
Any server specific errors. 500