Metadata API

The Brain Image Library (BIL) provides both a metadata API and web portal that uses the API to search and return metadata and links to datasets in BIL. The metadata API is extremely flexible and capable of full-text searching or individual metadata fields.

The metadata API has two primary user-facing endpoints:

To make full programatic use of the Metadata API, we recommend that interested users first familiarize yourself with BIL's metadata model

Example Results

All successful queries will return a json file, that will all have the following json keys:

There will be other keys in the json payload, based on the metadata element and the search string. Here are a few examples:

When one retreives an entry, the json payload returned will look like: Note that if one retreives MULTIPLE entries via a PUT request, there will be multiple objects returned in the retjson array

Errors

When the API detects an error it will return a json message indicating the error. typical keys returned in the json payload include: Here is an example (using CURL) if a POST was issued instead of GET: Handling Partial Sucesss/ Partial Failure: This currently will only happen if one uses the /retreive endpoint with a post request. In such cases keys: Here is a brief example of what the beginning of the returned json document will look like:
     {
     "success": "true",
     "endpoint": "Retrieve",
     "message": "POST partially successful, some entries retreived",
     "status": {
          "act-zip": true,
          "ace-bay-low": true,
          "ace-aim-gum": false,
          "ace-ask-row": false,
          "ace-boo-dip": true
        },
     "retjson": [ ... ]
     }

Additional Examples

Some examples using the web browser:

https://api.brainimagelibrary.org/query/fulltext?text=broad
https://api.brainimagelibrary.org/query/funders?award_number=1-RF1-MH-124598-01
https://api.brainimagelibrary.org/query/submission?doi=rut
https://api.brainimagelibrary.org/query/contributors?affiliation=Broad
https://api.brainimagelibrary.org/query/contributors?creator=Yes
https://api.brainimagelibrary.org/query/instrument?microscopetype=upright
https://api.brainimagelibrary.org/query/instrument?objectivename=olympus
https://api.brainimagelibrary.org/query/specimen?localid=f024
https://api.brainimagelibrary.org/query/dataset?title=mouse
https://api.brainimagelibrary.org/query/image?gbytes=17.0
https://api.brainimagelibrary.org/query/publication?relatedidentifier=doi
https://api.brainimagelibrary.org/retrieve?bildid=rut
https://api.brainimagelibrary.org/retrieve?doi=https://doi.org/10.35077/rut

Some examples accessing the API using curl are shown below:

curl -k -X GET  'https://api.brainimagelibrary.org/query/fulltext?text=broad'
curl -k -X GET  'https://api.brainimagelibrary.org/query/funders?award_number=1-RF1-MH-124598-01'
curl -k -X GET  'https://api.brainimagelibrary.org/query/submission?doi=rut'
curl -k -X GET  'https://api.brainimagelibrary.org/query/contributors?affiliation=Broad'
curl -k -X GET  'https://api.brainimagelibrary.org/query/contributors?creator=Yes'
curl -k -X GET  'https://api.brainimagelibrary.org/query/instrument?microscopetype=upright'
curl -k -X GET  'https://api.brainimagelibrary.org/query/instrument?objectivename=olympus'
curl -k -X GET  'https://api.brainimagelibrary.org/query/specimen?localid=f024'
curl -k -X GET  'https://api.brainimagelibrary.org/query/dataset?title=mouse'
curl -k -X GET  'https://api.brainimagelibrary.org/query/image?gbytes=17.0'
curl -k -X GET  'https://api.brainimagelibrary.org/query/publication?relatedidentifier=doi'

curl -k -X GET  'https://api.brainimagelibrary.org/retrieve?bildid=rut'
curl -k -X GET  'https://api.brainimagelibrary.org/retrieve?doi=https://doi.org/10.35077/rut'