NeuroVault API

NeuroVault API

Health

A public repository of un-thresholded statistical maps, parcellations, and atlases of the brain. Brain parcellation — defining distinct partitions in the brain, be they areas or networks that comprise multiple discontinuous but closely interacting regions — is thus fundamental for understanding brain organization and function.

Visit API

📚 Documentation & Examples

Everything you need to integrate with NeuroVault API

🚀 Quick Start Examples

NeuroVault API Javascript Examplejavascript
// NeuroVault API API Example
const response = await fetch('https://neurovault.org/api-docs', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introduction to NeuroVault API

NeuroVault is a database of brain imaging data that can be accessed through a public API. The API allows users to programmatically search and retrieve datasets using various parameters. In this blog post, we will explore the various API endpoints and provide examples of how to use them in JavaScript.

Installation

To use the NeuroVault API, you will need to install the axios library. You can install it using npm:

npm install axios

Retrieving datasets

To retrieve datasets from NeuroVault, you can use the /api/images endpoint. The endpoint accepts several query parameters, including collection, modality, and map_type. Here's an example of how to use the endpoint to retrieve all fMRI datasets in the 'brainomics' collection:

const axios = require('axios');

axios.get('https://neurovault.org/api/images', {
  params: {
    modality: 'fMRI',
    collection: 'brainomics'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

Retrieving a single dataset

To retrieve a single dataset from NeuroVault, you can use the /api/images/<image_id> endpoint. Here's an example of how to retrieve the dataset with the id 4567:

const axios = require('axios');

axios.get('https://neurovault.org/api/images/4567')
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

Retrieving uploaded images

To retrieve the images uploaded by a specific user, you can use the /api/images/user/<username> endpoint. Here's an example of how to retrieve all images uploaded by the user 'john':

const axios = require('axios');

axios.get('https://neurovault.org/api/images/user/john')
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

Retrieving collections

To retrieve collections from NeuroVault, you can use the /api/collections endpoint. The endpoint accepts several query parameters, including owner, public, and name. Here's an example of how to retrieve all public collections:

const axios = require('axios');

axios.get('https://neurovault.org/api/collections', {
  params: {
    public: 'true'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

Retrieving a single collection

To retrieve a single collection from NeuroVault, you can use the /api/collections/<collection_id> endpoint. Here's an example of how to retrieve the collection with id 1234:

const axios = require('axios');

axios.get('https://neurovault.org/api/collections/1234')
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

Conclusion

In this blog post, we explored the various endpoints available in the NeuroVault API and provided examples of how to use them in JavaScript. The API provides a powerful tool for searching and retrieving brain imaging data, and can be integrated into a wide variety of applications.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 26Jun 28Jun 30Jul 2Jul 4Jul 6Jul 8Jul 10Jul 12Jul 14Jul 16Jul 18Jul 20Jul 22Jul 2504008001440Minutes
Online
Offline

Related APIs in Health