Global Record of Stocks and Fisheries (GRSF) - API

/stocks

Method GET
Description Searches for all stocks and retrieves basic information about each stock
Response Codes 200, 404, 500
Response Types* JSON (application/json),
XML (application/xml),
HTML (text/html),
CSV (text/csv),
N3 (text/n3)
URL /resources/stocks
Examples - Get all stocks with reporting year equals to 2018
- Get all stocks with reporting year before to 1900
- Get all stocks with reporting year between to 2015 and 2016
- Get all stocks with reporting year equals to 2015 in CSV
*: The response type can be specified using the Accept header in the GET request or using the response_type parameter

Parameters

Name Type Description
from_year integer Retrieves only the stock records for which there is at least one time series with reporting year equals to the given year value
before_year integer Retrieves only the stock records for which there is at least one time series with reporting year before the given year value
after_year integer Retrieves only the stock records for which there is at least one time series with reporting year after the given year value
from_source string The name of the database source that provided the record. It can be any of the following: [FIRMS, RAM, FishSource].
response_type string The response type. It can be any of the following: [JSON, XML, HTML, CSV, N3].
*: All the parameters described above are optional.

Response

The response is an array of results (stocks). Each result contains the following information: 

name the short name of the stock
uuid the unique identifier of the stock
semantic_id the unique semantic identifier of the stock
type the type of the stock (it can any of [marine resource, assessment unit])
status the status of the record (it can be any of [pending, approved, rejected])
url the public URL of the stock in the GRSF catalogue
reporting_years the reporting years of the stock
database_source the database sources that contribute with infromation for this stock

An indicative output (in JSON format) is shown below:

[
    {
        "name": "gadus macrocephalus Pacific, Northeast",
        "uuid": "d290f1ee-6c54-4b01-90e6-d701748f0851",
        "semantic_id": "asfis:PCO+fao:67",
        "type": "Marine Resource",
        "status": "approved",
        "url": "http://localhost",
        "reporting_years": [2008, 2018]
        "database_source": [FIRMS, FishSource]
    }
]

/stock_data

Method GET
Description Searches for time-series information of particular stocks
Response Codes 200, 404, 500
Response Types* JSON (application/json),
XML (application/xml),
HTML (text/html),
CSV (text/csv),
N3 (text/n3)
URL /resources/stock_data
example - Get all times-series of the stock with UUID 18db16cc-2caa-34dc-aad0-b30ff5eeb078
- Get the times-series about Biomass and Fishing Pressure of the stock with UUID 18db16cc-2caa-34dc-aad0-b30ff5eeb078
- Get all times-series of the stock with UUID 18db16cc-2caa-34dc-aad0-b30ff5eeb078 in CSV
*: The response type can be specified using the Accept header in the GET request or using the response_type parameter

Parameters

Name Type Description
uuid* String The unique identifier (UUID) of the stock (which is retrieved from /stock endpoint).
type String A comma-separated list of the types of timeseries to search for. It can be any of the following: [catches, landings, abundlevel, abundlevelstd, fishingpres, fishingpresstd]. If no types are given then all the timeseries that are available for the stock will be returned.
response_type string The response type. It can be any of the following: [JSON, XML, HTML, CSV, N3].
*:The parameter uuid is mandatory, all the other are optional.

Response

The response is an array of results (timeseries). Each result contains the following information: 

time-series_type The type of the time-series value
value the value of the timeseries
unit the unit of the timeseries
reference_year the reference year of the timeseries
reporting_year the reporting year of the timeseries
database_source the database source that provided the record
data_owner the organization that is responsible for reporting the timeseries of the record

An indicative output (in JSON format) is shown below:

[
    {
        "timeseries_type": "Fishing Pressure",
        "value": "8.627272727",
        "unit": "UdivUmsypref",
        "reference_year": "2005",
        "reporting_year": "2016",
        "database_source": "RAM",
        "data_owner": "STECF"
    }
]