Install eBesucher API

The eBesucher API allows you to read out the earnings statistics of the surfbar and the click campaigns, without having to log into the members area. Advertisers can also retrieve statistics on advertising campaigns

You can use the eBesucher API with a programming language of your choice. Below you will find an example code in PHP. The following manual also tell you more about the different features of the API.

Requirements

  • PHP 5.4.0
  • To use the PHP stream handler, allow_url_fopen must be enabled in your system’s php.ini.
  • To use the cURL handler, you must have a recent version of cURL >= 7.16.2 compiled with OpenSSL and zlib.
  • Important: In order to use the API features, you need to generate an API key in the eBesucher members area, go to: Username (see top right) > API.

Installation

The recommended way to install Guzzle is with Composer. Composer is a dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project.

Install Composer

curl -sS https://getcomposer.org/installer | php

You can add Guzzle as a dependency using the composer.phar CLI:

php composer.phar require guzzlehttp/guzzle:~5.0

After installing, you need to require Composer’s autoloader:

require 'vendor/autoload.php';

Quickstart (Creating a Client)

chdir(dirname(__DIR__));

require_once 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client(array('base_url' => 'https://www.ebesucher.de/api/'));

$option = array('auth' => array('YOUR_LOGIN', 'YOUR_API_KEY'));

Responses (JSON) + Query String

Authorization is not required

IP

IPv4-Addresse erhalten IP4 wird zurückgesendet

print_r($client->get('ip.json/address')->json());

Response

10.0.0.1

Get information about the requesting ip address

This method will return an array containing information about the ip address that originated the request. The data will contain: ip address, hostname, country code of the country in which the ip address is supposed to be located, and the full name of the country.

print_r($client->get('ip.json/data')->json());

Response:

Array

(
    [ip] => 10.0.0.1
    [host] => 10-0-0-1.hostname.de
    [countryCode] => DE
    [countryName] => Deutschland
)

Authorization required

Account

Create a report

Create a report of earnings statistics for any given time interval, containing the number of earned points for each surflink. The created report will be computed asynchronously. The results should be requested with a delay of 5-10 minutes.

eBesucher API

$option['query'] = array('from' => '141100000', 'to' => '142200000');
try { print_r($client->post('visitor_exchange.json/account/surflink_earnings_report', $option)->json())."\n"; } catch (Exception $e){ echo $e->getMessage()."\n"; }

Response:

814

Download a previously requested earnings report.

Note: the report will not be permanently stored. It can be deleted automatically from the server 12 hours after the computation is completed..

$reportId = 814;
try { print_r($client->get("visitor_exchange.json/account/surflink_earnings_report/".$reportId,
$option)->json());} catch (Exception $e){ echo $e->getMessage(); }

Response:

Array
(
    [0] => Array
        (
            [surflinkID] => 288987
            [value] => 4484.900000
        )

    [1] => Array
        (
            [surflinkID] => 289092
            [value] => 7343.790000
        )
    ...
)

Request the current status of an earnings report.

$reportId = 814;
try { print_r($client->get("visitor_exchange.json/account/surflink_earnings_report/".$reportId."/status",
$option)->json()); } catch (Exception $e){ echo $e->getMessage(); }

Response:

Array 

(

    [id] => 814
    [userID] => 714619
    [from] => 1424690754
    [to] => 1424777156
    [progress] => 100
    [type] => visit_earnings
    [isFinished] => 1
    [from_w3c] => 2015-02-23T11:25:54+00:00
    [to_w3c] => 2015-02-24T11:25:56+00:00

)

Delete a previously requested earnings report.

 $reportId = 814;
 try { print_r($client->delete("visitor_exchange.json/account/surflink_earnings_report/".$reportId,
 $option)->json());} catch (Exception $e){ echo $e->getMessage(); }

Response:

1

Get earnings statistics for the whole account

Will return an array of time periods with the corresponding number of earned credits.

$date = array('from'=> 1415743232,'to'=> 1416520832);
print_r($client->get("visitor_exchange.json/account/earnings/".$date['from']."-".$date['to'],
$option)->json());

Response:

