Travel Montana Site Information Web Service

The web services on this page provide information on sites and events aggregated by the Deparment of Commerce of the State of Montana.

API Endpoints

Documentation

Data Formats

For any of the categories of information you can switch between the HTML, XML and JSON views by inserting the appropriate directive in the url before the category name; /data/json/region/ for Json, /data/xml/region/ for Xml and simply /data/region for the Html version.

Search

The search system supports returning two different type of results (detailed and summaries) in the standard formats (html, xml and json). The search system is based off of a Lucene index which is created on the local filesystem. Lucene indexes are portable (can be copied between servers). The application connection string for the search system contains a 'create' flag which can be set to true to force an index to be built when the application is first started. If the flag is false the existing index is used. There is a last.log text file which contains the last modified date of the most recently changed item that is indexed.

Syntax of Searches

A search can be made by visiting /data/find/ followed by a list of terms such as /data/find/Mount Helena. There is also a summary version of the search results which contains less data and is more suited to dynamic autocomplete AJAX applications. The summary is accessed via /data/find/summary/Mount Helena.

There are 4 optional querystring parameters that can be passed into the search to modify the results. Other than the max number of results parameter all the parameters will add an additional search to the primary query which boosts results that match both queries.

All of the above parameters can be used together and any one of the parameters can have multiple criteria entered and separated by spaces.

Relavant Results

For each search result a rank number is included. This rank number is relative to the set of results returned and is not able to be associated between result sets. One way to use this rank is to look for the obvious drop in rank between the elements of the search results. For the Mount Helena query performed with an index in development the top 4 results Rank from 780-640. The rest of the series tapers from 48 down to two. For the typical search result set an application would likely want to compute a standard deviation or similar function to decide at what point the results should be truncated.

Using Amenities and Activities

Both the Amenities and Activities end points support many extra filter options including the ability to select more than one amentity or activity in the same result set. Note that there is some important information returned along with the matching sites, namely their hit rank as well as the terms they are hitting on. {"Id":"114","Name":"Chico Hot Springs Resort and Day Spa","Link":"HOTTB, BEERW","Rank":1.0} It is possible to return similar information by using the search subsystem instead.

Additional parameters

Both the amenities and the activities endpoints support several extra parameters in order to sub set the results returned. These parameters are

Flat Files

The Travel Montana data service is configured to generate XML and JSON zip archives. These files are secured through IIS authorization rules. The XML and JSON versions are both available. The system will regenerate these files automatically when the database last modified dates exceed the date the files were generated on.

Typically these files take about 15-20 minutes to generate each time they are created. During this time the files will be reported by IIS as 404 Not Found.