ropensci/fishbaseapi

Name: fishbaseapi

Owner: rOpenSci

Description: Fishbase API

Created: 2015-02-03 00:42:01.0

Updated: 2017-11-28 00:05:07.0

Pushed: 2017-12-23 06:10:18.0

Homepage: https://fishbaseapi.readme.io/

Size: 347

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

FishBase API

Build Status

This is a volunteer effort from rOpenSci to provide a modern RESTful API to the backend SQL database behind the popular web resource, fishbase.org. The FishBase team have provided a snapshot of the database for our development purposes only and have expressed interest in hosting the finished API as a resource for all their users.

User quick start

At this time, this API is deployed for development purposes only. The testing server may be available only intermittently and all endpoints are subject to change. Please check back here for updates when the API is officially released by FishBase.org.

Letsencrypt and Java

We use Letsencrypt for https, but older Java versions don't trust Letsencrypt certs. However, recent Java versions fix this problem. See https://github.com/ropensci/fishbaseapi/issues/99 for more.

Technical specifications
Quick start
Technical overview

See the docker.sh script which orchestrates the linking and running of these separate containers.

Design principles
RESTful design

The API implementation follows RESTful design. Data is queried by means of GET requests to specific URL endpoints, e.g.

https://fishbaseapi.info/species/2

Or optionally, using particular queries

https://fishbaseapi.info/species?Genus=Labroides

https://fishbaseapi.info/species?Genus=Labroides&fields=Species

Queries return data in the JSON format. By default a limit of 10 entries matching the query are returned, though this can be configured by appending the &limit= option to the query URL. Simply visit any of these URLs in a browser for an example return object.

API Endpoints

The API design is to some extent constrained by the existing schema of the FishBase.org database. At this time, endpoints correspond 1:1 with the tables of the database, and are named accordingly. Future endpoints may provide more higher-level synthesis. At this time, endpoints are implemented manually as time allows and existing use cases suggest; see issue #2 for an overview.

Richer processing of (some of) the endpoint returns can be done client-side, as illustrated in the (in-development) rfishbase2.0 R client for the API.

Database version

The Fishbase API supports multiple different versions.

You can request a different database version with a header like the following:

pt: application/vnd.ropensci.v3+json

Where 201604 follows the format YYYYMM (four digits for year, then two digits for month, with no spaces/characters between them).

By default, we return the latest date version.

See the /versions route for description of the different versions and their names.

In the R client rfishbase the database version will likely be controlled by a parameter or option/env var, so users won't have to pass headers themselves.

Why Docker?

Docker provides a fast and robust way to deploy all the necessary software required for the API on almost any platform. By using separate containers for the different services associated with the API, it becomes easier to scale the API across a cluster, isolate and diagnose points of failure. Individual containers providing services such as the MySQL database or REDIS cache can be restarted without disrupting other services of the API.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.