Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time

Static API Build Status

Creates a static API from a CSV file and publishes it to a static web server using Travis CI. Inspired by @waldoj's instant-api.


Name, Animal, Color
Fido, Dog, Brown
Whiskers, Cat, Black
Mini, Elephant, Grey


  {"Name": "Fido", "Animal": "Dog", ...},
  {"Name": "Whiskers", ...}

{"Name": "Fido", "Animal": "Dog", ...}

{"Name": "Whiskers", ...}


The example file in this repository, sample_data.csv, is automatically published to the gh-pages branch by Travis CI and can thus be viewed at, /sample-data/23.json, etc..

Manual Usage

  1. Clone this repository
  2. run bundle install to install dependencies
  3. Execute via command line using an environment variable
PRIMARY_KEY=<key> ruby static-api.rb

Automated Usage via Travis CI

  1. Fork this repository
  2. Enable Travis CI integration for your fork on the travis dashboard
  3. Generate a new GitHub personal access token (with public_repo access)
  4. On the Travis CI settings page for your fork (, add your new personal access token as an environment variable with the name GITHUB_TOKEN. Do not enable the "Display value in build log" toggle (it's disabled by default).
  5. Add another environment variable called PRIMARY_KEY set to the field name to use as the CSV file's primary key.
  6. Add your .csv file to your fork by drag-and-dropping, using's CSV editor, or using traiditional git and push your changes to the master branch (default).

Travis CI will be triggered by a push to the master branch, build your Static API, and push it to the gh-pages branch, allowing you to view it at

Hey, do you have thoughts on a better way to use this? Join the conversation!


Creates a static API from a CSV file



No releases published
You can’t perform that action at this time.