PHP code example of boolxy / dataforseo

1. Go to this page and download the library: Download boolxy/dataforseo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

boolxy / dataforseo example snippets


use BoolXY\DataForSEO\Client;
use BoolXY\DataForSEO\DataForSEO;
use BoolXY\DataForSEO\Requests\KeywordsData\SearchVolumeForKeyword\LiveDataRequest;

$data = [
    [
        "language" => "en",
        "loc_name_canonical" => "United States",
        "key" => "average page rpm adsense",
    ],
    [
        "language" => "en",
        "loc_id" => 2840,
        "key" => "adsense blank ads how long",
    ],
    [
        "language" => "en",
        "loc_name_canonical" => "United States",
        "key" => "leads and prospects",
    ],
];

$client = new Client($base_uri, $user, $pass);

$result = DataForSEO::create($client)
    ->setRequest(LiveDataRequest::create($data))
    ->get();