Array
(
    [0] => Array
        (
            [from] => 1424689202
            [from_w3c] => 2015-02-23T11:00:02+00:00
            [to] => 1424692799
            [to_w3c] => 2015-02-23T11:59:59+00:00
            [value] => 1987.200000
        )

    [1] => Array
        (
            [from] => 1424692801
            [from_w3c] => 2015-02-23T12:00:01+00:00
            [to] => 1424696399
            [to_w3c] => 2015-02-23T12:59:59+00:00
            [value] => 1384.000000
        )
    ...

)

Get the hourly earnings statistics

Statistics for the whole account (sum of all surflinks) for the given date. Will return an array of hours indexed from 1 to 24 with the corresponding number of earned credits..

$date="2015-02-19";
$option['query'] = array('timezone' => 'Europe/Berlin');
print_r($client->get("visitor_exchange.json/account/earnings_hourly/".$date,
$option)->json());

Response:

Array
(
    [1] => 3009.6
    [2] => 2753.6
    ...
)

Surflink

Get the used Surflinks activeSince : (optional) get only links that have been active since the given moment in time, that is specified in unix time format.

$option['query'] = array('activeSince' => 1424690754);
print_r($client->get("visitor_exchange.json/surflinks", $option)->json());

Response:

Array
(
    [0] => Array
        (
            [id] => 347876
            [fullName] => YOUR_LOGIN.surflink1
            [url] => http://www.ebesucher.de/surfbar/YOUR_LOGIN.surflink1
            [lastActivity] => 2015-02-24 11:59:17
        )

    [1] => Array
        (
            [id] => 347764
            [fullName] => YOUR_LOGIN.surflink2
            [url] => http://www.ebesucher.de/surfbar/YOUR_LOGIN.surflink2
            [lastActivity] => 2015-02-24 11:51:54
        )
    ...
)

Get the earnings statistics for a specific surflink Will return an array of time periods with the corresponding number of earned credits.

$data = array('surflinkName'=>'YOUR_LOGIN.surflink1','from'=>1424604354,'to'=>1424690754);
try { print_r($client->get("visitor_exchange.json/surflink/"
.$data['surflinkName']."/earnings/".$data['from']."-".$data['to'],
$option)->json()); } catch (Exception $e){ echo $e->getMessage();}

Response:

Array
(
    [0] => Array
        (
            [from] => 1424602861
            [from_w3c] => 2015-02-22T11:01:01+00:00
            [to] => 1424606399
            [to_w3c] => 2015-02-22T11:59:59+00:00
            [value] => 362.140000
        )

    [1] => Array
        (
            [from] => 1424606549
            [from_w3c] => 2015-02-22T12:02:29+00:00
            [to] => 1424609999
            [to_w3c] => 2015-02-22T12:59:59+00:00
            [value] => 240.800000
        )
    ...
)

Get the hourly earnings statistics

Get the hourly earnings statistics for a specific surflink and a given date. Will return an array of hours indexed from 1 to 24 with the corresponding number of earned points.

$data=array('surflinkName'=>'YOUR_LOGIN.test','date'=>'2015-02-22');
$option['query'] = array('timezone' => 'Europe/Berlin');
try {print_r($client->get("visitor_exchange.json/surflink/"
.$data['surflinkName']."/earnings_hourly/".$data['date'],
$option)->json());} catch (Exception $e){ echo $e->getMessage(); }

Response:

Array
(
    [1] => 334.4
    [2] => 347.2
    [3] => 224
    [4] => 356.8
    [5] => 358.4
    ...
)

Share the settings of a surflink

Allow the user to access the settings and statistics regarding the websites that he chooses to visit or has visited through his surflink. You can limit the validity of a surflink and determine until when it should no longer be able to modify the surflink settings.

Share the settings of a surflink through the API

FAQ

How many API requests do I get?

The number of API requests is calculated for each hour and depends on the status of the account. You can find the infos on the Premium form.

How do I know how many API requests I have left?

The remaining requests as well as the limit if total requests is displayed during each API request (see the response headers on the API explorer).

[..]
—> X-RateLimit-Remaining: 999
X-Auth-Status: true
Content-Language: en-US
Cache-Control: no-cache, must-revalidate
Transfer-Encoding: chunked
-> X-RateLimit-Limit: 1000 per hour
[..]

FAQ for Users

Traffic exchange

Mail exchange

Click campaigns

Refer a friend

Violation of our rules

eBesucher API

More