Hello, please explain me how use paging. Im try to get keywrods idea more than 700 items. I know what on onbe api call i get a 700 keywords, but i must get more.
i try to set a startindwex in 700,800 and other, but answer is null.
this is part of my code
$selector->setSearchParameters($searchParameters);
$selector->setPaging(new Paging(699, 700));
$page = $targetingIdeaService->get($selector);
$entries = $page->getEntries();
if ($entries !== null) {
$totalNumEntries += $page->getTotalNumEntries();
foreach ($entries as $targetingIdea) {
$data = MapEntries::toAssociativeArray($targetingIdea->getData());
$keyword = $data[AttributeType::KEYWORD_TEXT]->getValue();
$searchVolume =
($data[AttributeType::SEARCH_VOLUME]->getValue() !== null)
? $data[AttributeType::SEARCH_VOLUME]->getValue() : 0;
$averageCpc = $data[AttributeType::AVERAGE_CPC]->getValue();
$competition = $data[AttributeType::COMPETITION]->getValue();
$monthly = $data[AttributeType::TARGETED_MONTHLY_SEARCHES]->getValue();
if(!empty($monthly) && is_array($monthly)) {
$keyword_stats = array();
foreach ($monthly as $month_stats) {
$stats = new stdClass();
$stats->year = $month_stats->getYear();
$stats->month = $month_stats->getMonth();
$stats->count = $month_stats->getCount();
$keyword_stats[] = $stats;
}
}
$keyword_obj = new \stdClass();
$keyword_obj->keyword = $keyword;
$keyword_obj->search_volume = $searchVolume;
$keyword_obj->average_CPC = ($averageCpc === null) ? 0 : number_format($averageCpc->getMicroAmount()/1000000,'2');
$keyword_obj->competition = number_format($competition,'3');
$keyword_obj->year_stats = $keyword_stats;
$result_keyword['keywords'][] = $keyword_obj;
unset($keyword_obj);
}
$result_keyword['count_data'] += $totalNumEntries;
}
Please, explain the algoritm of get more keywords items.
Thanks.