Basic API GetKeyword

Synopsis
public array GetKeyword( array $keywordentries )
Description

Returns the targeted master keyword of a domain name.

SOAP
This function can be called using SOAP.
Parameters
Type Parameter Mandatory Description
integer $partnerid yes Partner ID.
string $signkey yes Sign key.
string $username yes User name. (max. 25 characters)
string $password yes Password. (max. 16 characters)
array[] $keywordentry yes

Array of search parameter arrays. (max. 50 per request)

Search parameter array elements:

Type Parameter Mandatory Description
string $domain yes Domain name in ACE format.
string $market yes Targeted market for the keyword. See Sedo Keyword Markets .
Returns
Type Description
array

The return value contains the following elements:

Type Key Description
string domain Domain name in ACE format.
string keyword Keyword in UTF-8 encoding.
string market Targeted market for the keyword. See Sedo Keyword Markets .
integer advertiser Advertiser. deprecated
Version
1.0
<?php
try {
    // Create a new client by providing the endpoint to the constructor.
    $client = new SoapClient(
        null,
        [
            'location'     => 'https://api.sedo.com/api/v1/',
            'soap_version' => SOAP_1_1,
            'encoding'     => 'UTF-8',
            'uri'          => 'urn:SedoInterface',
            'style'        => SOAP_RPC,
            'use'          => SOAP_ENCODED,
        ]
    );

    // Set the values for the array
    $params = [
        'partnerid'    => 1234,
        'signkey'      => 'abcdefghijklmnopqrstuvwxyz0123456789',
        'username'     => 'johndoe',
        'password'     => 'secret',
        'keywordentry' => [
            [
                'domain'     => 'example.com',
                'market'     => 'eng',
            ],
            [
                'domain'     => 'example.com',
                'market'     => 'ger',
            ],
            [
                'domain'     => 'example.com',
                'market'     => 'fre',
            ],
        ]
    ];

    // Call the SOAP method
    $result = $client->GetKeyword($params);

    // Display the result
    echo "<table>";
    echo "<tr>";
    echo "<td>Domain</td>";
    echo "<td>Keyword</td>";
    echo "<td>Market</td>";
    echo "<td>Advertiser</td>";
    echo "</tr>";
    for ($i = 0; $i < count($result); $i++) {
        echo "<tr>";
        echo "<td>".$result[$i]['domain']."</td>";
        echo "<td>".$result[$i]['keyword']."</td>";
        echo "<td>".$result[$i]['market']."</td>";
        echo "<td>".$result[$i]['advertiser']."</td>";
        echo "</tr>";
    }
    echo "</table>";
} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}