Search Locations

http://api.eventfinda.co.nz/v2/locations.xml

Searches the database and returns locations and venues matching the given criteria.

Locations are in a tree structure which you can explore on the Find Events page.

You can also explore the location tree using the API which is explained in more detail in the exploring the location tree section below.

Example Request

http://api.eventfinda.co.nz/v2/locations.xml?rows=2&offset=3&q=bar&venue=on

Example Response

<?xml version="1.0"?>
<locations count="1662">
 <location>
  <id>2238</id>
  <name>The Fringe Bar</name>
  <summary>The Fringe Bar, Wellington</summary>
  <url_slug>the-fringe-bar-wellington</url_slug>
  <is_venue>1</is_venue>
  <count_current_events>20</count_current_events>
  <url>https://www.eventfinda.co.nz/venue/the-fringe-bar-wellington</url>
  <description>This venue offers a range of perfor ... events we have happening this week </description>
  <images count="1">
   <image>
    <id>112868</id>
    <is_primary>1</is_primary>
    <transforms count="3">
     <transform>
      <transformation_id>2</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... tions/transformed/112868-2238-2.jpg</url>
      <width>78</width>
      <height>80</height>
     </transform>
     <transform>
      <transformation_id>15</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... ions/transformed/112868-2238-15.jpg</url>
      <width>75</width>
      <height>75</height>
     </transform>
     <transform>
      <transformation_id>8</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... tions/transformed/112868-2238-8.jpg</url>
      <width>190</width>
      <height>127</height>
     </transform>
    </transforms>
   </image>
  </images>
  <address>26 Allen Street, Wellington</address>
  <point>
   <lat>-41.2933</lat>
   <lng>174.7821</lng>
  </point>
  <booking_web_site>
   <url/>
   <name>Buy Tickets</name>
  </booking_web_site>
  <booking_phone/>
  <is_free>0</is_free>
  <is_featured>0</is_featured>
  <restrictions>R18</restrictions>
  <ticket_types count="0"/>
  <contacts count="1">
   <contact>
    <name>Phone</name>
    <value><![CDATA[(04) 801 5007]]></value>
   </contact>
  </contacts>
  <amenities count="3">
   <amenity>
    <name>Wheelchair Access</name>
   </amenity>
   <amenity>
    <name>Toilets</name>
   </amenity>
   <amenity>
    <name>Food Available</name>
   </amenity>
  </amenities>
  <hours count="0"/>
  <web_sites count="1">
   <web_site>
    <url>http://thefringebar.co.nz/</url>
    <name>thefringebar.co.nz</name>
   </web_site>
  </web_sites>
 </location>
 <location>
  <id>7103</id>
  <name>Wairau Bar</name>
  <summary>Wairau Bar, Blenheim, Marlborough</summary>
  <url_slug>wairau-bar-blenheim</url_slug>
  <is_venue>1</is_venue>
  <count_current_events>0</count_current_events>
  <url>https://www.eventfinda.co.nz/venue/wairau-bar-blenheim</url>
  <description><![CDATA[The Wairau Bar is argua ... .flickr.com/photos/flissphil/]]></description>
  <images count="1">
   <image>
    <id>172918</id>
    <is_primary>1</is_primary>
    <transforms count="4">
     <transform>
      <transformation_id>2</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... tions/transformed/172918-7103-2.jpg</url>
      <width>80</width>
      <height>53</height>
     </transform>
     <transform>
      <transformation_id>15</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... ions/transformed/172918-7103-15.jpg</url>
      <width>75</width>
      <height>75</height>
     </transform>
     <transform>
      <transformation_id>8</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... tions/transformed/172918-7103-8.jpg</url>
      <width>190</width>
      <height>127</height>
     </transform>
     <transform>
      <transformation_id>7</transformation_id>
      <url>http://cdn.eventfinda.co.nz/uploads ... s/transformed/172918-7103-7.jpg?v=2</url>
      <width>650</width>
      <height>280</height>
     </transform>
    </transforms>
   </image>
  </images>
  <address>Wairau Bar Rd, Blenheim</address>
  <point>
   <lat>-41.5017</lat>
   <lng>174.0561</lng>
  </point>
  <booking_web_site>
   <url/>
   <name>Buy Tickets</name>
  </booking_web_site>
  <booking_phone/>
  <is_free>0</is_free>
  <is_featured>1</is_featured>
  <restrictions>All Ages</restrictions>
  <ticket_types count="0"/>
  <contacts count="0"/>
  <amenities count="0"/>
  <hours count="0"/>
  <web_sites count="3">
   <web_site>
    <url>http://www.historic.org.nz/en/Publi ... HeritageNz2009/HNZ09-WairauBar.aspx</url>
    <name>Wairau Bar on NZ Historic Place Trust</name>
   </web_site>
   <web_site>
    <url>http://www.teara.govt.nz/en/when-was-new-zealand-first-settled/3/6</url>
    <name>Te Ara</name>
   </web_site>
   <web_site>
    <url>http://wairaubar.wordpress.com</url>
    <name>Wairau Bar Blog</name>
   </web_site>
  </web_sites>
 </location>
