Skip to content
RETIRED - Tyro will not be maintained further. Tyro is a simple wrapper around the Sierra API. It adds a /new endpoint for new items, makes finding an item status super easy, and makes authentication much easier to manage.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Tyro: A Sierra API Wrapper

Ty·ro: noun, a beginner or novice.

Build Status


Tyro is a standalone executable, written in Go. It should compile in Go 1.3.3 and higher. A web server like Nginx or Apache is not required to use it, but in a production environment serving behind nginx with a reverse cache is recommended.

./tyro -key=yourclientkey -secret=yourclientsecret -url=yourapiurl

Tyro requires the following command line options:

-key= : a client key obtained from your Sierra API, doc here:
-secret= : a client secret created for the client key
-url= : the url for the Sierra API. (For example, the sandbox is

These options are optional:

-address= : The address to serve on, passed to ListenAndServe, doc here: Defaults to ":8877". 
-raw : If supplied, this flag will turn on access to the raw Sierra API under /raw/. 
-acaoheader= : The origin to place in the Access-Control-Allow-Origin header.
               Defaults to *. Is only used for the /status/bib/[bibID] and /status/item/[itemID] endpoints. 
               Multiple origins can be supplied, delimit with the ; character. 
-certfile= : The location of the Certificate file, for HTTPS.
-keyfile= : The location of the Private Key file, for HTTPS.
-logfile= : Log file. By default, log messages will be printed to stout.
-logmaxage= : The maximum number of days to retain old log files, in days.
-logmaxbackups= : The maximum number of old log files to keep.
-logmaxsize= : The maximum size of log files before they are rotated, in megabytes.
-loglevel= : The log level. One of error, warn, info, debug, or trace. 
-newlimit= : The number of items to return at the /new endpoint

These flags can also be supplied by environment variables:


This Twelve-Factor style should make it easy to daemonize or Docker-ize this app. The TYRO_RAW environment variable, if set, should be True or False. Log rolling is provided by lumberjack.


Tyro provides the following URLs (endpoints?, routes?)

/ : Home page, HTML
/status/bib/[bibID] : Status JSON, returns a JSON doc like:
      Entries: [
          CallNumber: " JC578.R383 G67 2007",
          Status: "IN LIBRARY",
          Location: "Floor 4 Books"
/status/item/[itemID] : Status JSON, returns a JSON doc like: 
        CallNumber: " JC578.R383 G67 2007",
        Status: "IN LIBRARY",
        Location: "Floor 4 Books"
/new : A list of new bib records, returns a JSON doc like:
           BidID: 7777777,
           TitleAndAuthor: "A Title /An Author.",
           ISBNs: [
           CreatedDate: "2015-01-22T08:00:00Z"

This extra endpoint will be provided if -raw is passed as a flag or the TYRO_RAW environment variable is set to True.

/raw : A thin wrapper around the Sierra API. Tyro will take care of the bearer tokens and X-Forwarded-For header. 

The /status/bib/[bibID], /status/item/[itemID] and /new endpoints are the only ones that will respect the Access-Control-Allow-Origin header. If the 'raw' setting is turned on, requests sent to /raw/ will receive whatever the Sierra API would return if the client had authenticated itself.

This software is now in beta. Please create issues for bugs or feature requests.


Joe Montibello,

You can’t perform that action at this time.