Skip to main content

directories/search

Retrieves all directory records / entries that match the specified search criteria within the specified directory.

Arguments:

  • api_key (required)
  • id (required)
  • per_page (optional - default 10)
  • page (optional - default 1)
  • query (optional)
  • postcode (optional) or lat/long (optional) note: Lat/long & postcode are mutually exclusive distance (optional)

Example requests:

http://[domain]/api/directories/3/search.xml?api_key=[api_key]
&query=test&postcode=LE19&distance=7&per_page=1&page=2

http://[domain]/api/directories/3/search.xml?api_key=[api_key]
&query=test&distance=7&per_page=1&page=2&lat=52.627150034225096
&long=-1.1221504211425781

Example response:

<?xml version="1.0" encoding="utf-8"?>
<entries page="2" pages="2" per_page="1" total="2">
<origin lat="52.595156" long="-1.203261"/>
<entry id="6">
<title>record 3</title>
<date>1359899378</date>
<fields>
<field id="15" name="One" type="text" displayTitle="true">
Test Field 2
</field>
<field id="16" name="Two" type="text" displayTitle="true">
Test Field 3
</field>
<field id="17" name="Three" type="text" displayTitle="true">
Test Field 1
</field>
<field id="18" name="Four" type="map" displayTitle="true">
52.627150034225096,-1.1221504211425781
</field>
</fields>
</entry>
</entries>