The methods provided by the API take a range of parameters specific to their endpoints, but all methods need authentication via a request header that contains the developer's API key. Only GET requests are possible.
Method-specific parameters are documented on the method detail pages, which are listed on the API index page.
using jQuery:
$.ajax({
url: 'https://www.brooklynmuseum.org/api/v2/collection/2/highlight',
type: 'GET',
beforeSend: function (xhr) {
xhr.setRequestHeader('api_key', 'YOUR_API_KEY');
},
data: {},
success: function () { },
error: function () { },
});
using cURL:
curl --header 'api_key: YOUR_API_KEY' https://www.brooklynmuseum.org/api/v2/collection/2/highlight
using jQuery
$.ajax({
url: 'https://www.brooklynmuseum.org/api/v2/exhibition?limit=10&decade=1990',
type: 'GET',
beforeSend: function (xhr) {
xhr.setRequestHeader('api_key', 'YOUR_API_KEY');
},
data: {},
success: function () { },
error: function () { },
});
using cURL:
curl --header 'api_key: YOUR_API_KEY' https://www.brooklynmuseum.org/api/v2/exhibition?limit=10&decade=1990
The API responds with JSON. You can read more about responses here.