getKeywordTrend

Returns the daily ranking trend of a keyword for a domain.

Route /monitor/getKeywordTrend[/:key[/:sengineid[/:domain[/:keyword[/:format[/:limit[/:skip[/:ignoreUSearch]]]]]]]]
Necessary parameter sengineId
domain
keyword
Optional parameter format
limit (max:1000)

skip
ignoreUSearch
Return values crawlDate
crawlTime
position
positionChange
url
universalSearch
Cross references getSearchEngines() – Get the sengineId by using this function
getDailyKeywords() – shows all keywords, which are added to the daily monitoring
Hints Limit: The maximum limit is 1000. To get more results, please use the parameter skip.
resultCount: Shows the amount of the result without limits. Usefull for pagination.

Parameter

Labeling Description Values margin Default value
sengineId Contains a unique identifier for the returned search engine. (0-9)+
domain Contains a qualified domain name. (www.)?(A-Z|a-z|0-9)+.(a-z)+
keyword Contains a particular keyword. (A-Z|a-z|0-9)+
limit Defines the amount of the returned results.(max:1000) (0-9)+ 1
skip Defines the starting page of the result. One page equals the the value of limit. (0-9)+ 0
format Defines in which format the result will be returned. json|xml json
ignoreUSearch Defines whether universal search should be considered in the result set or not. -1: All keywords
1: Only where unisersal search is ignored
2: Only where universal search is considered
-1

Return values

Labeling Description Values margin
crawlDate Contains the date on which the ranking was determined. Date: YYYY-MM-DD
crawlTime Contains the time a ranking was determined. Time: HH:II:SS
position Contains the best position of a keyword in a certain period of time. (0-9)+
positionChange Shows the change of position compared to the last position tracking. (0-9)+
url Shows the best ranking url. http[s]?://(www.)?(A-Z|a-z|0-9)+.(a-z)+
universalSearch Contains the universal search type. apps | authors | events | music | people | products | recipes | reviews | news | maps | images | video | other

Messages

Message Description
maximum limit exeeded The maximum limit is reached.
internal error An internal error occured.
param missing A required parameter is missing.
param invalid The value of a parameter is not valid.
result empty The request was successful, but the result itself is empty.
cost error The current credit amount is not sufficient to handle the request.
0k. The processing was successful.

Exemplary code

$root = 'https://suite.xovi.net/api/';
$arrayParams = array(
	'service'	=> 'keywords',
	'method'	=> 'getDailyKeywordTrend',
        'key'		=> 'myPersonalKey',
	'sengineId'	=> 1,
	'domain'	=> 'www.xovi.de',
	'keyword'	=> 'seo',
	'format'	=> 'xml',
 );
$GETparams = implode('/', $arrayParams);

$requestURL = $root.$GETparams;

if (!function_exists('curl_init')) die('cURL not available');

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_URL, $requestURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Download the given URL, and return output
$output = curl_exec($ch);

// Close the cURL resource, and free system resources
curl_close($ch);

echo $output;
?>

Exemplary results

JSON

{
	"apiErrorCode":0,
	"apiErrorMessage":"0k.",
	"apiResult":[
		{
			"crawlDate":"2013-03-13",
			"crawlTime":"13:34:17",
			"position":"7.00",
			"positionChange":"-1.00",
			"url":"http:\/\/www.xovi.de\/",
			"universalSearch":""
		}
	]
}

XML

<?xml version="1.0"?>
    <result>
        	<apiErrorCode>0</apiErrorCode>
        	<apiErrorMessage>0k.</apiErrorMessage>
        	<apiResult>
            		<dailykeywords>
                		<dailykeyword>
				        <crawlDate>2013-03-13</crawlDate>
                    			<crawlTime>13:34:17</crawlTime>
                    			<position>7.00</position>
				        <positionChange>-1.00</positionChange>
                    			<url>http://www.xovi.de/</url>
				        <universalSearch></universalSearch>
               			</dailykeyword>
            		</dailykeywords>
	         </apiResult>
    </result>