/
TERN Discovery Portal API Design Document

TERN Discovery Portal API Design Document

The API presents a simple interface based on the Opensearch standard. It’s a REST API that returns search results for HTTP queries. It supports for simple, list-based result formats makes the service suitable for AJAX style integration into web application.


The results are returned in JSON format. Alternate result formats such as Atom can be added in the future.


Endpoint

The base URL and service endpoint for the TERN Data Discovery Portal API is

http://portal-dev.tern.org.au/api_tern

Requested Format
http://portal-dev.tern.org.au/api_tern?keyword={KEYWORD}&count={COUNT}

It currently only support searches based on keyword, temporal, license, FoR, facility and states region. for example

http://portal-dev.tern.org.au/api_tern?keyword=koala&count=10

returns first 10 records that contain “koala” across all metadata fields

Result formats

Results are returned in JSON format. If no results found, the returned JSON object will be empty. 

Error
Errors are returned as JSON format like below

{"error":"Error occured"}

Use Cases:

  1. search by keyword
    The example below returns first 15 records with koala in any of its metadata fields. If count parameter is not supplied, it iwll be set to 10 by default.
    http://portal-dev.tern.or.au/api_tern?keyword=koala&count=15

  2. search by temporal
    The example below returns first 15 records with 'dated_from' before 2001 and 'dated_to' after 2005 
    http://portal-dev.tern.or.au/api_tern?temporal=2001-2005&count=15

  3. search by FoR values
    The example below returns first 15 records which contains word 'environment' in their FoR values.
    http://portal-dev.tern.org.au/api_tern?for=environment&count=15

  4. search by abbreviated facility name
    The exple below returns the first 15 records which belongs to Ozflux facility. 
    http://portal-dev.tern.org.au/api_tern?facility=ozflux
    The accepted values for the 'facility' parameter by each facility are as follow:

    Facility nameAccepted values
    Long-term ecological research networkltern
    Advanced Ecological Knowledge and Observation Systemecoinformatics, aekos
    Australian Coastal Ecosystem Facilityacef,coastal
    ACEASaceas
    AusCoverauscover
    Australian Supersite Networksupersite, supersites
    Ozfluxozflux
    National Computational Infrastructureemast, nci
    Commonwealth Scientific and Industrial Research Organisationsoils,csiro,csiro_soils


  5. search by license name
    The example below returns the first 15 records which has their license type "CC-BY". This api query is not a wildcard query so it will only return records with exact match in their license type.
    http://portal-dev.tern.org.au/api_tern?license=cc-by&count=15

  6. search by topic. for example: http://portal-dev.tern.org.au/api_tern?topic=vegetation this query returns results by topic names

    TopicAccepted values
    Plants and animalsplants_and_animal
    Vegetationvegetation
    Terrestrial Ecosystemsterrestrial_ecosystems
    Ecological Dynamicsecological_dynamics
    Fresh Water and Estuarinefresh_water_and_estuarine
    Land surface and Soilsland_surface_and_soils
    Agricultureagriculture
    Oceans and Coastsoceans_and_coasts
    Climateclimate
    Human Nature Interactionshuman_nature_interactions
    Energy Water and Gas Exchangeenergy_water_and_gas_exchange
  7. search by abbreviated states name
    This example returns first 20 records in a given Australian state. 
    http://portal-dev.tern.org.au/api_tern?state=qld&count=20
    The accepted values for the 'region' parameter are listed below

    StateAccepted values
    New South Walesnsw
    Queenslandqld,queensland
    Victoriavic, victoria
    South Australiasa
    Western Australiawa,
    Nothern Territorynt
    Australian Capital Territoryact
    Tasmaniatas, tasmania

Related content

Provision and Configure TDDP instance on Nectar cloud
Provision and Configure TDDP instance on Nectar cloud
Read with this
TDDP Release 5.0
TDDP Release 5.0
More like this
TERN DDP
TERN DDP
More like this