Skip to content

Live data keywords for keywords

jovixv edited this page Nov 6, 2018 · 2 revisions

Keywords for Keywords - Live Data

Original docs can be found at https://docs.dataforseo.com/#keywords-for-keywords

Many APIs of DataForSEO are incorporating the variation of a single array in the payload, but in some cases, you may need adding several arrays to the payload with postID or without it. Examples of how to do that are described below.

Attention Each model holds a set of its own configurations. The $isSupportedMerge property applies to determine whether several arrays can be used in the payload of the particular model. If you try using several arrays where it's not possible, you'll receive an Exception or die.

Use case with a single array in the payload.

Method: get() - calls api and returns an object ResponseCollection

require_once '../../../../vendor/autoload.php';

use DFSClient\DFSClient;
use DFSClient\Models\KeywordsDataApi\Keywords_For_Keyword\KeywordsForKeywordLive;

$DFSClient = new DFSClient('login','password');
$model     = new KeywordsForKeywordLive();


$completed = $model->setOpt('keys',['dataforseo'])
    ->setOpt('language', 'en')
    ->setOpt('loc_name_canonical', 'United States')
    ->get();


if (!$completed->isSuccessful())
    dd($completed);

// you can call property as described below
echo 'status: '       .$completed->status        ."<br>";
echo 'task_id: '      .$completed->task_id       ."<br>";
echo 'results_time: ' .$completed->results_time  ."<br>";
echo 'results_count: '.$completed->results_count ."<br>";

foreach ($completed as $key=>$item){
    dump($item);
}

Getting Started

  1. Home
  2. Installation
  3. Configuration
  4. Base Usage
  5. Response Collection
  6. Abstract Model

DataForSEO APIs

Clone this wiki locally