Basic API DomainCategories

Synopsis
public array DomainCategories()
Description

To ensure that you use the correct categories when entering your domains, we offer all of our categories in an XML file.

XML
This function can be called using GET / POST requests.
Parameters
Type Parameter Mandatory Description
string language yes Language.
  • en - English
  • de - German
  • es - Spanish
  • fr - French
Version
1.0
<?php
/* URL to Sedo's API */
$baseUrl = 'https://api.sedo.com/api/v1/DomainCategories?';

/* API function parameters */
$params = [
    'output_method' => 'xml',
    'language'      => 'en',
];

/* 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 the following format.

The XML document has the following structure:

  • maincategory - Main Category
  • subcategory1 - First Sub Category
  • subcategory2 - Second Sub Category

Each category has its own ID and name which are provided in the id and name attributes. You only need to give the IDs in order to use the categories in combination with the Sedo API.

<?xml version="1.0" encoding="UTF-8"?>
<SEDODOMAINCATEGORIES ver="1.0">
    ⋮
    <maincategory id="104" name="Consumer Goods">
        <subcategory1 id="10" name="General" />
        <subcategory1 id="241" name="Antiques" />
        <subcategory1 id="252" name="Beverages" />
        <subcategory1 id="242" name="Books" />
        <subcategory1 id="253" name="Clothes" />
        <subcategory1 id="243" name="Electronics">
            <subcategory2 id="244" name="General" />
            <subcategory2 id="248" name="CDs" />
            <subcategory2 id="246" name="Cellular Phones" />
            <subcategory2 id="250" name="Computers" />
            <subcategory2 id="247" name="DVDs" />
            <subcategory2 id="295" name="Photo" />
            <subcategory2 id="294" name="Hifi" />
            <subcategory2 id="249" name="MP3" />
            <subcategory2 id="251" name="Television" />
        </subcategory1>
        <subcategory1 id="256" name="Food" />
        <subcategory1 id="254" name="Furniture" />
        <subcategory1 id="255" name="Jewelry" />
        <subcategory1 id="257" name="Wellness" />
    </maincategory>
    ⋮
</SEDODOMAINCATEGORIES>

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>