API Documentation - JoePeacock/CrowdHydrologyMobile GitHub Wiki

Overview v1.1

This is the Crowd Hydrology API Reference. This is up to date as of the release version indicated.

Endpoints

/api/stations [GET]

Returns a paginated list of data logging stations.

per_page (int): The number of results to return.

page (int): The offset of results, equivalent to (per_page * page).

lat (float): Optional- If used this will find the closest station to the provided latitude.

long (float): Optional- If used this will find the closest station to the provided longitude.

Example: /api/stations?per_page=20&page=3&lat=34.56789&long=-78.906785


/api/data/:station_id [GET]

Returns a paginated list of data points from a specific station.

per_page (int): The number of results to return.

page (int): The offset of results, equivalent to (per_page * page).

Example: /api/data/NY1000?per_page=20&page=3


/api/data [POST]

Returns a full data set with stations and data points combined.

start_time (int): Optional - POSIX timestamp value to filter by, anything greater than or equal to this will be included.

end_time (int): Optional - POSIX timestamp value to filter by, anything less than or equal to this will be included.

stations ([int]): Optional - Stations to retrieve data from. (id = database ID (ie. 23), not Station id (ie. NY1000))

Example: /api/data { start_time: 1234567899, end_time: 1234567990, stations: [4, 15, 23] }