Skip to content

Live data keywords for domain

jovixv edited this page Nov 6, 2018 · 2 revisions

Keywords for Domain - Live Data

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

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_Domain\KeywordsForDomainLive;

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

$domain      = 'dataforseo.com';
$lang        = 'en';
$countryCode = 'us';
$sortBy      = 'relevance';


$completed = $model->setExtraToRequestUrl($domain)
    ->setExtraToRequestUrl($countryCode)
    ->setExtraToRequestUrl($lang)
    ->setTimeOut(30)
    ->setExtraToRequestUrl($sortBy)
    ->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