Three response formats are supported. The format returned is determined by the optional format parameter you use (default xml). The top-level data type returned by all responses is the RESPONSE element.
XML
Arguably the most flexible format, XML responses follow this basic template:
<?xml version="1.0" ?> <response status="success"> [XML Payload] </response>
The format of the 'XML Payload' is defined by the method called. The following demonstrates a simple collection.search response:
<?xml version="1.0" ?> <response status="success" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.brooklynmuseum.org/opencollection/api/api.xsd"> <resultset total="26" start_index="0" results_limit="2" query="keyword=eames" next_uri="http://www.brooklynmuseum.org/opencollection/api/?method=collection.search&keyword=eames&start_index=0&results_limit=2&require_image=true&image_results_limit=1&sort_field=relevance&api_key=8b670ed2b71d8c84b1dd4ac32920195e1371728947&version=1&include_image_caption=false&include_item_fields=true&thumb_shape=original&max_thumb_size=96&max_image_size=384&format=xml&include_html_style_block=true&start_index=2"> <items> <object id="1588" title=""Pedestal" Armchair and Seat Cushion" uri="http://www.brooklynmuseum.org/opencollection/objects/1588/Pedestal_Armchair_and_Seat_Cushion" accession_number="78.128.7" object_date="Designed 1956; Manufactured ca. 1970" object_date_begin="1956" object_date_end="1970" medium="Plastic reinforced with fiberglass, wool" dimensions="32 x 25 1/2 x 23 in. (81.3 x 64.8 x 58.4 cm)" markings="Printed rectangular paper label afixed to seat interior, below cushion: Knoll International / 320 PARK Avenue / New york, NY 10022 (logo, capital "K" in a red circle)." signed="no signature" inscribed="no inscriptions" credit_line="Gift of Knoll International, Inc." classification="Furniture, Seating" description="White plastic reinforced with fiberglass molded into a tulip-shaped armchair with pedestal; seat cushion of latex foam rubber covered in red wool. Slightly curved seat bottom rises to arm rests and (higher) seat back; top of back is slightly scooped then slopes down to arm rests. Edges rolled over, extended further at sides to form arm rests. The seat is supported by a tapered, attenuated cylinder that continues into a wide flat circular base. Seat and base are two separately molded pieces attached with six bolts. The C-shaped, detachable seat cushion is attached beneath by two velcro strips. CONDITION: Very good. Nick to proper right edge of arm and to proper left edge of seat. See condition report in object file." label="Taking full advantage of pliable fiberglass, the <i>Pedestal </i>armchair&rsquo;s flowing lines create a unified design statement that has led to its being nicknamed the &ldquo;Tulip&rdquo; chair. It is the culmination of Saarinen&rsquo;s experiments with molded shell forms, begun in 1940 in a collaboration with Charles Eames. The chair the two designed that year for The Museum of Modern Art&rsquo;s <i>Organic Design in Home Furnishings</i> exhibition won an award and set the stage for innovative mid-century furniture design.<br />" location="Luce Visible Storage and Study Center, 5th Floor" collection="Decorative Arts" rightstype="creative_commons_by_nc" rank="0"> <images total="4" results_limit="1"> <image uri="http://cdn2.brooklynmuseum.org/images/opencollection/objects/size0/78.128.7_view2_IMLS_SL2.jpg" thumb_uri="http://cdn2.brooklynmuseum.org/images/opencollection/objects/size0/78.128.7_view2_IMLS_SL2.jpg" credit="Brooklyn Museum photograph" description="" is_color="true" rank="0"/> </images> <artists> <artist uri="http://www.brooklynmuseum.org/opencollection/artists/3936/Eero_Saarinen" id="3936" name="Eero Saarinen" dates="American, born Finland, 1910-1961" nationality="American" role="Designer"/> <artist uri="http://www.brooklynmuseum.org/opencollection/artists/14966/Knoll_International_Inc." id="14966" name="Knoll International, Inc." dates="" nationality="" role="Manufacturer"/> </artists> <geolocations> <geolocation name="New York, New York, United States" location_type="place manufactured" code="t:1173644"/> </geolocations> </object> <object id="2263" title="Side Chair" uri="http://www.brooklynmuseum.org/opencollection/objects/2263/Side_Chair" accession_number="1994.156.1" object_date="ca. 1949" object_date_begin="1947" object_date_end="1951" medium="Molded walnut plywood, chromed metal, rubber" dimensions="30 1/2 x 22 x 22 1/4 in. (77.5 x 55.9 x 56.5 cm)" credit_line="Alfred T. and Caroline S. Zoebisch Fund" classification="Furniture, Seating" description="Side chair. Molded walnut plywood, chromed metal and rubber. Ovoid continuous bent plywood seat and back with ovoid hollow at juncture of the seat and back which continues as narrow vertical void with flattened crest. Front splayed chromed tubular metal legs composed of one piece bent at right angle to support underside of seat; each splayed back leg bent at right angle at seat and soldered to continuous member of front legs. Metal support under seat with rubber strips beneath seat and horizontal chromed metal bar on back secured from front with two circular metal disks. Each leg with flattened metal circular pad. Condition: Good, veneer raised on proper left top seat seam, scratches and faded spots. Conservation report on file." label="<p>Ray Komai's molded plywood chair was manufactured in Brooklyn in 1949, using the latest American technology. Although European designers such as Marcel Breuer and Alvar Aalto designed plywood furniture in the 1930s, it was the Americans Charles and Ray Eames, in the years immediately after World War II, who realized the full potential of this material and bent one sheet of plywood in several directions. Komai's chair adds a sophisticated anthropomorphic twist. If you look closely, the chair's design suggests a human face.</p>" location="American Identities: A New Look, Orientation Gallery, 5th Floor" collection="Decorative Arts" rightstype="creative_commons_by_nc" rank="1"> <images total="3" results_limit="1"> <image uri="http://cdn2.brooklynmuseum.org/images/opencollection/objects/size0/1994.156.1_bw.jpg" thumb_uri="http://cdn2.brooklynmuseum.org/images/opencollection/objects/size0/1994.156.1_bw.jpg" credit="Brooklyn Museum photograph" description="" is_color="false" rank="0"/> </images> <artists> <artist uri="http://www.brooklynmuseum.org/opencollection/artists/9312/Ray_Komai" id="9312" name="Ray Komai" dates="American, born 1918" nationality="American" role="Designer"/> <artist uri="http://www.brooklynmuseum.org/opencollection/artists/14563/J.G._Furniture_Co._Inc." id="14563" name="J.G. Furniture Co., Inc." dates="" nationality="" role="Manufacturer"/> </artists> <geolocations> <geolocation name="Brooklyn, New York, United States" location_type="place manufactured" code="t:2308875"/> </geolocations> </object> </items> </resultset> </response>
Errors in XML responses look like this:
<?xml version="1.0" ?> <response status="fail" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.brooklynmuseum.org/opencollection/api/api.xsd"> <error code="1001" message="Missing parameter. Must provide a keyword, name, or date range."/> </response>
Note that in addition to the Brooklyn Museum API metadata format implied in the responses above we, also support CDWA-Lite and Dublin Core if you're into those kinds of things.
JSON
JSON may be favored over XML if you intend to call on Collection API services using JavaScript (or another ECMA based scripting language). JSON response envelopes follow this basic template:
{
"response": {
[JSON Payload]
"status": "success"
}
}
The format of the 'JSON Payload' is defined by the method called. The following demonstrates a simple collection.search response (identical to the query above):
{
"response": {
"resultset": {
"total": 26,
"start_index": 0,
"results_limit": 2,
"query": "keyword=eames",
"items": [
{
"type": "object",
"id": "1588",
"title": "\"Pedestal\" Armchair and Seat Cushion",
"uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/objects\/1588\/Pedestal_Armchair_and_Seat_Cushion",
"images": {
"total": "4",
"results_limit": 1,
"0": {
"uri": "http:\/\/cdn2.brooklynmuseum.org\/images\/opencollection\/objects\/size0\/78.128.7_view2_IMLS_SL2.jpg",
"thumb_uri": "http:\/\/cdn2.brooklynmuseum.org\/images\/opencollection\/objects\/size0\/78.128.7_view2_IMLS_SL2.jpg",
"credit": "Brooklyn Museum photograph",
"description": null,
"is_color": true,
"rank": 0
}
},
"accession_number": "78.128.7",
"object_date": "Designed 1956; Manufactured ca. 1970",
"object_date_begin": "1956",
"object_date_end": "1970",
"medium": "Plastic reinforced with fiberglass, wool",
"dimensions": "32 x 25 1\/2 x 23 in. (81.3 x 64.8 x 58.4 cm)",
"markings": "Printed rectangular paper label afixed to seat interior, below cushion: Knoll International \/ 320 PARK Avenue \/ New york, NY 10022 (logo, capital \"K\" in a red circle).",
"signed": "no signature",
"inscribed": "no inscriptions",
"credit_line": "Gift of Knoll International, Inc.",
"classification": "Furniture, Seating",
"description": "White plastic reinforced with fiberglass molded into a tulip-shaped armchair with pedestal; seat cushion of latex foam rubber covered in red wool. Slightly curved seat bottom rises to arm rests and (higher) seat back; top of back is slightly scooped then slopes down to arm rests. Edges rolled over, extended further at sides to form arm rests. The seat is supported by a tapered, attenuated cylinder that continues into a wide flat circular base. Seat and base are two separately molded pieces attached with six bolts. The C-shaped, detachable seat cushion is attached beneath by two velcro strips.\r\n\r\nCONDITION: Very good. Nick to proper right edge of arm and to proper left edge of seat. See condition report in object file.",
"label": "Taking full advantage of pliable fiberglass, the <i>Pedestal <\/i>armchair’s flowing lines create a unified design statement that has led to its being nicknamed the “Tulip” chair. It is the culmination of Saarinen’s experiments with molded shell forms, begun in 1940 in a collaboration with Charles Eames. The chair the two designed that year for The Museum of Modern Art’s <i>Organic Design in Home Furnishings<\/i> exhibition won an award and set the stage for innovative mid-century furniture design.<br \/>",
"artists": [
{
"uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/artists\/3936\/Eero_Saarinen",
"id": "3936",
"name": "Eero Saarinen",
"dates": "American, born Finland, 1910-1961",
"nationality": "American",
"role": "Designer",
"type": "artist"
},
{
"uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/artists\/14966\/Knoll_International_Inc.",
"id": "14966",
"name": "Knoll International, Inc.",
"dates": null,
"nationality": null,
"role": "Manufacturer",
"type": "artist"
}
],
"location": "Luce Visible Storage and Study Center, 5th Floor",
"geolocations": [
{
"name": "New York, New York, United States",
"location_type": "place manufactured",
"code": "t:1173644"
}
],
"collection": "Decorative Arts",
"rightstype": "creative_commons_by_nc",
"rank": 0
},
{
"type": "object",
"id": "2263",
"title": "Side Chair",
"uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/objects\/2263\/Side_Chair",
"images": {
"total": "3",
"results_limit": 1,
"0": {
"uri": "http:\/\/cdn2.brooklynmuseum.org\/images\/opencollection\/objects\/size0\/1994.156.1_bw.jpg",
"thumb_uri": "http:\/\/cdn2.brooklynmuseum.org\/images\/opencollection\/objects\/size0\/1994.156.1_bw.jpg",
"credit": "Brooklyn Museum photograph",
"description": null,
"is_color": false,
"rank": 0
}
},
"accession_number": "1994.156.1",
"object_date": "ca. 1949",
"object_date_begin": "1947",
"object_date_end": "1951",
"medium": "Molded walnut plywood, chromed metal, rubber",
"dimensions": "30 1\/2 x 22 x 22 1\/4 in. (77.5 x 55.9 x 56.5 cm)",
"credit_line": "Alfred T. and Caroline S. Zoebisch Fund",
"classification": "Furniture, Seating",
"description": "Side chair. Molded walnut plywood, chromed metal and rubber. Ovoid continuous bent plywood seat and back with ovoid hollow at juncture of the seat and back which continues as narrow vertical void with flattened crest. Front splayed chromed tubular metal legs composed of one piece bent at right angle to support underside of seat; each splayed back leg bent at right angle at seat and soldered to continuous member of front legs. Metal support under seat with rubber strips beneath seat and horizontal chromed metal bar on back secured from front with two circular metal disks. Each leg with flattened metal circular pad.\r\n\r\nCondition: Good, veneer raised on proper left top seat seam, scratches and faded spots. Conservation report on file.",
"label": "<p>Ray Komai's molded plywood chair was manufactured in Brooklyn in 1949, using the latest American technology. Although European designers such as Marcel Breuer and Alvar Aalto designed plywood furniture in the 1930s, it was the Americans Charles and Ray Eames, in the years immediately after World War II, who realized the full potential of this material and bent one sheet of plywood in several directions. Komai's chair adds a sophisticated anthropomorphic twist. If you look closely, the chair's design suggests a human face.<\/p>",
"artists": [
{
"uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/artists\/9312\/Ray_Komai",
"id": "9312",
"name": "Ray Komai",
"dates": "American, born 1918",
"nationality": "American",
"role": "Designer",
"type": "artist"
},
{
"uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/artists\/14563\/J.G._Furniture_Co._Inc.",
"id": "14563",
"name": "J.G. Furniture Co., Inc.",
"dates": null,
"nationality": null,
"role": "Manufacturer",
"type": "artist"
}
],
"location": "American Identities: A New Look, Orientation Gallery, 5th Floor",
"geolocations": [
{
"name": "Brooklyn, New York, United States",
"location_type": "place manufactured",
"code": "t:2308875"
}
],
"collection": "Decorative Arts",
"rightstype": "creative_commons_by_nc",
"rank": 1
}
],
"next_uri": "http:\/\/www.brooklynmuseum.org\/opencollection\/api\/?method=collection.search&keyword=eames&start_index=0&results_limit=2&require_image=true&image_results_limit=1&sort_field=relevance&api_key=1b721d37eec77ccadb6eb283ae207fe51371728948&version=1&include_image_caption=false&include_item_fields=true&thumb_shape=original&max_thumb_size=96&max_image_size=384&format=json&include_html_style_block=true&start_index=2"
},
"status": "success"
}
}
Errors in JSON responses look like this:
{
"response": {
"status": "fail",
"error": {
"code": 1001,
"message": "Missing parameter. Must provide a keyword, name, or date range."
}
}
}
HTML
If you don't plan on working with the data at a granular level and just want a preformatted block of HTML that you can immediately insert into a Web page, HTML is your format. HTML response envelopes follow this basic template:
<!-- BM:status="success" --> [HTML Payload]
As with other formats, the format of the 'HTML Payload' is defined by the method called. The following demonstrates a simple collection.search response (identical to the query above):
<!-- BM:status=' . $data['response']['status'] . ' -->
<style type="text/css">
div.bm-content { font-family:sans-serif; font-size:0.8em; }
p.bm-pagination a { margin-left:2em; }
a img { border: none; }
ul.bm-results { list-style:none; }
ul.bm-results { display:block; }
ul.bm-results li { background-color:#EEE; padding:0.5em; margin:0.5em; float:left; width:16em; height:10em; }
ul.bm-results li img { float:right; width:auto; margin-left:0.2em; }
span.bm-item-title, span.bm-item-artists, span.bm-item-date { display:block; margin-bottom:0.1em; }
span.bm-item-title { font-weight:bold; }
span.bm-artist-dates { display:block; color: gray; }
span.bm-artist-thumbs { color: gray; }
span.bm-image-caption { display:block; margin:0.5em 0; color:gray; }
span.bm-clear { display:block; clear:both; }
</style>
<div class="bm-content">
<p class="bm-showing">Showing items 1 - 2 of 26</p>
<p class="bm-pagination"><a href="http://www.brooklynmuseum.org/opencollection/api/?method=collection.search&keyword=eames&start_index=0&results_limit=2&require_image=true&image_results_limit=1&sort_field=relevance&api_key=1b721d37eec77ccadb6eb283ae207fe51371728948&version=1&include_image_caption=false&include_item_fields=true&thumb_shape=original&max_thumb_size=96&max_image_size=384&format=html&include_html_style_block=true&start_index=2">Next</a>
<ul class="bm-results">
<li>
<span class="bm-object">
<a href="http://www.brooklynmuseum.org/opencollection/objects/1588/Pedestal_Armchair_and_Seat_Cushion" rel="bm"><img src="http://cdn2.brooklynmuseum.org/images/opencollection/objects/size0/78.128.7_view2_IMLS_SL2.jpg" alt=""Pedestal" Armchair and Seat Cushion"/></a>
<a href="http://www.brooklynmuseum.org/opencollection/objects/1588/Pedestal_Armchair_and_Seat_Cushion" rel="bm"><span class="bm-item-title">"Pedestal" Armchair and Seat Cushion</span></a>
<span class="bm-item-artists">Eero Saarinen; Knoll International, Inc.</span>
<span class="bm-item-date">Designed 1956; Manufactured ca. 1970</span>
<span class="bm-clear"></span>
</span>
</li>
<li>
<span class="bm-object">
<a href="http://www.brooklynmuseum.org/opencollection/objects/2263/Side_Chair" rel="bm"><img src="http://cdn2.brooklynmuseum.org/images/opencollection/objects/size0/1994.156.1_bw.jpg" alt="Side Chair"/></a>
<a href="http://www.brooklynmuseum.org/opencollection/objects/2263/Side_Chair" rel="bm"><span class="bm-item-title">Side Chair</span></a>
<span class="bm-item-artists">Ray Komai; J.G. Furniture Co., Inc.</span>
<span class="bm-item-date">ca. 1949</span>
<span class="bm-clear"></span>
</span>
</li>
</ul>
</div>
Errors in HTML responses look like this:
<!-- BM:status=' . $data['response']['status'] . ' --> <p class="bm-error">Error </p>


Eastern Parkway/Brooklyn Museum