Opendata API Documentation

We are continuing to add datasets over time and look forward to seeing how citizens use the data to enrich our community.

 

 

The OpenData API is a web service that is accessed through the following URL:
http://opendata.brandon.ca/opendataservice/Default.aspx
Visiting the URL directly will provide a list of names of available datasets in XML format.


Using the name of the desired dataset, the dataset query variable can be set to return a list of all column names and data types for the dataset.
http://opendata.brandon.ca/opendataservice/Default.aspx?dataset=property
This query returns all the columns and their respective data types for the property dataset.


To request data from a dataset the columns and values query variables can be set return the records with columns that match the requested values.
http://opendata.brandon.ca/opendataservice/Default.aspx?dataset=property&columns=dROLLNMBR&values=3806
This query returns the records for all properties with roll numbers containing 3806. Notice that multiple records are returned.


To narrow results further, multiple column names can be put into the columns variable with each column name separated by a semi-colon.
http://opendata.brandon.ca/opendataservice/Default.aspx?dataset=property&columns=dROLLNMBR;STREET_ADDRESS&values=3806;410
This query returns only the record for the property with a roll number containing 3806 and street address containing 410.


To match a roll number exactly, the compare query variable can be set to "equal" (by default it is set to "contains").
http://opendata.brandon.ca/opendataservice/Default.aspx?dataset=property&columns=dROLLNMBR&values=3806&compare=equal
This query only returns the record for the property with a roll number of 3806.


The default data format is XML, but can be changed by setting the format query variable to "json" to return JSON formatted data.


For an interactive demonstration of the API please visit the API Test Page.


Query Variables and Values

datasetAny dataset listed by a default service query.
columnsAny column(s) listed for a dataset by a dataset information query.
valuesAny value(s) of the correct data type for the column(s) being queried.
formatxml, json, jsonp (Default: xml)
comparecontains, equal, gt, lt, gte, lte (Default: contains)
limitAny number up to 1000 (Default: 100)