-
API Endpoint for Traffic Data
- API Endpoint for Traffic Data
Hosting is at http://api.hitraffic.org/v1
DESCRIPTION:
The default route.
SPECS:
> URL may contain one or more of the following query parameters:
- from: Fetch incidents beginning from this date. Should be in a unix timestamp format.
- to: Fetch incidents up to this date. Should be in a unix timestamp format.
- area: Area as defined by GET /areas
- type: Incident type as defined by GET /types
EXAMPLES:
GET /incidents?from=2014-10-31T23:59:59Z
- Fetch all incidents that happened since 10/31/2014 11:59:59PM.
GET /incidents?from=2014-10-31T23:59:59Z&to=2015-01-01T00:00:00Z
- Fetch all incidents that happened between 10/31/2014 11:59:59PM and 1/1/2015 12:00:00AM.
DESCRIPTION:
Retrieves all motor vehicle incidents in past 2 years.
SPECS:
Returns all motor vehicle incidents in 2 years.
ROUTES:
[incidents](http://api.hitraffic.org/v1/incidents/)
__________________________________________________________________________
## GET /areas
DESCRIPTION:
Fetches all areas in the database.
SPECS:
This should just return an array, i.e. [‘HONOLULU’, ‘KANEOHE’, ‘PEARL CITY’].
The array should contain unique values, i.e., don’t list ‘Honolulu’ twice.
DESCRIPTION:
Fetches all incident types.
SPECS:
This should just return an array, i.e. [‘MOTOR VEHICLE COLLISION’, ‘HAZARDOUS DRIVER’, ‘STALLED/HAZARDOUS VEHICLE’, ‘TRAFFIC INCIDENT - NO COLLISION’, ‘TRAFFIC NUISANCE OR PARKING VIOLATION’].
The array should contain unique values.
__________________________________________________________________________
- Clone/fork this project
npm install
- Create a
.env
file that contains your configuration. An example is provided in .env.example
.
- Run
npm start
.