Resources

Service URL:

To access our API you should use a following URL:

http://service-geoblocking.ovh/api

* this url uses Anycast to speedup and protect DNS entires and it is hosted on 13 different servers.

 

API Integration:

You should use GET method and in the url string you should pass over two parameters:

No. Parameter name Parameter type Description Example
1. ip string (48) Ip numer to verify. ip=212.12.145.10
2. token string (16) User token assigned to your account. This is your user token that identifies you. you can find your token in your user panel. Log in and than in a top menu select “User panel”. You will find a token on the top of a page. Copy this token and paste into your URL. token=a10fdfa25493a0b6

The method will return a text that can have 3 values: allowed, blocked, and error.
The first letter of returned text can be used to determined if ip is allowed.
If the first letter is ‘a’ that means that this ip is allowed.
Moreover, the text which is returned will also consists of a country code and information if this is a proxy server.

No. Returned value Description The first letter Example
1. allowed The ip is allowed. a allowed,us,non-proxy
2. blocked The ip is blocked. b blocked,ru,proxy
3. error There was an error. e error: autorization failed. You use a wrong token.

Examples:

EXAMPLE 1

http://service-geoblocking.ovh/api?ip=212.12.145.10&token=a10fdfa25493a0b6
gives:
blocked,tr,non-proxy
which means that this IP is blocked, traffic comes from Turkey, and this is not a proxy server.

 

EXAMPLE 2

http://service-geoblocking.ovh/api?ip=67.11.15.112&token=a10fdfa25493a0b6
gives:
allowed,us,non-proxy
which means that this IP is allowed, traffic comes from the US, and and this is not a proxy server.

 

EXAMPLE 3

http://service-geoblocking.ovh/api?ip=119.76.45.19&token=a10fdfa25493a0b6
gives:
blocked,th,non-proxy
which means that this IP is blocked, traffic comes from Thailand, and this is a proxy server.

 

Code samples:

Code example in PHP:

<?php
$ip = "212.12.145.10";
$token = "a10fdfa25493a0b6";
$url = "http://service-geoblocking.ovh/api?ip=" + ip + "&token=" + $token;
$file = fopen( $url, "r" ) or die( "Unable to open: " + $url );
$result = fread ( $file, 100 );
fclose( $myfile );
echo $result;
if( $result[0] != "a" ) {
     exit( "this ip is not allowed!" );
}

// TODO: ip is allowed you can process
?>