Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

koodilehto/trafi-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status

trafi-api

API for trafi vehicle dataset.

Usage

  1. Download CSV from Trafi and point the API by copying config/config.template.js as config./config.js and tweaking registrationPath. It looks into project root by default.
  2. npm install - Install dependencies
  3. ./load_data.js - Load initial data to db (MongoDB).
  4. npm start - Run server
  5. 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.

License

trafi-api is available under MIT. See LICENSE for more details.

About

API for Trafi registration data (MIT)

Resources

License

Stars

Watchers

Forks

Packages

No packages published