getRankingTrend

Returns the keyword and ranking trend of a domain.

Route /keywords/getRankingTrend[/:key[/:urlpattern[/:sengine[/:date[/:format[/:limit[/:skip]]]]]]]
Necessary parameter urlpattern
sengine
Optional parameter date
format

limit (max:1000)

skip
Return values date
keywords
rankings
Cross references getSearchEngines() – get all available search engines.
Hints sengine – Contains a search engine which is crawled by XOVI.
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
domain Contains a qualified domain name. (www.|*)?(A-Z|a-z|0-9)+. (a-z|*)+
sengine Contains a search engine which is crawled by XOVI. s. getSearchengines()
date Contains a date string. YYYY-MM-DD last crawldate
limit Defines the amount of the returned results. (max:1000) 0-1000 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

Return values

Labeling Description Values margin
date Shows the date the data got determined. Date: YYYY-MM-DD
keywords Contains the keywordsamount of a domain. (0-9)+
rankings Contains the rankings of a domain. (0-9)+

Messages

Message Description
maximum limit exeeded The maximum limit is reached.
no permission The key has no permission to access this function.
urlpattern not supported The URL pattern is not supported.
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'  =>'getRankingTrend',
                     'key'     =>'myPersonalKey',
                     'urlpattern'  =>urlencode(urlencode('*.zalando.de/*')),
                     'sengine' =>'google.de',
                     'date' => 'NULL',
                     'format'  => 'json',
			  );
$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":[
        {
            "date":"2013-02-11",
            "keywords":5995,
            "rankings":7000
        },
        {
            "date":"2013-02-18",
            "keywords":5995,
            "rankings":7000
        },
        {
            "date":"2013-02-25",
            "keywords":5995,
            "rankings":7000
        }]
}

XML

<?xml version="1.0"?>
<result>
    <apiErrorCode>0</apiErrorCode>
    <apiErrorMessage>0k.</apiErrorMessage>
    <apiResult>
        <rankingTrends>
            <rankingTrend>
                <date>2013-02-18</date>
                <keywords>97</keywords>
                <rankings>970</rankings>
            </rankingTrend>
            <rankingTrend>
                <date>2013-02-18</date>
                <keywords>97</keywords>
                <rankings>970</rankings>
            </rankingTrend>            
            <rankingTrend>
                <date>2013-02-18</date>
                <keywords>97</keywords>
                <rankings>970</rankings>
            </rankingTrend>        
        </rankingTrends>
    </apiResult>
</result>