</locations>

Parameters

The following parameters are available along with the common parameters.

featured

If set to 1, only return locations marked as featured.

levels

An integer specifying the number of child location levels to include in the children element of the returned results. For example specifying 1 (which is the default) would include only the matching locations without a children element. Specifying levels=2 would include the matching locations and their immediate children. Specifying levels=3 would include the matching locations, their immediate children and their immediate children's children.

A side effect of specifying levels greater than 1 is that the first level of locations will also have a parents element. The parents element includes a collection of location elements which are ancestors of the location with the more immediate ancestors first.

location

Only return locations which are a descendent of this location ID.

Specify multiple IDs by separating them with a comma (,).

location_slug

Only return locations where are a descendent of the location specified by this URL slug

Specify multiple URL slugs by separating them with a comma (,).

order

Specify the order the results should be in. Possible values are

  • popularity
  • distance (only available with the point parameter)

If nothing is specified locations are sorted by tree order with the root first.

point

In the format latitude,longitude

/locations.xml?point=-36.84846,174.763332&order=distance
This parameter only makes sense if you also specify the order and/or radius parameters.

radius

Only include events within the given kilometers of the given point

/locations.xml?point=-36.84846,174.763332&distance=5
Would only return events within 5 kilometers of the point. Fractions of a kilometer can also be specified.

venue

If this parameter is present and true then only locations which are venues are returned. If its present and false then venues are excluded

Exploring the Location Tree

Many of the other end points accept a location or location_slug parameter, for example the events end point allows filtering events within a specific location. To find out the id or slug of a location to use in the location or location_slug parameters you can look them up. There are a couple of techniques to do this. The first is to use the children field to explore down the location tree. For example here is how you would get the root location and it's children.

http://api.eventfinda.co.nz/v2/locations.xml?rows=1&levels=2&fields=location:(id,url_slug,name,children)

Response

