Log In

NM COAST
Non-Motorized Count Assurance Tool

About Count Data & Record Elements API

The NM COAST central database uses the following record elements: stations, counters, sensors, and datastreams. The NM COAST API allows for lists of these record elements, details about a given record element, count data for a record element, or flagging checks data for a record element to be requested. Where applicable, these requests can be filtered, where the most common filter is restricting results to fall between a given start and end date.

Count and flag data is not aggregated to the level of the record element specified. Instead what is received is the count and flag data applied to the associated datastreams linked to the given record element.

Additionally, although not a true record element, counting-location can be used as if it was. More information about counting-locations and why they are a useful aggregation level can be found on the section dedicated to counting-location queries.

Datastreams

DescriptionRouteOptional ParametersExample Call
List all datastreams/api/datastreamsNA/api/datastreams
Get details about given datastream/api/datastreams/:idNA/api/datastreams/103034827
Get raised flags (soft or hard) for a datastream/api/datastreams/:id/flags supports date filtering, supports flag severity filtering/api/datastreams/103034827/flags?type=all&start_date=2020-07-01&end_date=2020-07-07
Get details about flags for a datastream on given date/api/datastreams/:id/flags/:dateNA/api/datastreams/103034827/flags/2021-07-01
(POST) Update flag for a datastream on given date/api/datastreams/:id/flags/:date?action=action-typeaction-types: reject_data, accept_data, reset/api/datastreams/103034827/flags/2021-07-01?action=reset

Sensors

DescriptionRouteOptional ParametersExample Call
List all sensors/api/sensorsNA/api/sensors
Get details about given sensor/api/sensors/:nameNA/api/sensors/APX_BCG_B_P_SU
Get daily count details for elements associated to a given sensor/api/sensors/:name/counts supports date filtering, include flags (attributes=flags), include hourly counts (attributes=hourly)/api/sensors/APX_BCG_B_P_SU/counts?attributes=flags,hourly&start_date=2020-07-01&end_date=2020-07-07
Get raised flags (soft or hard) for elements associated to a given sensor/api/sensors/:name/flags supports date filtering, supports flag severity filtering/api/sensors/APX_BCG_B_P_SU/flags?type=all&start_date=2020-07-01&end_date=2020-07-07

Counters

DescriptionRouteOptional ParametersExample Call
List all counters/api/countersNA/api/counters
Get details for counter/api/counters/:nameNA/api/counters/APX_BCG
Get daily and hourly counts for counter/api/counters/:name/counts supports date filtering,/api/counters/APX_BCG/counts?start_date=2020-07-01&end_date=2020-07-07
Get raised flags (soft or hard) for counter/api/counters/:name/flags supports date filtering, supports flag severity filtering/api/counters/APX_BCG/flags?start_date=2020-07-01&end_date=2021-07-07

Stations

DescriptionRouteOptional ParametersExample Call
List all stations/api/stationsNA/api/stations
Get details for station/api/stations/:nameNA/api/stations/APX_OLI

Counting-Location

A counting-location consists of a counter and which side of the street (or just path if located off of a street) it is located on. For API calls, their naming convention consists of the counter's name and the side of the street it's on (or path) joined by two underscores (e.g. APX_BCG__Path). The use of counting-locations are valuable as a single counting location will only ever have at most 1 linked pedestrian sensor, 1 linked road cyclist sensor, and 1 linked sidewalk or path cyclist sensor. Occasionally, a single counter might have a 2 linked road cyclists sensors (one on each side of the road).

DescriptionRouteOptional ParametersExample Call
List all counting-locations/api/counting-locations include if unresolved flags are present (supports date filtering)/api/counting-locations?attributes=unresolved&start_date=2021-06-06&end_date=2021-07-10
Get details for a counting-location/api/counting-locations/:nameNA/api/counting-locations/APX_OLI__North
Get daily and hourly counts for counting location/api/counting-locations/:name/counts supports date filtering, include flags (attributes=flags),/api/counting-locations/APX_OLI__North/counts?start_date=2020-07-01&end_date=2020-07-07
Get raised flags (soft or hard) for counting location/api/counting-locations/:name/flags supports date filtering, supports flag severity filtering/api/counting-locations/APX_OLI__North/flags?start_date=2020-07-01&end_date=2021-07-07