Multimap API V1.2 Web Services Documentation - Searching
The Multimap API V1.2 Searching web service module allows you to query data sources such as Multimap-hosted data tables. Both spatial and non-spatial queries are available.
The Searching web service parameters, their description and values are as follows:
| Parameter | Description | Valid values | Mandatory |
|---|---|---|---|
bb | This parameter refers to a string to specify the bounding box for the search. | String of format: min_lon, min_lat; max_lon, max_lat | No |
count | This parameter specifies the number of records to display per page (10 by default). | Integer | No |
countryCode | This parameter specifies the two-letter ISO country code for the input address. It returns a result which is the center of the spatial search. | Two-letter ISO country code | No |
dataSource | This parameter specifies the data source to use.
It is possible to search multiple data sources in one request by specifying a comma-separated list.
Each dataSource has its own RecordSet element in the XML document that returns results. |
String (defaults to your table of addresses) | No |
distanceUnits | This parameter specifies the units in which the
maxDistance and minDistance parameters are shown. | 'KM' or 'miles' | No |
format | This parameter specifies that if format is 'compact', the record details are not returned; only a count of the total number of matching records (ignoring paging) is returned. | 'compact' or 'normal' | No |
lat | This parameter specifies the latitude of the search center point. It returns a result which is the center of the spatial search. | Float; -90 to 90 | No |
locale |
This determines the appearance of labels and other text on a static map, based on settings for language and geographic area. | Any of the set of codes prescribed in the
list of permissible locale values |
No |
logic | This parameter specifies the logic operator to use
if more than one field filter is provided ("AND" by default). For example, if a query has three field filters and two logic operators, the API web service groups the first two filters using the first logic operator, by default. For more information, please see Example 12 and Example 13 on logic operators. |
'AND' or 'OR' or comma-separated list | No |
lon | This parameter specifies the longitude of the search center point. It returns a result which is the center of the spatial search. | Float; -180 to 180 | No |
maxDistance | This parameter specifies the maximum distance a record must be from the search point ("KM" by default). | Float (default value = 1,000 kilometers or 621 miles) | No |
minDistance | This parameter specifies the minimum distance a record must be from the search point ("KM" by default). | Float (default value = 0) | No |
orderByFields | This parameter specifies a comma-separated list of field names by which ordering should be applied. It sorts the results alphabetically or numerically. Note: The resultSetSize parameter must be used when using orderByFields parameter in order to obtain a result set of the specified size. Using orderByFields parameter without the resultSetSize parameter returns an error. | String or comma-separated list | No |
orderByOrder | This parameter specifies a comma-separated list of directions (ascending or descending) in which records are to be sorted. This should match with the orderByFields value. Note: The resultSetSize parameter must be used when using orderByOrder parameter in order to obtain a result set of the specified size. Using orderByOrder parameter without the resultSetSize parameter returns an error. |
Comma-separated list of asc or desc values | No |
resultSetSize | This parameter specifies the number of records you wish to include for sorting or filtering. It is used when queries based on specific point also have 'order by' settings to obtain a result set of the specified size, sorted by distance from the original point. Note: When paging through these results, be aware that you cannot page past the end of the resultSetSize parameter. The default value for this parameter is 20 records. | Integer | No |
returnFields | This parameter specifies a comma-separated list of field names that should appear in the result page; it returns all fields by default. | String or comma-separated list | No |
routeModes | This parameter specifies whether to generate a driving and/or walking route (where available); it gives a driving route by default. You can also calculate and display the driving or walking distance or duration in the XML response depending on the parameters specified. | Comma-separated list ("driving" or "walking") | No |
startIndex | This parameter specifies the index of the first record to display
(starts at and defaults to 1). Note: If startIndex parameter is used with the resultSetSize parameter, the value of startIndex parameter should be less than the value of the resultSetSize parameter. | Integer | No |
[Note: Please replace "parameter_[COUNTER]" with incremental numbers such as parameter_1, parameter_2,...,parameter_n. Here, parameter_1 is used for the first route point and parameter_2 for the second route point.]
| Parameter | Description | Valid values | Mandatory |
|---|---|---|---|
compoundOrder | This parameter specifies the order of operation by which you wish to evaluate your selected database fields. | String; comma-separated list | No |
compoundThreshold | This parameter specifies the number of matching records that must be found before the compound query halts. | Integer | No |
fieldname_[COUNTER] | This parameter specifies the name of the field in the data source on which to filter, such as fieldname_1, fieldname_2.... | String | No |
operator_[COUNTER] | This parameter specifies the operator to be used in the field filter, such as operator_1, operator_2.... | String | No |
preSearchDataSource | This parameter specifies which data source is to be used in a pre-search. The result of that search will then be used as an input to the main search action. | String | No |
preSearchFilters | This parameter specifies which field filters are to be used in a pre-search. The result of that search will then be used as an input to the main search action. | String | No |
value_[COUNTER] | This parameter specifies the value used in the field filter search, such as value_1, value_2.... | String | No |
| Parameter | Description | Valid values | Mandatory |
|---|---|---|---|
city | This parameter specifies the city, town or suburb for the input address. The result it returns is the center of the spatial search. | String | No |
postalCode | This parameter specifies the postal code for the input address. The result it returns is the center of the spatial search. | String | No |
qs | This parameter specifies an address or place name entered as a single string, preferably used in conjunction with countryCode. The result it returns is the center of the spatial search. | String | No |
region | This parameter specifies the region for the input address; it is a synonym for state. The result it returns is the center of the spatial search. | String | No |
state | This parameter specifies the state for the input address; it is a synonym for region. The result it returns is the center of the spatial search. | String | No |
street | This parameter specifies the street, optionally including a building number, for the input address. The result it returns is the center of the spatial search. | String | No |
ZIP | This parameter specifies the ZIP code for the input address; it is a synonym for postalCode. The result it returns is the center of the spatial search. | String | No |
Searching web services enable you to use one or more search operators to produce the desired search results. A detailed list of Search operators is as follows:
| Operator | Example Filter | Description |
|---|---|---|
eq | fieldname_1=client_id&operator_1=eq&value_1=100 | Equals; it returns the records where the concerned field exactly matches a given pattern.
In this example, records where client_id equals "100" are returned. |
lt | fieldname_1=client_id&operator_1=lt&value_1=100 | Less than; it returns the records where the concerned field is less than the specified value.
In this example, records where client_id is less than "100" are returned. |
gt | fieldname_1=client_id&operator_1=gt&value_1=500 | Greater than; it returns the records where the concerned field is greater than the specified value. In this example, records where client_id is more than "500" are returned. |
not | fieldname_1=country&operator_1=not&value_1=uk | Not; it returns the records where the concerned field is not the same as the specified value. In this example, records where country is not "UK" are returned.Note: Please note that not parameter does not recognize NULL values. When using queries which involve NULL field values, use the null parameter instead of not parameter. |
le | fieldname_1=geoquality&operator_1=le&value_1=9 | Less than or equal; it returns the records where the concerned field is either less than
or equal to the specified value.
In this example, records where geoquality is less than or equal to "9" are returned. |
ge | fieldname_1=geoquality&operator_1=ge&value_1=9 | Greater than or equal; it returns the records where the concerned field is either greater than or equal to the specified value. In this example, records where geoquality is greater than or equal to "9" are returned. |
in | fieldname_1=client_id&operator_1=in&value_1=100,114,128 | Matches against a comma-separated list of values; it returns the records where the concerned field matches against the comma-separated list. In this example, records where client_id matches "100", "114" and "128" are returned. |
null | fieldname_1=street&operator_1=null | Value is null; it returns the records where the concerned field is null.
In this example, records where street is "null" are returned. |
notnull | fieldname_1=street&operator_1=notnull | Value is not null; it returns the records where the concerned field is "not null". In this example, records where street is not null are returned. |
contains | fieldname_1=name &operator_1=contains&value_1=tate | Contains; it returns the records where the concerned field contains the whole specified word. In this example, records where name contains "tate" are returned. |
startswith | fieldname_1=street&operator_1=startswith&value_1=gough | Starts with; it returns the records where the concerned field starts with the specified value. In this example, records where street starts with "glough" are returned. |
endswith | fieldname_1=street&operator_1=endswith&value_1=square | Ends with; it returns the records where the concerned field ends with the specified value. In this example, records where street ends with "square" are returned. |
like | fieldname_1=name &operator_1=like&value_1=*tate | Like or partial match; it returns the records where the concerned field matches a given pattern. It supports wildcard characters. In this example, records where name matches the pattern "*tate" are returned.Please note that the like operator uses 'wildcard' characters to match patterns, so that, for example, "like *tim*" equates to "contains tim".
|
sl | fieldname_1=name&operator_1=sl&value_1=hello | Sounds like; it compares the sound and returns the records where the concerned field sounds like the specified value. In this example, records where name sounds like "hello" or "hulaw" or similar sounding values are returned. |
co | fieldname_1=name&operator_1=co&value_1=abcd | Character order; it returns the records where the concerned field contains the specified characters in alphabetical order. In this example, records where name contains characters "abcd" in that order are returned. |
com | compound | Please refer to the section on Compound Searching |
regexp | fieldname_1=name&operator_1=regexp&value_1=^r.*mu.*$ | Regular expression; it returns the records where the concerned field matches the specified pattern. In this example, records where name starts with "r" and after that has "mu" at some point are returned. |
notlike | fieldname_1=street&operator_1=notlike&value_1=%road | Not like; it returns the records where the concerned field does not match the specified pattern. In this example, records where street that does not end with "road" are returned.Please note that the notlike operator uses 'wildcard' characters to match patterns.Note: Please note that notlike parameter does not recognize NULL values. When using queries which involve NULL field values, use the notnull parameter instead of notlike parameter. |
beginning_sl | fieldname_1=name&operator_1=beginning_sl&value_1=man | Beginning sounds like; it returns the records where the beginning of the concerned field sounds like the specified value. In this example, records where beginning of name sounds like "man" are returned. |
Here is an example of a URL requesting a search on the partial postcode EC4 in London, Great Britain:
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&city=London&countryCode=GB
The URL shown above returns the following response:
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="7"> <Record counter="1"> <Fields> <Field name="client_id">GB01</Field> <Field name="name">Tate Gallery</Field> <Field name="street">Millbank</Field> <Field name="town">London</Field> <Field name="pc">SW1P 4RG</Field> <Field name="state" /> <Field name="country">GB</Field> <Field name="telephone">44 0207 887 8000</Field> <Field name="fax" /> <Field name="url" /> <Field name="id">10</Field> <Field name="GeoQuality">4</Field> <Field name="GeocodeDate">2007-04-05</Field> <Field name="GeocodeSource">cp071</Field> </Fields> <Distance> <Miles>2.03</Miles> <KM>3.27</KM> </Distance> <Point> <Lat>51.49087</Lat> <Lon>-0.12718</Lon> </Point> </Record> <Record counter="2"> <Fields> <Field name="client_id">GB03</Field> <Field name="name">Royal Albert Memorial Museum & Art Gallery</Field> <Field name="street">Queen Street</Field> <Field name="town">Exeter</Field> <Field name="pc">EX4 3RX</Field> <Field name="state" /> <Field name="country">GB</Field> <Field name="telephone">+44 (0)1392 665858</Field> <Field name="fax">+44 (0)1392 421252</Field> <Field name="url" /> <Field name="id">9</Field> <Field name="GeoQuality">4</Field> <Field name="GeocodeDate">2007-04-05</Field> <Field name="GeocodeSource">cp071</Field> </Fields> <Distance> <Miles>158.60</Miles> <KM>255.25</KM> </Distance> <Point> <Lat>50.72529</Lat> <Lon>-3.53253</Lon> </Point> </Record> ... <Record counter="7"> <Fields> <Field name="client_id">IT01</Field> <Field name="name">Museo Bagatti Valsecchi</Field> <Field name="street">10 Via Santo Spirito</Field> <Field name="town">Milan</Field> <Field name="pc">20121</Field> <Field name="state" /> <Field name="country">IT</Field> <Field name="telephone">39 12 34 56 78 90</Field> <Field name="fax" /> <Field name="url" /> <Field name="id">6</Field> <Field name="GeoQuality">1i</Field> <Field name="GeocodeDate">2007-04-05</Field> <Field name="GeocodeSource">IT06_1</Field> </Fields> <Distance> <Miles>596.24</Miles> <KM>959.56</KM> </Distance> <Point> <Lat>45.46985</Lat> <Lon>9.19461</Lon> </Point> </Record> </RecordSet> </RecordSets>
| Code | Notes |
|---|---|
<?xml version="1.0" encoding="UTF-8" ?> |
The XML declaration specifies the XML version being used and makes a reference to UTF-8 (eight-bit Unicode Transformation Format), which supports any character in the Unicode standard. |
<RecordSets xmlns="http://clients.multimap.com/API" | This section refers to the parent element of the document
and defines the XML name space. The xsi:schemaLocation section defines the XML location schema.The dataSource element specifies the data source to use.
It is possible to search multiple data sources in one request by specifying a comma-separated list,
as shown in the following example.The totalRecordCount element specifies the number of matched results or records returned by the request.
|
<Record counter="1"> | The counter element refers to the record number.The name element specifies the name of the parameter returned by the request.
The Point element refers to a location in decimal degrees of latitude and longitude .
|
</RecordSet> | The RecordSet and RecordSets
elements close here. |
In response to a successful search with multiple data sources:
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&city=London&countryCode=GB&dataSource=[datasource1],
[datasource2]
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="8"> <Record counter="1"> <Fields> <Field name="client_id" /> <Field name="name">Museum of London</Field> <Field name="street">150 London Wall</Field> <Field name="town">London</Field> <Field name="pc">EC2Y 5HN</Field> <Field name="state" /> <Field name="country">GB</Field> <Field name="telephone">0870 444 3852</Field> <Field name="fax">0870 444 3853</Field> <Field name="url">www.museumoflondon.org.uk</Field> <Field name="id">3</Field> <Field name="GeoQuality">4</Field> <Field name="GeocodeDate">2007-05-17</Field> <Field name="GeocodeSource">cp071</Field> </Fields> <Distance> <Miles>0.30</Miles> <KM>0.48</KM> </Distance> <Point> <Lat>51.51778</Lat> <Lon>-0.09656</Lon> </Point> </Record> ... <Record counter="8"> <Fields> <Field name="client_id" /> <Field name="name">Horniman Museum</Field> <Field name="street">100 London Road</Field> <Field name="town">London</Field> <Field name="pc">SE23 3PQ</Field> <Field name="state" /> <Field name="country">GB</Field> <Field name="telephone">020 8699 1872</Field> <Field name="fax">020 8291 5506</Field> <Field name="url">http://www.horniman.ac.uk/</Field> <Field name="id">2</Field> <Field name="GeoQuality">4</Field> <Field name="GeocodeDate">2007-05-17</Field> <Field name="GeocodeSource">cp071</Field> </Fields> <Distance> <Miles>5.49</Miles> <KM>8.84</KM> </Distance> <Point> <Lat>51.44113</Lat> <Lon>-0.06074</Lon> </Point> </Record> </RecordSet> <RecordSet dataSource="[datasource2]" totalRecordCount="998"> <Record counter="1"> <Fields> <Field name="client_id">441</Field> <Field name="name">Dr Johnson's House</Field> <Field name="street">Gough Square</Field> <Field name="town">LONDON</Field> <Field name="pc">EC4A 3DE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7353 3745</Field> <Field name="fax">020 7353 3745</Field> <Field name="url">www.drjh.co.uk</Field> <Field name="locationtype" /> <Field name="id">441</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">531300</Field> <Field name="y">181200</Field> </Fields> <Distance> <Miles>0.29</Miles> <KM>0.46</KM> </Distance> <Point> <Lat>51.51450</Lat> <Lon>-0.10920</Lon> </Point> </Record> ... <Record counter="10"> <Fields> <Field name="client_id">470</Field> <Field name="name">Shakespeare's Globe Exhibition</Field> <Field name="street">New Globe Walk</Field> <Field name="town">LONDON</Field> <Field name="pc">SE1 9DT</Field> <Field name="country">UK</Field> <Field name="telephone">020 7902 1500</Field> <Field name="fax">020 7902 1515</Field> <Field name="url">www.shakespeares-globe.org</Field> <Field name="locationtype" /> <Field name="id">470</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">532200</Field> <Field name="y">180300</Field> </Fields> <Distance> <Miles>0.74</Miles> <KM>1.19</KM> </Distance> <Point> <Lat>51.50620</Lat> <Lon>-0.09650</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a search with multiple data sources where one search returns a result and the other one does not:
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&count=2&city=London&countryCode=GB
&dataSource=[datasource1],[datasource2]
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="998"> <Record counter="1"> <Fields> <Field name="client_id">441</Field> <Field name="name">Dr Johnson's House</Field> <Field name="street">Gough Square</Field> <Field name="town">LONDON</Field> <Field name="pc">EC4A 3DE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7353 3745</Field> <Field name="fax">020 7353 3745</Field> <Field name="url">www.drjh.co.uk</Field> <Field name="locationtype" /> <Field name="id">441</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">531300</Field> <Field name="y">181200</Field> </Fields> <Distance> <Miles>0.29</Miles> <KM>0.46</KM> </Distance> <Point> <Lat>51.51450</Lat> <Lon>-0.10920</Lon> </Point> </Record> <Record counter="2"> <Fields> <Field name="client_id">445</Field> <Field name="name">The Guildhall</Field> <Field name="street">Guildhall Yard</Field> <Field name="town">LONDON</Field> <Field name="pc">EC2V 5AE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7606 3030</Field> <Field name="fax">020 7260 1119</Field> <Field name="url" /> <Field name="locationtype" /> <Field name="id">445</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">532400</Field> <Field name="y">181300</Field> </Fields> <Distance> <Miles>0.42</Miles> <KM>0.68</KM> </Distance> <Point> <Lat>51.51510</Lat> <Lon>-0.09330</Lon> </Point> </Record> <RecordSet dataSource="[datasource2]" totalRecordCount="0" /> </RecordSets>
In response to a search with a specified bounding box, the search returns those records from the data source that are within the bounds of the box:
http://clients.multimap.com/API/search/1.2/[api_key]?bb=-2.30972,52.1238;-1.176,52.16995
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="1"> <Record counter="1"> <Fields> <Field name="client_id">764</Field> <Field name="name">Farnborough Hall</Field> <Field name="street" /> <Field name="town">BANBURY</Field> <Field name="pc">OX17 1DU</Field> <Field name="country">UK</Field> <Field name="telephone">01295 690 202</Field> <Field name="fax" /> <Field name="url" /> <Field name="locationtype" /> <Field name="id">764</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">443000</Field> <Field name="y">249400</Field> </Fields> <Point> <Lat>52.14120</Lat> <Lon>-1.37310</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a search request with a fieldFilter parameter:
http://clients.multimap.com/API/search/1.2/[api_key]?fieldname_1=client_id&operator_1=eq&value_1=100
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="1"> <Record counter="1"> <Fields> <Field name="client_id">100</Field> <Field name="name">The Lost Gardens of Heligan</Field> <Field name="street" /> <Field name="town">ST. AUSTELL</Field> <Field name="pc">PL26 6EN</Field> <Field name="country">UK</Field> <Field name="telephone">01726 845 100</Field> <Field name="fax">01726 845 101</Field> <Field name="url">www.heligan.com</Field> <Field name="locationtype" /> <Field name="id">100</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">199900</Field> <Field name="y">46400</Field> </Fields> <Point> <Lat>50.28350</Lat> <Lon>-4.81010</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a request that specified that results be within minDistance and maxDistance parameters
and be displayed from the third record onwards
(in response to a &minDistance, &maxDistance and &startIndex
search request):
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&minDistance=177&maxDistance=580&startIndex=3&city=London
&countryCode=GB
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="4"> <Record counter="3"> <Fields> <Field name="client_id">DE01</Field> <Field name="name">German Museum of Technology Berlin (GMTB)</Field> <Field name="street">Trebbiner Str. 9</Field> <Field name="town">Berlin</Field> <Field name="pc">10963</Field> <Field name="state" /> <Field name="country">DE</Field> <Field name="telephone" /> <Field name="fax" /> <Field name="url" /> <Field name="id">3</Field> <Field name="GeoQuality">1i</Field> <Field name="GeocodeDate">2007-04-05</Field> <Field name="GeocodeSource">DE06_1</Field> </Fields> <Distance> <Miles>577.07</Miles> <KM>928.71</KM> </Distance> <Point> <Lat>52.49865</Lat> <Lon>13.37640</Lon> </Point> </Record> <Record counter="4"> <Fields> <Field name="client_id">DE02</Field> <Field name="name">Deutsches Historisches Museum</Field> <Field name="street">Unter den Linden 2</Field> <Field name="town">Berlin</Field> <Field name="pc">10117</Field> <Field name="state" /> <Field name="country">DE</Field> <Field name="telephone">+49 - (0)30 - 20304 - 0</Field> <Field name="fax">+49 - (0)30 - 20304 - 543</Field> <Field name="url" /> <Field name="id">4</Field> <Field name="GeoQuality">1i</Field> <Field name="GeocodeDate">2007-04-05</Field> <Field name="GeocodeSource">DE06_1</Field> </Fields> <Distance> <Miles>578.01</Miles> <KM>930.21</KM> </Distance> <Point> <Lat>52.51770</Lat> <Lon>13.39772</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a request that specified only the results' street,
town and country fields be displayed,
showing only two records per page (in response to a &returnFields
and &count search request):
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&returnFields=name,street,town,country&count=2&city=London&
countryCode=GB
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="7"> <Record counter="1"> <Fields> <Field name="name">Tate Gallery</Field> <Field name="street">Millbank</Field> <Field name="town">London</Field> <Field name="country">GB</Field> </Fields> <Distance> <Miles>2.03</Miles> <KM>3.27</KM> </Distance> </Record> <Record counter="2"> <Fields> <Field name="name">Royal Albert Memorial Museum & Art Gallery</Field> <Field name="street">Queen Street</Field> <Field name="town">Exeter</Field> <Field name="country">GB</Field> </Fields> <Distance> <Miles>158.60</Miles> <KM>255.25</KM> </Distance> </Record> </RecordSet> </RecordSets>
In response to a request where the record details should not be returned and only a count
of total number of matching records should be returned
(in response to a &format=compact search request):
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&returnFields=name,street,town,country&format=compact&
city=London&countryCode=GB
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="7" /> </RecordSets>
In response to a request for a search on the partial postcode EC4 in London, Great Britain with the mode of travel set to "driving":
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&count=2&city=London&countryCode=GB&routeModes=driving
Please note that the availability of walking or driving routes depends on regional geographic coverage and is controlled by the routeModes field of the Multimap API's MMSearch class.
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="998"> <Record counter="1"> <Fields> <Field name="client_id">441</Field> <Field name="name">Dr Johnson's House</Field> <Field name="street">Gough Square</Field> <Field name="town">LONDON</Field> <Field name="pc">EC4A 3DE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7353 3745</Field> <Field name="fax">020 7353 3745</Field> <Field name="url">www.drjh.co.uk</Field> <Field name="locationtype" /> <Field name="id">441</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">531300</Field> <Field name="y">181200</Field> </Fields> <Distance> <Miles>0.29</Miles> <KM>0.46</KM> </Distance> <Distance mode="driving"> <Miles>0.61</Miles> <KM>0.98</KM> </Distance> <Duration mode="driving"> <Minutes>2</Minutes> </Duration> <Point> <Lat>51.51450</Lat> <Lon>-0.10920</Lon> </Point> </Record> <Record counter="2"> <Fields> <Field name="client_id">445</Field> <Field name="name">The Guildhall</Field> <Field name="street">Guildhall Yard</Field> <Field name="town">LONDON</Field> <Field name="pc">EC2V 5AE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7606 3030</Field> <Field name="fax">020 7260 1119</Field> <Field name="url" /> <Field name="locationtype" /> <Field name="id">445</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">532400</Field> <Field name="y">181300</Field> </Fields> <Distance> <Miles>0.42</Miles> <KM>0.68</KM> </Distance> <Distance mode="driving"> <Miles>0.62</Miles> <KM>1.00</KM> </Distance> <Duration mode="driving"> <Minutes>2</Minutes> </Duration> <Point> <Lat>51.51510</Lat> <Lon>-0.09330</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a request for a search on the partial postcode EC4 in London, Great Britain with the modes of travel set to "walking" and "driving":
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&count=2&city=London&countryCode=GB&routeModes=driving,walking
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="998"> <Record counter="1"> <Fields> <Field name="client_id">441</Field> <Field name="name">Dr Johnson's House</Field> <Field name="street">Gough Square</Field> <Field name="town">LONDON</Field> <Field name="pc">EC4A 3DE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7353 3745</Field> <Field name="fax">020 7353 3745</Field> <Field name="url">www.drjh.co.uk</Field> <Field name="locationtype" /> <Field name="id">441</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">531300</Field> <Field name="y">181200</Field> </Fields> <Distance> <Miles>0.29</Miles> <KM>0.46</KM> </Distance> <Distance mode="driving"> <Miles>0.61</Miles> <KM>0.98</KM> </Distance> <Distance mode="walking"> <Miles>0.41</Miles> <KM>0.66</KM> </Distance> <Duration mode="driving"> <Minutes>2</Minutes> </Duration> <Duration mode="walking"> <Minutes>8</Minutes> </Duration> <Point> <Lat>51.51450</Lat> <Lon>-0.10920</Lon> </Point> </Record> <Record counter="2"> <Fields> <Field name="client_id">445</Field> <Field name="name">The Guildhall</Field> <Field name="street">Guildhall Yard</Field> <Field name="town">LONDON</Field> <Field name="pc">EC2V 5AE</Field> <Field name="country">UK</Field> <Field name="telephone">020 7606 3030</Field> <Field name="fax">020 7260 1119</Field> <Field name="url" /> <Field name="locationtype" /> <Field name="id">445</Field> <Field name="GeoQuality">9</Field> <Field name="GeocodeDate">0000-00-00</Field> <Field name="GeocodeSource" /> <Field name="x">532400</Field> <Field name="y">181300</Field> </Fields> <Distance> <Miles>0.42</Miles> <KM>0.68</KM> </Distance> <Distance mode="driving"> <Miles>0.62</Miles> <KM>1.00</KM> </Distance> <Distance mode="walking"> <Miles>0.52</Miles> <KM>0.84</KM> </Distance> <Duration mode="driving"> <Minutes>2</Minutes> </Duration> <Duration mode="walking"> <Minutes>10</Minutes> </Duration> <Point> <Lat>51.51510</Lat> <Lon>-0.09330</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a request for a search on the partial postcode EC4 in London, Great Britain
where records are ordered by "walking_distance"
and the modes of travel are set to "walking" and "driving"
(in response to a &orderByFields search request):
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&count=10&routeModes=driving,walking&
orderByFields=walking_distance
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="998"> <Record counter="1"> <Fields> <Field name="locationtype" /> <Field name="street">Gough Square</Field> <Field name="x">531300</Field> <Field name="GeoQuality">9</Field> <Field name="town">LONDON</Field> <Field name="pc">EC4A 3DE</Field> <Field name="y">181200</Field> <Field name="fax">020 7353 3745</Field> <Field name="url">www.drjh.co.uk</Field> <Field name="id">441</Field> <Field name="country">UK</Field> <Field name="telephone">020 7353 3745</Field> <Field name="client_id">441</Field> <Field name="name">Dr Johnson's House</Field> <Field name="GeocodeSource" /> <Field name="GeocodeDate">0000-00-00</Field> </Fields> <Distance> <Miles>0.30</Miles> <KM>0.48</KM> </Distance> <Distance mode="driving"> <Miles>0.61</Miles> <KM>0.98</KM> </Distance> <Distance mode="walking"> <Miles>0.41</Miles> <KM>0.66</KM> </Distance> <Duration mode="driving"> <Minutes>2</Minutes> </Duration> <Duration mode="walking"> <Minutes>8</Minutes> </Duration> <Point> <Lat>51.51450</Lat> <Lon>-0.10920</Lon> </Point> </Record> <Record counter="2"> <Fields> <Field name="locationtype" /> <Field name="street">Guildhall Yard</Field> <Field name="x">532400</Field> <Field name="GeoQuality">9</Field> <Field name="town">LONDON</Field> <Field name="pc">EC2V 5AE</Field> <Field name="y">181300</Field> <Field name="fax">020 7260 1119</Field> <Field name="url" /> <Field name="id">445</Field> <Field name="country">UK</Field> <Field name="telephone">020 7606 3030</Field> <Field name="client_id">445</Field> <Field name="name">The Guildhall</Field> <Field name="GeocodeSource" /> <Field name="GeocodeDate">0000-00-00</Field> </Fields> <Distance> <Miles>0.40</Miles> <KM>0.64</KM> </Distance> <Distance mode="driving"> <Miles>0.62</Miles> <KM>1.00</KM> </Distance> <Distance mode="walking"> <Miles>0.52</Miles> <KM>0.84</KM> </Distance> <Duration mode="driving"> <Minutes>2</Minutes> </Duration> <Duration mode="walking"> <Minutes>10</Minutes> </Duration> <Point> <Lat>51.51510</Lat> <Lon>-0.09330</Lon> </Point> </Record> ... <Record counter="9"> <Fields> <Field name="locationtype" /> <Field name="street">Tavistock Street</Field> <Field name="x">530500</Field> <Field name="GeoQuality">9</Field> <Field name="town">LONDON</Field> <Field name="pc">WC2E 7PA</Field> <Field name="y">180900</Field> <Field name="fax">020 7836 5148</Field> <Field name="url" /> <Field name="id">472</Field> <Field name="country">UK</Field> <Field name="telephone">020 7943 4700</Field> <Field name="client_id">472</Field> <Field name="name">Theatre Museum</Field> <Field name="GeocodeSource" /> <Field name="GeocodeDate">0000-00-00</Field> </Fields> <Distance> <Miles>0.83</Miles> <KM>1.33</KM> </Distance> <Distance mode="driving"> <Miles>1.20</Miles> <KM>1.93</KM> </Distance> <Distance mode="walking"> <Miles>0.95</Miles> <KM>1.53</KM> </Distance> <Duration mode="driving"> <Minutes>4</Minutes> </Duration> <Duration mode="walking"> <Minutes>19</Minutes> </Duration> <Point> <Lat>51.51200</Lat> <Lon>-0.12080</Lon> </Point> </Record> <Record counter="10"> <Fields> <Field name="locationtype" /> <Field name="street">Monument Street</Field> <Field name="x">532900</Field> <Field name="GeoQuality">9</Field> <Field name="town">LONDON</Field> <Field name="pc">EC3R 8AH</Field> <Field name="y">180700</Field> <Field name="fax">020 7796 2621</Field> <Field name="url" /> <Field name="id">466</Field> <Field name="country">UK</Field> <Field name="telephone">020 7626 2717</Field> <Field name="client_id">466</Field> <Field name="name">The Monument</Field> <Field name="GeocodeSource" /> <Field name="GeocodeDate">0000-00-00</Field> </Fields> <Distance> <Miles>0.81</Miles> <KM>1.30</KM> </Distance> <Distance mode="driving"> <Miles>1.27</Miles> <KM>2.04</KM> </Distance> <Distance mode="walking"> <Miles>0.95</Miles> <KM>1.53</KM> </Distance> <Duration mode="driving"> <Minutes>4</Minutes> </Duration> <Duration mode="walking"> <Minutes>19</Minutes> </Duration> <Point> <Lat>51.50960</Lat> <Lon>-0.08630</Lon> </Point> </Record> </RecordSet> </RecordSets>
In response to a search request with multiple logic operators (AND & OR). The request processes the first two filters with the "AND" operator and then processes their result with the third filter using the "OR" operator. So, the request handles the three filters as:
(town = Penwith AND name = HSBC) OR town = Kerrier
The result returns all the records for HSBC in the town, Penwith as well as any records in the town of Kerrier:
http://clients.multimap.com/API/search/1.2/[api_key]?dataSource=[datasource1]&returnFields=name,town,brandname,relpos
&fieldname_1=town&operator_1=eq&value_1=Penwith&fieldname_2=name&operator_2=eq&value_2=HSBC
&fieldname_3=town&operator_3=eq&value_3=Kerrier&logic=AND,OR
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="25"> <Information> <Info>ATM's</Info> <Info>Id</Info> </Information> <Record counter="1"> <Fields> <Field name="relpos">36</Field> <Field name="brandname" /> <Field name="name">Lloyds Bank</Field> <Field name="town">Kerrier</Field> </Fields> </Record> <Record counter="2"> <Fields> <Field name="relpos">52</Field> <Field name="brandname" /> <Field name="name">NatWest</Field> <Field name="town">Kerrier</Field> </Fields> </Record> <Record counter="3"> <Fields> <Field name="relpos">-1</Field> <Field name="brandname" /> <Field name="name">TSB Bank Plc</Field> <Field name="town">Kerrier</Field> </Fields> </Record> ... <Record counter="8"> <Fields> <Field name="relpos">9</Field> <Field name="brandname">HSBC</Field> <Field name="name">HSBC</Field> <Field name="town">Penwith</Field> </Fields> </Record> <Record counter="9"> <Fields> <Field name="relpos">-1</Field> <Field name="brandname">HSBC</Field> <Field name="name">HSBC</Field> <Field name="town">Penwith</Field> </Fields> </Record> <Record counter="10"> <Fields> <Field name="relpos">54</Field> <Field name="brandname">HSBC</Field> <Field name="name">HSBC</Field> <Field name="town">Penwith</Field> </Fields> </Record> </RecordSet> </RecordSets>
In response to a search request with multiple logic operators (AND & OR & AND). The request processes the first two filters and the next two filters with "AND" operators and then processes their result with the "OR" operator. So, the request handles the four filters as:
(town = Penwith AND name = HSBC) OR (town = Kerrier AND name = Natwest)
The result returns all the records with HSBC in the town, Penwith as well as records with Natwest in the town of Kerrier:
http://clients.multimap.com/API/search/1.2/[api_key]?dataSource=[datasource1]&returnFields=name,town,brandname,relpos
&fieldname_1=town&operator_1=eq&value_1=Penwith&fieldname_2=name&operator_2=eq&value_2=HSBC
&fieldname_3=town&operator_3=eq&value_3=Kerrier&fieldname_4=name&operator_4=eq&value_4=NatWest&logic=AND,OR,AND
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="5"> <Information> <Info>ATM's</Info> <Info>Id</Info> </Information> <Record counter="1"> <Fields> <Field name="relpos">9</Field> <Field name="brandname">HSBC</Field> <Field name="name">HSBC</Field> <Field name="town">Penwith</Field> </Fields> </Record> <Record counter="2"> <Fields> <Field name="relpos">-1</Field> <Field name="brandname">HSBC</Field> <Field name="name">HSBC</Field> <Field name="town">Penwith</Field> </Fields> </Record> ... <Record counter="5"> <Fields> <Field name="relpos">52</Field> <Field name="brandname" /> <Field name="name">NatWest</Field> <Field name="town">Kerrier</Field> </Fields> </Record> </RecordSet> </RecordSets>
Note: For more information on the sequence in which the logic operators are invoked, please see the MySQL documentation on logic operator precedence.
In response to a request which returns the nearest 24 hospitals within the distance of 50 miles from postcode S105RS and have "royal" in their title. Also, the results should display the records from the 'second page' (the 21st record) onwards when ordered alphabetically by "hospital name" (in response to &orderByFields, &startIndex, &resultSetSize):
http://clients.multimap.com/API/search/1.2/[api_key]?qs=S105RS&maxDistance=50&distanceUnits=miles&
&orderByFields=hospital_name&startIndex=21&returnFields=client_id,hospital_name,address_1,address_2,address_3,pc
&fieldname_1=hospital_name&operator_1=contains&value_1=royal&resultSetSize=24
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="mm.clients.axaapi" totalRecordCount="27"> <Record counter="21"> <Fields> <Field name="address_4" /> <Field name="address_3">MANCHESTER</Field> <Field name="endorsements">N</Field> <Field name="client_id">ROY032</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">M27 4HA</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">PENDLEBURY</Field> <Field name="hospital_name">ROYAL MANCHESTER CHILDRENS HOS</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>33.90</Miles> <KM>54.55</KM> </Distance> </Record> <Record counter="22"> <Fields> <Field name="address_4" /> <Field name="address_3">OLDHAM</Field> <Field name="endorsements">N</Field> <Field name="client_id">MRI336</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">OL1 2JH</Field> <Field name="network_marker">Y</Field> <Field name="address_2" /> <Field name="address_1">ROCHDALE ROAD</Field> <Field name="hospital_name">ROYAL OLDHAM HOSPITAL</Field> <Field name="hospital_type">SCANNING CENTRE</Field> </Fields> <Distance> <Miles>27.42</Miles> <KM>44.13</KM> </Distance> </Record> <Record counter="23"> <Fields> <Field name="address_4" /> <Field name="address_3">OLDHAM</Field> <Field name="endorsements">N</Field> <Field name="client_id">ROY038</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">OL1 2JH</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">ROCHDALE ROAD</Field> <Field name="hospital_name">ROYAL OLDHAM HOSPITAL</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>27.42</Miles> <KM>44.13</KM> </Distance> </Record> <Record counter="24"> <Fields> <Field name="address_4" /> <Field name="address_3">SALFORD</Field> <Field name="endorsements">N</Field> <Field name="client_id">HOP001</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">M6 8HD</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">STOTT LANE</Field> <Field name="hospital_name">SALFORD ROYAL HOSPITAL</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>33.77</Miles> <KM>54.35</KM> </Distance> </Record> </RecordSet> </RecordSets>
In response to a request which returns the nearest 40 hospitals within the distance of 50 miles from postcode S105RS and have "royal" in their title. Also, the results should display the records in descending by "address_3" and within that in ascending order by "hospital_name"(in response to &orderByFields and &orderByOrder):
http://clients.multimap.com/API/search/1.2/[api_key]?qs=S10%205RS&maxDistance=50&distanceUnits=miles&count=5
&orderByFields=address_3,hospital_name&orderByOrder=desc,asc&startIndex=4&returnFields=client_id,hospital_name,
address_1,address_2,address_3,address_4,address_5,pc,hospital_type,network_marker,endorsements
&fieldname_1=hospital_name&operator_1=contains&value_1=royal&resultSetSize=40
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="mm.clients.axaapi" totalRecordCount="27"> <Record counter="4"> <Fields> <Field name="address_4" /> <Field name="address_3">SALFORD</Field> <Field name="endorsements">N</Field> <Field name="client_id">HOP001</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">M6 8HD</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">STOTT LANE</Field> <Field name="hospital_name">SALFORD ROYAL HOSPITAL</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>33.77</Miles> <KM>54.35</KM> </Distance> </Record> <Record counter="5"> <Fields> <Field name="address_4" /> <Field name="address_3">OLDHAM</Field> <Field name="endorsements">N</Field> <Field name="client_id">MRI336</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">OL1 2JH</Field> <Field name="network_marker">Y</Field> <Field name="address_2" /> <Field name="address_1">ROCHDALE ROAD</Field> <Field name="hospital_name">ROYAL OLDHAM HOSPITAL</Field> <Field name="hospital_type">SCANNING CENTRE</Field> </Fields> <Distance> <Miles>27.42</Miles> <KM>44.13</KM> </Distance> </Record> <Record counter="6"> <Fields> <Field name="address_4" /> <Field name="address_3">OLDHAM</Field> <Field name="endorsements">N</Field> <Field name="client_id">ROY038</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">OL1 2JH</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">ROCHDALE ROAD</Field> <Field name="hospital_name">ROYAL OLDHAM HOSPITAL</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>27.42</Miles> <KM>44.13</KM> </Distance> </Record> <Record counter="7"> <Fields> <Field name="address_4" /> <Field name="address_3">MANCHESTER</Field> <Field name="endorsements">N</Field> <Field name="client_id">MAN004</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">M13 9WH</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">OXFORD ROAD</Field> <Field name="hospital_name">MANCHESTER ROYAL EYE HOSPITAL</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>29.60</Miles> <KM>47.64</KM> </Distance> </Record> <Record counter="8"> <Fields> <Field name="address_4" /> <Field name="address_3">MANCHESTER</Field> <Field name="endorsements">N</Field> <Field name="client_id">ROY032</Field> <Field name="address_5">GREATER MANCHESTER</Field> <Field name="pc">M27 4HA</Field> <Field name="network_marker">N</Field> <Field name="address_2" /> <Field name="address_1">PENDLEBURY</Field> <Field name="hospital_name">ROYAL MANCHESTER CHILDRENS HOS</Field> <Field name="hospital_type">Acute</Field> </Fields> <Distance> <Miles>33.90</Miles> <KM>54.55</KM> </Distance> </Record> </RecordSet> </RecordSets>
If you have purchased the Multimap API V1.2 Routing module, you can use it to generate a route and also find search results along a route between two or more locations. For more details, please refer to Multimap API V1.2 documentation on Searching along Route or Basic Routing.
You can obtain search results along a route between two or more locations within a specified distance from the route. This means that you can vary your search parameters to specify two or more locations, then find all the store records from your table of addresses that fall within a radius (of a specified size) centered on any point along that route. The "Search along Route" feature can generate routes that link numerous locations by processing a list of locations, treating the list's:
This means that you can use the Searching web services to control the order of 'via' points of a route or to 'optimize' them by ordering them automatically.
A detailed list of Search along a Route parameters, their description and values is as follows:
[Note: Please replace "parameter_[COUNTER] by incremental numbers
such as parameter_1, parameter_2,...,parameter_n.
Here, parameter_1 is used for the first route point and parameter_2
for the second route point.]
| Parameter | Description | Valid values | Mandatory |
|---|---|---|---|
countryCode_[COUNTER] |
This parameter refers to a two-letter ISO country code for the input address. It returns a result which is the center of the spatial search. | Two-letter ISO country code | No |
dataSource_[COUNTER] |
This parameter specifies the data source to use for a particular route point. | String | No |
exclude_[COUNTER] |
This parameter specifies whether to try to avoid highways or motorways. | "highways" or "motorways" | No |
fieldname_[COUNTER] |
This parameter specifies the name of the field in the data source on which to filter. | String | No |
key_[COUNTER] |
This parameter refers to a Multimap route key which encapsulates the route points and options. | String | No |
lat_[COUNTER] |
This parameter refers to the latitude coordinate for a particular route point. It returns a result which is the center of the spatial search. | Float | No |
lon_[COUNTER] |
This parameter refers to the longitude coordinate for a particular route point. It returns a result which is the center of the spatial search. | Float | No |
mode_[COUNTER] |
This parameter specifies whether to generate a driving or walking route (where available); it gives a driving route by default. | "driving" or "walking" | No |
operator_[COUNTER] |
This parameter specifies the operator to be used in the field filter. | String | No |
optimizeFor_[COUNTER] |
This parameter specifies whether to generate the quickest or shortest route; it shows the quickest by default. | "distance" or "time" | No |
qs_[COUNTER] |
This parameter refers to an address or place name entered as a single string,
usually with countryCode. It returns a result which is the center of the spatial search. |
String | No |
value_[COUNTER] |
This parameter specifies the value used in the fieldfilter search. |
String | No |
In response to a "Search along Route" request:
http://clients.multimap.com/API/search/1.2/[api_key]?count=10&maxDistance=1&returnFields=client_id,name,street,town,pc,
lat,lon&qs_1=ec4a2dy&countryCode_1=GB&qs_2=l19&countryCode_2=GB
&mode=walking
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="17"> <Record counter="1"> <Fields> <Field name="client_id">37</Field> <Field name="name">Woburn Abbey</Field> <Field name="street" /> <Field name="town">BEDFORD</Field> <Field name="pc">MK43 0TP</Field> </Fields> <Point> <Lat>52.01300</Lat> <Lon>-0.58070</Lon> </Point> </Record> <Record counter="2"> <Fields> <Field name="client_id">80</Field> <Field name="name">Tabley House</Field> <Field name="street">Chester Road</Field> <Field name="town">KNUTSFORD</Field> <Field name="pc">WA16 0HB</Field> </Fields> <Point> <Lat>53.29560</Lat> <Lon>-2.41250</Lon> </Point> </Record> <Record counter="3"> <Fields> <Field name="client_id">430</Field> <Field name="name">British Museum</Field> <Field name="street">Great Russell Street</Field> <Field name="town">LONDON</Field> <Field name="pc">WC1B 3DG</Field> </Fields> <Point> <Lat>51.51830</Lat> <Lon>-0.12630</Lon> </Point> </Record> <Record counter="4"> <Fields> <Field name="client_id">437</Field> <Field name="name">Courtauld Gallery</Field> <Field name="street">Strand</Field> <Field name="town">LONDON</Field> <Field name="pc">WC2R 0RN</Field> </Fields> <Point> <Lat>51.51100</Lat> <Lon>-0.11800</Lon> </Point> </Record> <Record counter="5"> <Fields> <Field name="client_id">440</Field> <Field name="name">The Dickens House Museum</Field> <Field name="street">Doughty Street</Field> <Field name="town">LONDON</Field> <Field name="pc">WC1N 2LF</Field> </Fields> <Point> <Lat>51.52360</Lat> <Lon>-0.11740</Lon> </Point> </Record> <Record counter="6"> <Fields> <Field name="client_id">441</Field> <Field name="name">Dr Johnson's House</Field> <Field name="street">Gough Square</Field> <Field name="town">LONDON</Field> <Field name="pc">EC4A 3DE</Field> </Fields> <Point> <Lat>51.51450</Lat> <Lon>-0.10920</Lon> </Point> </Record> <Record counter="7"> <Fields> <Field name="client_id">443</Field> <Field name="name">Gilbert Collection</Field> <Field name="street">Strand</Field> <Field name="town">LONDON</Field> <Field name="pc">WC2R 0RN</Field> </Fields> <Point> <Lat>51.51100</Lat> <Lon>-0.11800</Lon> </Point> </Record> <Record counter="8"> <Fields> <Field name="client_id">448</Field> <Field name="name">The Jewish Museum</Field> <Field name="street">129 Albert Street</Field> <Field name="town">LONDON</Field> <Field name="pc">NW1 7NB</Field> </Fields> <Point> <Lat>51.53660</Lat> <Lon>-0.14430</Lon> </Point> </Record> <Record counter="9"> <Fields> <Field name="client_id">454</Field> <Field name="name">London Transport Museum</Field> <Field name="street">Covent Garden</Field> <Field name="town">LONDON</Field> <Field name="pc">WC2E 7BB</Field> </Fields> <Point> <Lat>51.51200</Lat> <Lon>-0.12220</Lon> </Point> </Record> <Record counter="10"> <Fields> <Field name="client_id">460</Field> <Field name="name">Museums of the Royal College of Surgeons</Field> <Field name="street">Lincolns Inn Fields</Field> <Field name="town">LONDON</Field> <Field name="pc">WC2A 3PN</Field> </Fields> <Point> <Lat>51.51460</Lat> <Lon>-0.11640</Lon> </Point> </Record> </RecordSet> </RecordSets>
Just as you can search from a point specified as an address, you can also search
from a point specified by a search that returns a single result.
For instance, you may have a list of store addresses and a list of hotel addresses.
Using a preSearch, you can find the closest stores to a particular hotel or vice versa.
It is also possible that these addresses are in two different data sources.
Such a search is enabled using the preSearchFilters and preSearchDataSource parameters.
For example:
http://clients.multimap.com/API/search/1.2/[api_key]?preSearchDataSource=[datasource1]&fieldname_1=hotel_id
&value_1=12&preSearchFilters=1&dataSource=[datasource2]&count=10
This will find the ten stores nearest to the hotel whose hotel_id=12.
The parameter preSearchFilters=1 indicates that field filters with a counter less than or equal to "1"
should be used as a part of preSearch with any other field filter
used as part of the main search (none, in this case).
Compound searching is a powerful method to use multiple search operators in one query to obtain a result set.
It includes operations such as equals (eq), sounds like (sl), startswith,
endswith, char order (co) and contains.
Each operation is applied sequentially until your selected compound threshold is reached
or until all operators have been attempted.
The locale parameter lets you create different versions of the Multimap API
that offer support in several different languages (where applicable),
by specifying the user's language and geographic area, for:
http://clients.multimap.com/API/search/1.2/[api_key]?locale=es-ES &street=Calle%20Luis%20Vivies&city=20Santa%20Cruz%20de%20Tenerife&countryCode=ES
http://clients.multimap.com/API/search/1.2/[api_key]?locale=fr-FR &city=Fort-de-France&countryCode=MQ
http://clients.multimap.com/API/search/1.2/[api_key]?locale=en-GB &street=15%20Oxford%20Street&city=London&countryCode=GB
Please follow this link to see a
full list of permissible values for the locale parameter.
If you have a Multimap service that includes records for stores located in the People's Republic of China (PRC) that have been geocoded to street level, legal restrictions mean that Multimap cannot expose those stores' coordinates either to you or to your users by any means, whether via Client Zone, in downloaded files or in any customer-designed interface. Specifically, this means that you:
Street-level geocoding in the PRC is currently available via the Multimap API only. For further details of how this restriction affects your Multimap service(s), please see Multimap's separate Geocoding and Data Management in Client Zone: Implementation Guidelines documentation which is available via Client Zone or from your Multimap account manager.
In the event of a service failure or a failure to provide valid parameters, the Multimap API V1.2 web services return an error code. Some of these error codes are specific to a particular web service while some are common to all the three web services (Geocoding, Searching and Routing). Please see these Error Codes to know more about them.
In response to a search that did not match:
http://clients.multimap.com/API/search/1.2/[api_key]?fieldname_1=id&value_1=notmatching&qs_2=RG1&countryCode_2=GB
&mode=walking
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]" totalRecordCount="0" /> </RecordSets>
For each data source that has an error (for example, if you specify "county" as a fieldname
in a table that does not have a county field),
the MM_API_ERROR_DATABASE_QUERY_FAILED error code is returned for all requests.
In response to an incorrect field name:
http://clients.multimap.com/API/search/1.2/[api_key]?qs=EC4&returnFields=name,street,county,country&count=10
&city=London&countryCode=GB
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]"> <Error> <ErrorCode>MM_API_ERROR_DATABASE_QUERY_FAILED</ErrorCode> <Explanation>Your request failed. Invalid field name: county</Explanation> </Error> </RecordSet> </RecordSets>
In response to an search where startIndex parameter is greater than resultSetSize parameter:
http://clients.multimap.com/API/search/1.2/[api_key]?qs=S105RS&maxDistance=50&distanceUnits=miles&count=3&orderByFields=hospital_name
&startIndex=21&returnFields=client_id,hospital_name,address_1,address_2,address_3,address_4,address_5,pc,hospital_type
&fieldname_1=hospital_name&operator_1=contains&value_1=royal&resultSetSize=20
<?xml version="1.0" encoding="UTF-8" ?> <RecordSets xmlns="http://clients.multimap.com/API" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clients.multimap.com/API http://clients.multimap.com/Schema/search_1.2.xsd"> <RecordSet dataSource="[datasource1]"> <Error> <ErrorCode>MM_API_ERROR_START_INDEX_GREATER_THAN_RESULT_SET_SIZE</ErrorCode> <Explanation>The start index must be less than the result set size.</Explanation> </Error> </RecordSet> </RecordSets>
The Multimap Searching web service XML schema defines a set of rules to which an XML document must conform in order to be considered valid according to that schema.
Please see the Searching web service XML schema example at http://clients.multimap.com/Schema/search_1.2.xsd.
Please also see the Searching web service schema documentation at http://clients.multimap.com/Schema/docs/search_1.2.xsd.html.
Web Services Home >> Static Maps >> Geocoding >> Routing
If you require further help with your Multimap service implementation, additional Multimap services or general account enquiries, please contact Multimap:
| Sales: | +44 (0)20 7632 7800 |
| Customer Support: | +44 (0)20 7632 7777 |
| email: | mminform@microsoft.com |