API

Example of Usage

Making request

curl "http://demo.keitarotds.com/api.php?action=get_link\
&api_key=89185200811a6ebb7c16be09616f2f18\
&group=test\
&ip=217.212.230.137\
&keyword=money\
&langs=es\
&referer=http%3A%2F%2Fwww.google.com.my%2Fsearch%3Fq%3D%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dorg.mozilla%3Aen-US%3Aofficial%26client%3Dfirefox-a&charset=utf-8\
&ua=Mozilla%2F4.0+(compatible%3B+Mozilla%2F5.0+(Windows%3B+U%3B+Windows+NT+5.1%3B+en-US%3B+rv%3A1.7.13)+Gecko%2F20060414%3B+Windows+NT+5.1)"

Response

{
  "stream":{
    "id":"1098",
    "group_id":"11"
    "url": "http://google.com",
  },
  redirect: {
    "content": null, 
    "headers": [
        "LOCATION: http://google.com"
    ], 
    "type": "location"
  }
}

Answer format json.

Example on PHP

$apiKey = '2614374967c4ecce1cc1a406e3d78848';
$id = 'id';
$keyword = urlencode('KEYWORD');
$ua = urlencode($_SERVER['HTTP_USER_AGENT']);
$ip = urlencode($_SERVER['REMOTE_ADDR']);
$url = "http//domain.com/api.php?charset=utf-8&action=get&api_key=$apiKey&group=$id&ua=$ua&ip=$ip&keyword=$keyword";
$result = json_decode(file_get_contents($url));
if ($result->redirect) {
  foreach($result->redirect->headers as $header) {
    header($header);
  }
  if ($result->redirect->content) {
     echo $content;
  }
}

Parameters

  • action — use “get_link”
  • api_key — api key, take it on page Settings
  • dummy_mode — a request will be not save in statistics (optional)
  • group — a group alias or id
  • ip — a visitor's ip
  • ua — a visitor's user-agent (optional)
  • keyword — a keyword (optional)
  • referer — a referrer (optional)
  • lang — a visitor's language (optional)
  • se_referer — a referrer from search engine (optional)
  • source — where visitor come from (optional)
  • charset — charset of a keyword (optional)
  • debug — add debug information (optional)

Response Fields

  • stream — container with information about the current stream
  • stream.id — stream's id
  • stream.group_id — stream group's id
  • stream.url — a destination or html-code if it's banner
  • redirect — container with information about redirect or action
  • redirect.type — redirect/action type
  • redirect.headers — HTTP-headers
  • redirect.content — content that redirect-script generates
  • debug — debug information
  • execution_time