getKeywordRankings
Returns the Top 100 serchresults to installed keyword.
| Route | /monitor/getKeywordRankings[/:key[/:keyword[/:sengineid[/:format[/:limit[/:skip[/:date]]]]]]] |
|---|---|
| Necessary parameter | keyword sengineid |
| Optional parameter | format limit (max:1000) skip date |
| Return value | position domain page url usearch |
| Cross reference | getSearchEngines() getDailyKeywords() |
| Hint | Set the parameter interval to the value ‚daily‘ in the function getSearchEngines() to get the daily scanned searchengines. 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 search engine id which is scanned by XOVI. | (0-9)+ | – |
| keyword | Contains a particular keyword. | (A-Z|a-z|0-9)+ | – |
| date | Contains a concrete date in ISO8601 format. | Date: YYYY-MM-DD | date from the day before |
| limit | Defines the amount of the returned results.(max:1000) | (0-9)+ | – |
| skip | Defines the starting row of the result. | (0-9)+ | 0 |
| format | Defines in which format the result will be returned. | json|xml | json |
Return values
| Labeling | Description | Values margin |
|---|---|---|
| position | Contains the position of the keyword at the scanning time. | (0-9)+ |
| domain | Contains the domain on which the searchresult is pointing. | (www.)?(A-Z|a-z|0-9)+.(a-z)+ |
| page | Contains the page on which the searchresult was found on the searchengine. | (0-9)+ |
| url | Contains the URL on which the searchresult is pointing. | http[s]?://(www.)?(A-Z|a-z|0-9)+.(a-z)+ |
| usearch | Contains the universal search type. | apps | authors | events | music | people | products | recipes | reviews | news | maps | images | video | other |
Messages
| Message | Description |
|---|---|
| no permission | The key has no permission to access this function. |
| 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' =>'getDailyKeywordRankings',
'key' =>'yourPersonalKey',
'keyword' => 's.e.o',
'sengineid' => 1,
'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>
<dailykeywordrankings>
<dailykeywordranking>
<position>1</position>
<domain>de.wikipedia.org</domain>
<page>1</page>
<url>de.wikipedia.org/wiki/Suchmaschinenoptimierung</url>
<usearch></usearch>
</dailykeywordranking>
<dailykeywordranking>
<position>2</position>
<domain></domain>
<page>1</page>
<url>de.wikipedia.org/wiki/Seo</url>
<usearch></usearch>
</dailykeywordranking>
</dailykeywordrankings>
</apiResult>
</result>
