![]()
The Keyword Tracker Data API enables sharing your account data for integration into third party systems such as your own blogging software, ecommerce platform or your own bespoke web-site to name a few.
To start accessing your data, download our quickstart API library, follow the code samples and you'll be accessing your account data in no time.
<?php
require ('path/to/library');
// define API connection settings
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_SECRET_KEY';
// instantiate the API object
$kt_api = new KT_API ($api_key, $secret_key);
?>
Including our simple library into your project handles the url encryption required for API usage. By calling the additional methods below with the specified parameters you can access your account data directly.
<?php
// ... API object instantiation
$route = 'get_credits/'.$api_key;
$json = $kt_api->get_json ($route);
?>
<?php
// This call is typically used to find out
// if todays rankings are available.
// ... API object instantiation
$route = 'get_last_crawl_date/'.$api_key;
$json = $kt_api->get_json ($route);
?>
<?php
// ... API object instantiation
$route = 'get_keyword_list/'.$api_key;
$json = $kt_api->get_json ($route);
?>
<?php
// ... API object instantiation
$route = 'get_pagerank/'.$api_key;
$json = $kt_api->get_json ($route);
?>
<?php
// ... API object instantiation
$keyword = 'YOUR KEYWORD';
// colon seperated date range - max 7 days returnable
// pass FALSE to pull only latest ranking position
$date_range = '2011-09-06:2011-09-01';
$route = 'get_ranking/'.$api_key.'/'.urlencode($keyword).'/'.$date_range';
$json = $kt_api->get_json ($route);
?>