Hotel List Feed XML Syntax

This section describes the XML syntax for your Hotel List Feed. You upload this file to Google using the Hotel List Feed Upload Tool in the Hotel Ads Center.

Hotel List Feed syntax

The root element of a Hotel List Feed is the <listings> element. This element takes the following child elements:

  • <language>: The language in which your feed is written. Set the value of this element to a two-letter language code. For example, "en" for English.
  • <listing>: One or more entries that describe each hotel in the feed. Note that each hotel in the list must have an ID that is unique to your site, and that this ID should never be re-used.

The following table describes the child elements of the <listing> element:

Element Required? Description
<id> Required A unique identifier for the hotel.

<name> Required The name of the hotel. For example:

<name>Belgrave House</name>
<address> Required The full physical location of the hotel. At a minimum, you must provide the street address, city, state/region, and postal code for the hotel. Use <component> child elements to describe each of the following parts of the address:

  • addr1: The primary street address of the hotel.
  • addr2: The secondary street address, if necessary.
  • addr3: A third portion of the street address, if necessary.
  • city: The name of the hotel's city.
  • province: The name of the hotel's state, region, or province.
  • postal_code: The hotel's postal code.

For example:

<address format="simple">
  <component name="addr1">76 Trombones Road</component>
  <component name="addr2">Floor 5</component>
  <component name="city">Boston</component>
  <component name="province">MA</component>
  <component name="postal_code">02472</component>
</address>

Alternatively, you can provide a "freeform" address, although this is not recommended. For example:

<address>76 Trombones Road, Floor 5, Boston, MA, 02472</address>

Note that P.O. boxes or other mailing-only addresses are not considered full physical addresses.

<country> Required The country that this listing is located in. The value must be an ISO 3116 uppercase 2-letter country code. For example, United States is "US" and Canada is "CA". For example:

<country>US</country>
<latitude> Required* The latitude that corresponds to the location of the listing. For example:

<latitude>37.423738</latitude>

This value can be generated with GeoCoding tools like the Google Maps API.

<longitude> Required* The longitude that corresponds to the location of the listing. For example:

<longitude>-122.090101</longitude>

This value can be generated with GeoCoding tools like the Google Maps API.

<phone> Required* One or more contact numbers for the hotel. If the listing is business branch, please provide the phone number specific to branch location (not the phone number of central headquarters).

The type attribute can be one of the following:

  • main: Main voice telephone number.
  • tollfree: Toll free telephone number.
  • fax: Fax telephone number.
  • tdd: Telecommunications Device for the Deaf telephone number.
  • mobile: Mobile telephone number.

For example:

<phone type="main">123-456-7890</phone>
<phone type="fax">987-654-3210</phone>

At a minimum, you should provide a main type.

* Either a phone number OR latitude/longitude are required. Both are preferred.

Syntax Guidelines

When creating an XML Hotel List Feed, use the following guidelines:

  • Use UTF-8 encoding. Specify this encoding schema by including the encoding attribute in your XML tag, as shown in the sample XML.
  • You can specify data values in your feed with CDATA sections. If you use CDATA sections, do not escape special characters.
  • Use escape codes for data values that are not in CDATA sections, including URLs. You can use either the entity code or the character code to represent these special characters.

    The following table lists common entity and character codes you can use:

    Character Entity Character Code
    Ampersand (&) &amp; &#38;
    Single Quote (') &apos; &#39;
    Double Quote (") &quot; &#34;
    Greater Than (>) &gt; &#62;
    Less Than (<) &lt; &#60;
  • Omit XML elements that do not contain data. For example, if you do not have the latitude and longitude for a hotel, you should not include empty <latitude/> and <longitude/> elements.
  • Do not use HTML in your XML elements.
  • To validate your feed prior to uploading, you can use the local feed XSD "http://www.gstatic.com/localfeed/local_feed.xsd".
  • To use comments in your feed, wrap the comment in <!-- and --> tags, as the following example shows:

    <!-- This is a comment -->

Hotel List Feed examples

The following example shows a partial Hotel List Feed with a structured address:

<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
  <language>en</language>
  <listing>
    <!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
    <id>123abc</id>
    <name>Belgrave House</name>
    <address format="simple">
      <component name="addr1">76 Buckingham Palace Road</component>
      <component name="addr2">Floor 5</component>
      <component name="city">London</component>
      <component name="province">Greater London</component>
      <component name="postal_code">SW1W 9TQ</component>
    </address>
    <country>UK</country>
    <latitude>35.070374</latitude>
    <longitude>-106.213648</longitude>
    <phone type="main">123-456-7890</phone>
  </listing>
  ...
</listings>

Note that the value of <id> must be unique to your site for all time. Do not re-use IDs, as that might cause issues in the Manual Match Fix tool.

The following example shows a partial Hotel List Feed with a freeform address:

<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
  <language>en</language>
  <listing>
    <!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
    <id>123abc</id>
    <name>Belgrave House</name>
    <address>76 Trombones Road, Floor 5, Boston, MA, 02472</address>
    <country>US</country>
    <latitude>35.070374</latitude>
    <longitude>-106.213648</longitude>
    <phone type="main">123-456-7890</phone>
  </listing>
  ...
</listings>

Finding and fixing data issues

To find and fix data issues in your Hotel List Feed, you can use the following tools:

Hotel Ads Center:

APIs: