getKeywordRankings
Returns all URLs for a single keyword from the SERPs (Search Engine Result Pages).
| Route | /keywords/getKeywordRankings[/:key[/:keyword[/:sengine[/:format[/:limit[/:skip[/:date]]]]]]] |
|---|---|
| Necessary parameter | keyword sengine |
| Optional parameter | format limit (max:1000) skip date |
| Return value | url position |
| Cross reference | getSearchEngines() – getting all searchengines. |
| Hint | Limit: The maximum limit is 1000. To get more results, please use the parameter skip. |
Parameter
| Labeling | Description | Values margin | Default value |
|---|---|---|---|
| keyword | Contains a particular keyword. | (A-Z|a-z|0-9)+ | – |
| sengine | Contains a search engine which is crawled by XOVI. | google.de|google.at|google.ch| bing.de |
– |
| date | Contains a concrete date in ISO8601 format. | Date: YYYY-MM-DD | date from the week before |
| limit | Defines the amount of the returned results.(max:1000) | 0-1000 | 10 |
| 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 |
|---|---|---|
| url | Shows the best ranking url. | http[s]?://(www.)?(A-Z|a-z|0-9)+.(a-z)+ |
| position | Contains the best position of a keyword in a certain period of time. | (0-9)+ |
Messages
| Message | Description |
|---|---|
| maximum limit exeeded | The maximum limit is reached. |
| no permission | The key has no access to this function. |
| 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
$arrayParams= array(
'service' => 'keywords',
'method' =>'getKeywordRankings',
'key' =>'yourPersonalKey',
'keyword' =>'seo',
'sengine' => 'google.de',
'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":[
{
"url":"http:\/\/de.wikipedia.org\/wiki\/Suchmaschinenoptimierung",
"position":"1"
},
{
"url":"http:\/\/de.wikipedia.org\/wiki\/Seo",
"position":"2"
},
{
"url":"http:\/\/www.seo-united.de\/",
"position":"3"
},
{
"url":"http:\/\/suchmaschinenoptimierung.michaelsattler.de\/",
"position":"4"
},
{
"url":"http:\/\/seo.de\/",
"position":"5"
}]
}
XML
<?xml version="1.0"?>
<result>
<apiErrorCode>0</apiErrorCode>
<apiErrorMessage>0k.</apiErrorMessage>
<apiResult>
<keywordrankings>
<keywordranking>
<url>http://de.wikipedia.org/wiki/Suchmaschinenoptimierung</url>
<position>1</position>
</keywordranking>
<keywordranking>
<url>http://de.wikipedia.org/wiki/Seo</url>
<position>2</position>
</keywordranking>
<keywordranking>
<url>http://www.seo-united.de/</url>
<position>3</position>
</keywordranking>
<keywordranking>
<url>http://suchmaschinenoptimierung.michaelsattler.de/</url>
<position>4</position>
</keywordranking>
<keywordranking>
<url>http://seo.de/</url>
<position>5</position>
</keywordranking>
</keywordrankings>
</apiResult>
</result>
