Basic API DomainStatus

Synopsis
public array DomainStatus( array $list )
Description

Returns whether a domain is listed for sale on Sedo.

SOAP
This function can be called using SOAP.
XML
This function can be called using GET / POST requests.
Parameters
Type Parameter Mandatory Description
integer $partnerid yes Partner ID.
string $signkey yes Sign key.
string[] $domainlist yes Array of domain names in ACE format.
Returns
Type Description
array

The return value contains the following elements:

Type Key Description
string domain Domain name in ACE format.
string type Type of the listing. deprecated
  • D - Domain
  • W - Website
boolean forsale Whether the domain is listed for sale:
  • false - Not for sale
  • true - For sale
double price The domain price or 0 if no price has been set.
integer currency Currency of the $price parameter:
  • 0 - EUR
  • 1 - USD
  • 2 - GBP
integer visitors Visitors per month.
integer domainstatus Status of the domain:
  • 0 - Domain is not in Sedo's database.
  • 1 - Domain is in Sedo's database.
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',
        'domainlist' => ['example.com', 'example.net'],
    ];

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

    // Display the result
    for ($i = 0; $i < count($result); $i++) {
        echo "Domain: ".$result[$i]['domain']."<br>";
        echo "Forsale: ".($result[$i]['forsale'] == true ? "Yes" : "No")."<br>";
        echo "Type: ".$result[$i]['type']."<br>";
        echo "Price: ".$result[$i]['price']."<br>";
        echo "Currency: ".$result[$i]['currency']."<br>";
        echo "Visitors: ".$result[$i]['visitors']."<br>";
        echo "Status: ".$result[$i]['domainstatus']."<br>";
        echo "---------------<br>";
    }
} catch (SoapFault $e) {
    echo 'Error: '.$e->getMessage();
}
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/DomainStatus?';

/* API function parameters */
$params = [
    'partnerid'     => 1234,
    'signkey'       => 'abcdefghijklmnopqrstuvwxyz0123456789',
    'username'      => 'johndoe',
    'password'      => 'secret',
    'output_method' => 'xml',
    'domainlist'    => ['example.com', 'example.net'],
];

/* build request URL */
$request = $baseUrl . http_build_query($params);

/* fire API request */
$fp = @fopen($request, 'r');

/* read response line by line */
while (!@feof($fp)) {
    echo fread($fp, 4096);
}

/* close the connection */
fclose($fp);

For a successful request, you will receive an XML document as response in this format:

<?xml version="1.0" encoding="UTF-8"?>
<SEDOLIST xmlns="api.sedo.com/api/v1/?wsdl">
    <item type="tns:DomainStatusResponse[]">
        <domain type="xsd:string">example.com</domain>
        <type type="xsd:string">false</type>
        <forsale type="xsd:boolean">true</forsale>
        <price type="xsd:decimal">500</price>
        <currency type="xsd:string">EUR</currency>
        <visitors type="xsd:int">0</visitors>
        <domainstatus type="xsd:decimal">1</domainstatus>
    </item>
    <item type="tns:DomainStatusResponse[]">
        <domain type="xsd:string">example.net</domain>
        <type type="xsd:string">false</type>
        <forsale type="xsd:boolean">true</forsale>
        <price type="xsd:decimal">500</price>
        <currency type="xsd:string">EUR</currency>
        <visitors type="xsd:int">0</visitors>
        <domainstatus type="xsd:decimal">1</domainstatus>
    </item>
</SEDOLIST>

For an unsuccessful request, you will receive an XML document as response in this format:

<?xml version="1.0" encoding="UTF-8"?>
<SEDOFAULT ver="1.0">
    <faultcode type="xsd:string">Exxx</faultcode>
    <faultstring type="xsd:string">xxxxxx</faultstring>
</SEDOFAULT>
// Create package sedoapi:
// java org.apache.axis.wsdl.WSDL2Java -av -p sedoapi https://api.sedo.com/api/v1/?wsdl

import sedoapi.*;
import org.apache.axis.AxisFault;

public class SedoDomainStatus
{
    public static void main(String[] args) throws Exception
    {
        sedoapi.SedoInterfaceServiceLocator locator = new sedoapi.SedoInterfaceServiceLocator();
        sedoapi.SedoInterfacePortType port = locator.getSedoInterfacePort();

        try {
            String[] domains = {"example.com", "example.net"};

            DomainStatusRequest request = new DomainStatusRequest();

            request.setPartnerid(1234);
            request.setSignkey("abcdefghijklmnopqrstuvwxyz0123456789");
            request.setDomainlist(domains);

            DomainStatusResponse[] response = port.domainStatus(request);

            for (int i = 0; i < response.length; i++) {
                System.out.println("Domain: " + response[i].getDomain());
                System.out.println("Forsale: " + response[i].getForsale());
                System.out.println("Type: " + response[i].getType());
                System.out.println("Price: " + response[i].getPrice());
                System.out.println("Currency: " + response[i].getCurrency());
                System.out.println("Visitors: " + response[i].getVisitors());
                System.out.println("Status: " + response[i].getDomainstatus());
                System.out.println("---------------");
            }
        } catch (AxisFault fault) {
            System.err.println("Faultcode : " + fault.getFaultCode());
            System.err.println("Faultstring : " + fault.getFaultString());
        }
    }
}