<?xml version="1.0"?>
<locations count="23858">
 <location>
  <id>574</id>
  <name>New Zealand</name>
  <url_slug>new-zealand</url_slug>
  <children count="15">
   <location>
    <id>1</id>
    <name>Northland</name>
    <url_slug>northland</url_slug>
   </location>
   <location>
    <id>2</id>
    <name>Auckland</name>
    <url_slug>auckland</url_slug>
   </location>
   <location>
    <id>41</id>
    <name>The Coromandel</name>
    <url_slug>the-coromandel</url_slug>
   </location>
   <location>
    <id>6</id>
    <name><![CDATA[Hawke\'s Bay / Gisborne]]></name>
    <url_slug>hawkes-bay-gisborne</url_slug>
   </location>
   <location>
    <id>3</id>
    <name>Waikato</name>
    <url_slug>waikato</url_slug>
   </location>
   <location>
    <id>4</id>
    <name>Bay of Plenty</name>
    <url_slug>bay-of-plenty</url_slug>
   </location>
   <location>
    <id>7</id>
    <name>Taranaki</name>
    <url_slug>taranaki</url_slug>
   </location>
   <location>
    <id>9</id>
    <name>Manawatu / Whanganui</name>
    <url_slug>manawatu-wanganui</url_slug>
   </location>
   <location>
    <id>11</id>
    <name>Wellington Region</name>
    <url_slug>wellington-region</url_slug>
   </location>
   <location>
    <id>12</id>
    <name>Nelson / Tasman</name>
    <url_slug>nelson-tasman</url_slug>
   </location>
   <location>
    <id>13</id>
    <name>Marlborough</name>
    <url_slug>marlborough</url_slug>
   </location>
   <location>
    <id>14</id>
    <name>West Coast</name>
    <url_slug>west-coast</url_slug>
   </location>
   <location>
    <id>15</id>
    <name>Canterbury</name>
    <url_slug>canterbury</url_slug>
   </location>
   <location>
    <id>17</id>
    <name>Otago</name>
    <url_slug>otago</url_slug>
   </location>
   <location>
    <id>18</id>
    <name>Southland</name>
    <url_slug>southland</url_slug>
   </location>
  </children>
 </location>
</locations>

You can delve deeper into the tree structure by adding the id of a location whose children you want to see. In this case we'll look for the children of "Northland" which you can see from the above response has the id of 1.

http://api.eventfinda.co.nz/v2/locations.xml?id=1&levels=2&fields=location:(id,url_slug,name,children)

Response

<?xml version="1.0"?>
<locations count="1">
 <location>
  <id>1</id>
  <name>Northland</name>
  <url_slug>northland</url_slug>
  <children count="12">
   <location>
    <id>25724</id>
    <name>0182, Hikurangi</name>
    <url_slug>0182</url_slug>
   </location>
   <location>
    <id>25725</id>
    <name>0184, Hikurangi</name>
    <url_slug>0184</url_slug>
   </location>
   <location>
    <id>25748</id>
    <name>0376, Dargaville</name>
    <url_slug>0376</url_slug>
   </location>
   <location>
    <id>25756</id>
    <name>0472, Kaikohe</name>
    <url_slug>0472</url_slug>
   </location>
   <location>
    <id>25758</id>
    <name>0474, Kaikohe</name>
    <url_slug>0474</url_slug>
   </location>
   <location>
    <id>25761</id>
    <name>0478, Kaeo</name>
    <url_slug>0478</url_slug>
   </location>
   <location>
    <id>25762</id>
    <name>0479, Kaeo</name>
    <url_slug>0479</url_slug>
   </location>
   <location>
    <id>6648</id>
    <name>Bay of Islands</name>
    <url_slug>bay-of-islands</url_slug>
   </location>
   <location>
    <id>22</id>
    <name>Far North</name>
    <url_slug>far-north</url_slug>
   </location>
   <location>
    <id>6649</id>
    <name>Kaipara</name>
    <url_slug>kaipara</url_slug>
   </location>
   <location>
    <id>11068</id>
    <name>Mid North</name>
    <url_slug>mid-north</url_slug>
   </location>
   <location>
    <id>27</id>
    <name>Whangarei District</name>
    <url_slug>whangarei-district</url_slug>
   </location>
  </children>
 </location>
</locations>

The second method is looking for specific locations or venues using the q parameter. For example this query will look for locations containing the term "northland".

http://api.eventfinda.co.nz/v2/locations.xml?q=northland&venue=off&fields=location:(id,url_slug,name,children)

Response

<?xml version="1.0"?>
<locations count="37">
 <location>
  <id>1</id>
  <name>Northland</name>
  <url_slug>northland</url_slug>
 </location>
 <location>
  <id>22</id>
  <name>Far North</name>
  <url_slug>far-north</url_slug>
 </location>
 <location>
  <id>27</id>
  <name>Whangarei District</name>
  <url_slug>whangarei-district</url_slug>
 </location>
 <location>
  <id>19</id>
  <name>Dargaville</name>
  <url_slug>dargaville</url_slug>
 </location>
 <location>
  <id>567</id>
  <name>Mangawhai</name>
  <url_slug>mangawhai</url_slug>
 </location>
 <location>
  <id>25</id>
  <name>Maungaturoto</name>
  <url_slug>maungaturoto</url_slug>
 </location>
 <location>
  <id>6649</id>
  <name>Kaipara</name>
  <url_slug>kaipara</url_slug>
 </location>
 <location>
  <id>5669</id>
  <name>Kaiwaka</name>
  <url_slug>kaiwaka</url_slug>
 </location>
 <location>
  <id>5671</id>
  <name>Matakohe</name>
  <url_slug>matakohe</url_slug>
 </location>
 <location>
  <id>5678</id>
  <name>Paparoa</name>
  <url_slug>paparoa</url_slug>
 </location>
</locations>

By changing the venue=off to venue=on and adding the location=1 parameter you can then search for venues containing "bar" in "Northland".

http://api.eventfinda.co.nz/v2/locations.xml?q=bar&location=1&venue=on&fields=location:(id,url_slug,name,children)

Response

<?xml version="1.0"?>
<locations count="66">
 <location>
  <id>12935</id>
  <name>Collards Bar</name>
  <url_slug>collards-bar-kaitaia</url_slug>
 </location>
 <location>
  <id>3267</id>
  <name>Legends Sports Bar</name>
  <url_slug>legends-sports-bar-whangarei</url_slug>
 </location>
 <location>
  <id>22680</id>
  <name>Redeye Bar</name>
  <url_slug>redeye-bar-whangarei</url_slug>
 </location>
 <location>
  <id>9428</id>
  <name>Malbas Bar and Nightclub</name>
  <url_slug>malbas-bar-and-nightclub-whangarei</url_slug>
 </location>
 <location>
  <id>19458</id>
  <name>Wildside Bar and Grill</name>
  <url_slug>wildside-bar-and-grill-whangarei</url_slug>
 </location>
 <location>
  <id>2852</id>
  <name><![CDATA[Rocksalt Bar & Restaurant]]></name>
  <url_slug>rocksalt-bar-restaurant-kerikeri</url_slug>
 </location>
 <location>
  <id>10273</id>
  <name>35 Degrees South Aquarium Restaurant and Bar</name>
  <url_slug>35-degrees-south-aquarium-restaurant-and-bar-paihia</url_slug>
 </location>
 <location>
  <id>13922</id>
  <name><![CDATA[Historic Gumstore Bar & Grill]]></name>
  <url_slug>historic-gumstore-bar-grill-far-north</url_slug>
 </location>
 <location>
  <id>1852</id>
  <name>Chances Sports Bar</name>
  <url_slug>chances-sports-bar-kaitaia</url_slug>
 </location>
 <location>
  <id>6865</id>
  <name><![CDATA[Rynoz Bar & Stonegrill]]></name>
  <url_slug>rynoz-bar-stonegrill-whangarei</url_slug>
 </location>
</locations>