API for trafi vehicle dataset.
- Download CSV from Trafi and point the API by copying
config/config.template.js
asconfig./config.js
and tweakingregistrationPath
. It looks into project root by default. npm install
- Install dependencies./load_data.js
- Load initial data to db (MongoDB).npm start
- Run server- Navigate to
http://localhost:8000/v1/
. That will show the resources available. Pick one and append it to the URL.
Possible queries have been listed at rest-sugar. Only GET
is allowed and maximum amount of items per page has been restricted in configuration. Use pagination to access all items.
Note that the current system loads the whole dataset to memory on start! It would be possible to rearchitect this to use some real database if needed.
If you use the API, remember to include attribution for Trafi as instructed at the licensing terms.
trafi-api
is available under MIT. See LICENSE for more details.