Getting Started
The Cooper Hewitt APIAPI (Computer Science) Application Programming Interface – a facility to allow a computer or application to access the data and/or functionality of another computer system or application gives you quick access to the data of 215,000 items in our collectionCollection (Museology) Museums are distinguished by their collection of unique objects that form the core of their activities for exhibitions, education, and research., along with information about the people, companies and other organizations that were associated with them.
The API uses GraphQLGraphQL (Computer Science) GraphQL is an open-source data query and manipulation language for APIs to access the data. To get started, connect via GraphQL to this endpoint:
https://api.cooperhewitt.org/
Start making queries
The API will support any GraphQL compatible client, including the command line or graphical user interfaces (GUIs) such as GraphiQLGraphiQL GraphiQL (note the "i" in the word) is an open source graphical interface used to query GraphQL APIs. You can use GraphiQL in our Try It Out section.. This site has embedded GraphiQL, so you can make GraphQL queries without any prior setup.
Incorporate the API in your code
When you want to incorporate queries into your own code, there are many tools available in a wide range of programming languages. Visit the GraphQL site to explore the options available.
Open access
The Cooper Hewitt API is open access, you do not have to register in order to use it. However, to prevent the overloading of the server, calls to the API will be rate limited by default. To remove this limit, you can apply for your own access key.
GraphQL
There are many styles and formats for applicationApplication (Computer Science) A computer software unit that provides functionality for particular use programming interfaces (APIs). The Cooper Hewitt APIAPI (Computer Science) Application Programming Interface – a facility to allow a computer or application to access the data and/or functionality of another computer system or application uses GraphQLGraphQL (Computer Science) GraphQL is an open-source data query and manipulation language for APIs, a flexible, fast and powerful “queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables language” used to define and work with APIs. You can find out more about GraphQL on their foundation’s website.
GraphQL queries follow this basic structure:
{
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. (argumentsArguments (Computer Science) Individual elements of information contained within a query, often structured as name / value pairs, e.g. title="chair") {
fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields.
}
}
Once the query is sent to the API endpoint, the data that is returned follows the same structure as the query:
{
“data”: {
“object”: {
“field”: valueValue (Computer Science) The representation given to the corresponding entity, often the public description of the entity.
}
}
}
Anatomy of a Record
The JSONJSON (Computer Science) JSON (JavaScript Object Notation) is a structured format for data that is lightweight (does not contain a lot of markup) and easy to parse. below shows a typical GraphQLGraphQL (Computer Science) GraphQL is an open-source data query and manipulation language for APIs responseResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message. from a queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables for a single objectObject (Museology) Artefact or specimen held in a museum collection. (Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior., in this case the Videosphere portable television.
{
"data": {
"object": [
{
"titleTitle (Museology) The name given to the design or work of art.": [
{
"type": "Descriptive title",
"valueValue (Computer Science) The representation given to the corresponding entity, often the public description of the entity.": "Videosphere Model 3240 Portable Television"
},
{
"type": "Model number",
"value": "3240"
},
{
"type": "Series/book title",
"value": "Videosphere"
}
],
"summary": {
"title": "Videosphere Model 3240 Portable Television"
},
"identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype": [
{
"value": "2018-22-51",
"type": "accession numberAccession Number (Museology) When an object is accessioned it receives a unique identifier called an Accession Number. These numbers may codify the year the object was accessioned, the department, or if the object is part of a series of objects that form a whole"
},
{
"value": "285978",
"type": "tms id"
}
],
"classificationClassification (API) A formal terminology that can be applied to any object. Objects can have more than one classification.": [
{
"datatypeDatatype (Computer Science) A particular kind of data item, as defined by the values it can take, the programming language used, or the operations that can be performed on it. Predefined formats for data contained within fields, for example “number”, “string” (text) or “date”": {
"base": "classification"
},
"id": "classification-204",
"summary": {
"title": "appliances & tools"
}
}
],
"dateDate (Museology) The date range of the creation of the object. This value will have 'from', and 'to' key value pairs.": [
{
"from": "1970",
"to": "1970",
"value": "1970"
}
],
"departmentDepartment (API) The section of the museum that an object is associated with.": [
{
"collectionsOnlineIdcollectionsOnlineId (API) A legacy ID specific to Cooper Hewitt's collection site established in 2012": "35347475",
"datatype": {
"base": "department"
},
"id": "department-1",
"identifier": [
{
"type": "tms id",
"value": "1"
}
],
"summary": {
"title": "Product Design and Decorative Arts Department"
}
}
],
"descriptionDescription (API) Long-form, curatorial, interpretive text created for context and additional descriptive elements.": [
{
"type": "digital table textDigital table text (API) Description to be used for in-gallery interactives when an object is shown to the public.",
"value": "Inspired by the helmets worn by the first astronauts to walk on the moon, the Videosphere is made of synthetic materials that perfectly suit its cosmic aesthetic. While reflecting the period’s preoccupation with space exploration, the television also demonstrates innovative function: it can rotate 360 degrees on its pedestal, or, powered by a rechargeable battery, it can be removed and carried or hung by its chrome chain."
},
{
"type": "general descriptionGeneral description (API) A broad description of the object to be used across various media.",
"value": "Spherical red television (a) with convex screen at front and control knobs and hanging/carrying chain in indentation at top; chrome-plated telescoping attenna, top right. Sits in square red base (b) with circular indentation to hold television."
},
{
"type": "digital table text",
"value": "This portable television can rotate 360 degrees on its pedestal or can be carried by its chrome chain. The plastic housing reflects popular trends of the 1970s, including the use of bright, pop-art-inspired color and an interest in space exploration—the form is a nod to the Apollo 11 astronauts’ spherical helmets."
}
],
"exhibitionExhibition (API) A listing of exhibitions where an object was part of the display.": [
{
"collectionsOnlineId": "404734319",
"datatype": {
"base": "exhibition"
},
"date": [
{
"from": "2016",
"to": "2017",
"value": "2016-04-28-2017-03-12"
}
],
"department": [
{
"@admin": {
"id": "department-11",
"sourceSource (API) The origin of the data or object.": "tms",
"statusStatus (API) The state of the object as it refers to its ownership of the museum. The object may be accessioned, or on loan.": "public",
"uuidUUID (Computer Science) A universally unique identifier (UUID) is a 128-bit label used for information in computer systems. UUIDs are, for practical purposes, unique. Their uniqueness does not depend on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. While the probability that a UUID will be duplicated is not zero, it is close enough to zero to be negligible.": "075fcbc2-95a7-3e13-bb2d-aea4b03bcb9d"
}
}
],
"id": "exhibition-1314",
"identifier": [
{
"type": "tms id",
"value": "1314"
}
],
"summary": {
"title": "Energizing the Everyday: Gifts From the George R. Kravis II CollectionCollection (Museology) Museums are distinguished by their collection of unique objects that form the core of their activities for exhibitions, education, and research."
},
"title": [
{
"type": "default title",
"value": "Energizing the Everyday: Gifts From the George R. Kravis II Collection"
},
{
"type": "mnemonic",
"value": "KRAVIS"
},
{
"value": "Energizing the Everyday: Gifts From the George R. Kravis II Collection"
}
],
"venueVenue (API) The location of an exhibition.": [
{
"@admin": {
"id": "agent-3802",
"source": "tms",
"status": "public",
"uuid": "17aaf283-0f78-3723-83b6-f38b00deb8ea"
}
}
]
},
{
"collectionsOnlineId": "1108750009",
"datatype": {
"base": "exhibition"
},
"date": [
{
"from": "2018",
"to": "2019",
"value": "2018-05-04-2019-03-17"
}
],
"department": [
{
"@admin": {
"id": "department-11",
"source": "tms",
"status": "public",
"uuid": "075fcbc2-95a7-3e13-bb2d-aea4b03bcb9d"
}
}
],
"id": "exhibition-1527",
"identifier": [
{
"type": "tms id",
"value": "1527"
}
],
"label": [
{
"value": "Mounts"
},
{
"value": "Light levels"
},
{
"value": "Framing"
}
],
"summary": {
"title": "Saturated: The Allure and Science of Color"
},
"title": [
{
"type": "default title",
"value": "Saturated: The Allure and Science of Color"
},
{
"type": "mnemonic",
"value": "COLOR"
},
{
"value": "Saturated: The Allure and Science of Color"
}
],
"venue": [
{
"@admin": {
"id": "agent-3802",
"source": "tms",
"status": "public",
"uuid": "17aaf283-0f78-3723-83b6-f38b00deb8ea"
}
}
]
}
],
"inscriptionInscription (Museology) words inscribed on the object itself, often by the manufacturer or designer to indicate origin, materials, date, or manufacturer details": [
{
"markings": "On bottom of screen: \r\nJVC VIDEOSPHERE on applied decal\r\nOn front of base:\r\nJVC molded in surface, painted white."
}
],
"geography": {
"city": {
"value": "Tokyo"
},
"country": {
"value": "Japan"
},
"geocode": "manufactured in",
"geocode_id": 5,
"name": "Japan Tokyo"
},
"legalLegal (API) description of ownership, gift information, and public provenance.": {
"credit": "Gift of George R. Kravis II",
"rights": [
{
"details": "no information in file",
"type": "copyrightCopyright (Museology) The status of an object's copyright is documented in the object record as image rights. This status determines what types of restrictions are applied to the reproduction of the image."
}
]
},
"mediumMedium (Museology) Description of the material quality of the object or technical means of artistic expression, or production (such as metal, plastic, paint and canvas, sculptural stone, or code)": [
{
"value": "Acrylic"
},
{
"value": "Chrome-plated metal"
},
{
"value": "Metal"
},
{
"value": "Plastic"
}
],
"measurements": {
"dimensions": [
{
"value": "H x diam.: 36.2 × 24.1 cm (14 1/4 × 9 1/2 in.)"
}
]
},
"multimediaMultimedia (API) A section of an API record that provides access to images, video, audio or other file associated with an object.": [
{
"datatype": {
"actual": "image",
"base": "media"
},
"id": "media-374839",
"large": {
"format": "jpeg",
"locationLocation (Museology) The Location is the city, country, or region where the object was created": "374/839/large_CHSDM_285978_10.jpg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 1024
},
{
"dimension": "width",
"units": "pixels",
"value": 1536
}
],
"filesize": {
"units": "bytes",
"value": 144556
}
}
},
"preview": {
"format": "jpeg",
"location": "374/839/preview_CHSDM_285978_10.jpg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 350
},
{
"dimension": "width",
"units": "pixels",
"value": 525
}
],
"filesize": {
"units": "bytes",
"value": 57675
}
}
},
"summary": {
"title": "CHSDM-285978_10"
},
"type": "image"
}
],
"name": [
{
"value": "portable television"
}
],
"note": nullNull (Computer Science) No value or content,
"period": null,
"provenanceProvenance (Museology) A record of ownership of a work of art or an antique, used as a guide to authenticity or quality.": [
"2016: Promised to Cooper Hewitt by George R. Kravis II"
],
"status": {
"value": "Accessioned object"
},
"makerMaker (API) Creator of an object": [
{
"id": "agent-21051",
"summary": {
"title": "Victor Company of Japan, Ltd."
}
}
]
}
]
},
"extensions": {
"pagination": {
"hits": 1,
"per_page": 10,
"current_page": 0,
"number_of_pages": 1
}
}
}
Objects
To access the museum’s objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection data, the following queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables will display all the available fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields.:
{
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. {
titleTitle (Museology) The name given to the design or work of art.
summary
identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype
id
classificationClassification (API) A formal terminology that can be applied to any object. Objects can have more than one classification.
culture
dateDate (Museology) The date range of the creation of the object. This value will have 'from', and 'to' key value pairs.
departmentDepartment (API) The section of the museum that an object is associated with.
descriptionDescription (API) Long-form, curatorial, interpretive text created for context and additional descriptive elements.
exhibitionExhibition (API) A listing of exhibitions where an object was part of the display.
inscriptionInscription (Museology) words inscribed on the object itself, often by the manufacturer or designer to indicate origin, materials, date, or manufacturer details
geography
legalLegal (API) description of ownership, gift information, and public provenance.
loaned
locationLocation (Museology) The Location is the city, country, or region where the object was created
material
mediumMedium (Museology) Description of the material quality of the object or technical means of artistic expression, or production (such as metal, plastic, paint and canvas, sculptural stone, or code)
measurements
multimediaMultimedia (API) A section of an API record that provides access to images, video, audio or other file associated with an object.
name
note
period
provenanceProvenance (Museology) A record of ownership of a work of art or an antique, used as a guide to authenticity or quality.
statusStatus (API) The state of the object as it refers to its ownership of the museum. The object may be accessioned, or on loan.
agent {
id
summary
}
collector {
id
summary
}
makerMaker (API) Creator of an object {
id
summary
}
subject {
id
summary
}
tag {
id
summary
}
}
}
This query won’t return all of the hundreds of thousands of available records, there is an upper limit of 250 results per page. See the paging section to see how to address larger datasets.
Images and other media
ObjectObject (Museology) Artefact or specimen held in a museum collection. (Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. records will contain references to any images, video, audio or other media that represent that object.
To find object records with attached media, include the hasMedia: true
in your queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables, for example:
{
object(hasImages:true) {
id
titleTitle (Museology) The name given to the design or work of art.
summary
multimediaMultimedia (API) A section of an API record that provides access to images, video, audio or other file associated with an object.
}
}
Resized media (images)
Pre-processed media files are available at different dimensions, known as ‘artifacts’, these are:
preview
: 350px on its shortest side.large
: 1024px on its shortest side.zoom
: A zoomable pyramid tiff generated from the sourceSource (API) The origin of the data or object. image. Only generated for media whose original is at least 300px on its shortest side.original
: The original image asset, published where the object is licensed as CC0.
Example
In the following recordRecord (Computer Science) A unit that groups together related items of data, for example all the fields that represent a museum collection object, you can see how format type and image dimensions are included alongside URLs to the different media artifacts.
{
"data": {
"object": [
{
"id": "object-9346",
"summary": {
"title": "Drawing"
},
"multimedia": [
{
"cc0": true,
"datatype": {
"actual": "image",
"base": "media"
},
"department": [
{
"@admin": {
"id": "department-23",
"source": "tms",
"status": "public",
"uuid": "efba4e30-b776-3975-a655-bce874a3be01"
}
}
],
"id": "media-122215",
"large": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 1024
},
{
"dimension": "width",
"units": "pixels",
"value": 1451
}
],
"filesize": {
"units": "bytes",
"value": 282572
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/122/215/large_CHSDM_F50C19FA59A32_000001.jpg"
},
"original": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 2244
},
{
"dimension": "width",
"units": "pixels",
"value": 3180
}
],
"filesize": {
"units": "bytes",
"value": 5700457
}
},
"processed": true,
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/122/215/CHSDM_F50C19FA59A32_000001.jpg"
},
"preview": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 350
},
{
"dimension": "width",
"units": "pixels",
"value": 496
}
],
"filesize": {
"units": "bytes",
"value": 43376
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/122/215/preview_CHSDM_F50C19FA59A32_000001.jpg"
},
"summary": {
"title": "CHSDM-F50C19FA59A32-000001"
},
"type": "image"
},
{
"datatype": {
"actual": "image",
"base": "media"
},
"id": "media-267864",
"large": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 1024
},
{
"dimension": "width",
"units": "pixels",
"value": 732
}
],
"filesize": {
"units": "bytes",
"value": 162047
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/267/864/large_CHSDM_9346_02_000001.jpg"
},
"preview": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 350
},
{
"dimension": "width",
"units": "pixels",
"value": 250
}
],
"filesize": {
"units": "bytes",
"value": 49001
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/267/864/preview_CHSDM_9346_02_000001.jpg"
},
"summary": {
"title": "CHSDM-9346_02-000001"
},
"type": "image"
}
]
}
]
},
"extensions": {
"pagination": {
"hits": 1,
"per_page": 10,
"current_page": 0,
"number_of_pages": 1
}
}
}
Zooms
Zoomable images, serving a “pyramid” of tiles that allow an applicationApplication (Computer Science) A computer software unit that provides functionality for particular use to zoom in to the fine detail, are also available via the APIAPI (Computer Science) Application Programming Interface – a facility to allow a computer or application to access the data and/or functionality of another computer system or application at multimedia.zoom.url
. A query that returns zoom information will look like this:
{
object(hasImages:true) {
media {
id
large
preview
zoom
original
}
}
}{
object(hasImages:true) {
media {
id
large
preview
zoom
original
}
}
}
To resolve the zoomable image’s IIIF manifest, you can append /info.jsonJSON (Computer Science) JSON (JavaScript Object Notation) is a structured format for data that is lightweight (does not contain a lot of markup) and easy to parse.
to the URL. For example: https://ch-api.ch-dev-use.link/iiif/3/138%2f845%2fCHSDM_283851_04.ptif/info.json
Creative Commons
If an object record is licensed under the Creative Commons “CC0” license, then its media data will contain cc0: true
. If this is not the case, there will be no cc0
field present.
Limiting your query to just the media artifacts that you need
It is possible to restrict the query to only the artifacts that you require for a task. For example, if you were using the API to produce a grid of thumbnail images, the following query would limit the data to just the fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. you would need:
{
object(hasImages:true) {
summary
media {
id
preview
}
}
}
Colors
Many images have been analyzed using machine learning to extract their constituent colors. To search for records with color information, add colors
to your query:
{
object(colors:"#8eabae") {
id
colors
multimedia
}
}
The responseResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message. will consist of the following types of information:
"gvision": {
"colors": [
{
"confidence": "58.85", # The AI's confidence of the resultResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message. in %
"fraction": 0.37141976, # The fraction of pixels the color occupies in the image [0-1]
"hex": "#8eabae", # The hex valueValue (Computer Science) The representation given to the corresponding entity, often the public description of the entity. of the color
"rgb": {
"blue": 174,
"green": 171,
"red": 142,
"value": "142, 171, 174" # The combined RGB values
}
}
]
}
Search for objects
You can search for an objectObject (Museology) Artefact or specimen held in a museum collection. (Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. by passing an Argument in the queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables. The query below uses one of an object’s identifiers – in this case its accession numberAccession Number (Museology) When an object is accessioned it receives a unique identifier called an Accession Number. These numbers may codify the year the object was accessioned, the department, or if the object is part of a series of objects that form a whole.
{
object (identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype: "2018-22-51") {
identifier
titleTitle (Museology) The name given to the design or work of art.
descriptionDescription (API) Long-form, curatorial, interpretive text created for context and additional descriptive elements.
}
}
The fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. that can be searched for are:
general: stringString (Computer Science) A string is a sequence of characters forming words or sentences
agentId: string
agent: string
collectionsOnlineIdcollectionsOnlineId (API) A legacy ID specific to Cooper Hewitt's collection site established in 2012: string
country: string
culture: string
departmentDepartment (API) The section of the museum that an object is associated with. : string
departmentId: string
displayed: boolean
dynasty: string
exhibitionExhibition (API) A listing of exhibitions where an object was part of the display.: string
exhibitionId: string
geography: string
hasImages: boolean
identifier: string
id: string
loaned: boolean
makerMaker (API) Creator of an object: string
makerId: string
material: string
name: string
onDisplay: boolean
period: string
provenanceProvenance (Museology) A record of ownership of a work of art or an antique, used as a guide to authenticity or quality.: string
reign: string
summary: string
subject: string
subjectId: string
title: string
year: YYYY
yearRange: {from:YYYY, to:YYYYY}
You can also use general
to search across all searchable fields at the same time.
{
object (general: "swivel chair") {
identifier
title
description
}
}
Searching between years
When searching, yearRange accepts spans of years in order to filterFilters (Computer Science) Methods to reduce the number of records in a data set to help refine the result to something more useful for the user the results. This uses the following format:
{
object(yearRange:{from:1960, to:1970}){
identifier
title
description
}
}
You can use just one of the terms from
or to
for search that just starts or ends with a particular year.
Sorting results
The data that is returned can be sorted, or ordered, by adding a sort argument to the queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables. The following query will sort by the objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection’ accession numbers:
{
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior.(sort:[{id: "asc"}]){
id
summary
}
}
The options for orderingSorting (Computer Science) An argument of a query that determines the order of records in a result are "asc"
or "desc"
– for text-based fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. (strings), asc is A to Z, desc is Z to A, with numbers "asc"
is lowest to highest, "desc"
is highest to lowest.
The fields that can be sorted are:
id
summary
year
Pagination
The APIAPI (Computer Science) Application Programming Interface – a facility to allow a computer or application to access the data and/or functionality of another computer system or application has an upper limit of 250 objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection, agentsAgents (API) The data source representing constituents - people, organizations, and companies related to a work in the collection or tags that can be returned in a single responseResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message.. To access larger datasets, use pagination. This uses the following syntaxSyntax (Computer science) The set of rules that defines the combinations of commands and symbols that are considered to be correct for a programming or query language:
{
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior.(size: 100, page:12){
identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype
titleTitle (Museology) The name given to the design or work of art.
summary
}
}
Where size
is the number of records you would like returned and page
is the starting point for those records, for example:
Size | Page | Rows returned |
---|---|---|
250 | 1 | 1 – 250 |
250 | 2 | 251 – 500 |
250 | 3 | 501 – 750 |
More complex searches
You can combine multiple search criteria, and sortingSorting (Computer Science) An argument of a query that determines the order of records in a result, in the same queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables, like so:
{
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior.(titleTitle (Museology) The name given to the design or work of art.:"Drawing", sort:[{year:"asc"}]){
identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype
title
departmentDepartment (API) The section of the museum that an object is associated with.
}
}
Agents
AgentsAgents (API) The data source representing constituents - people, organizations, and companies related to a work in the collection are the people, organizations, and companies related to the creation of a work in the collectionCollection (Museology) Museums are distinguished by their collection of unique objects that form the core of their activities for exhibitions, education, and research.. The following field groups are available for an agent:
{
agent {
birthBirth
(API) The date of birth for an agent
classificationClassification (API) A formal terminology that can be applied to any object. Objects can have more than one classification.
collectionsOnlineIdcollectionsOnlineId (API) A legacy ID specific to Cooper Hewitt's collection site established in 2012
death
descriptionDescription (API) Long-form, curatorial, interpretive text created for context and additional descriptive elements.
dissolved
founded
id
identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype
name
nationality
roleRole (Museology) Consituent Roles can either be Person, or Organization
summary
vocation
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. {
id
summary
}
}
}
Search for agents
You can search for an agent by passing an argument in the queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables in the same way as with objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection. The query below uses the agent’s identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype.
{
agent(id:"agent-773") {
id
name
descriptionDescription (API) Long-form, curatorial, interpretive text created for context and additional descriptive elements.
}
}
The fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. that can be searched for are:
general
collectionsOnlineIdcollectionsOnlineId (API) A legacy ID specific to Cooper Hewitt's collection site established in 2012
dateDate (Museology) The date range of the creation of the object. This value will have 'from', and 'to' key value pairs.: YYYY
dateRange: {from:YYYY, to:YYYY}
description
identifier
id
name
nationality
summary
relationship
vocation
Sorting agents
Agent records can be sorted in the same way as with objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection
{
agent(sort:[{id: "asc"}]){
id
name
}
}
The fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. that can be searched for are:
birthBirth
(API) The date of birth for an agent
death
id
name
Multiple sortingSorting (Computer Science) An argument of a query that determines the order of records in a result argumentsArguments (Computer Science) Individual elements of information contained within a query, often structured as name / value pairs, e.g. title="chair" can be requested at the same time:
{
agent(sort: [{surename: "asc"},{forename: "asc"}]) {
id
name
birth
}
}
Sorting can be combined with searching:
{
agent(name:"Rob", sort:[{surename: "desc"}]) {
name
birth
}
}
Department
Departments are the functional sections that the museum is subdivided into, they include “Textile DepartmentDepartment (API) The section of the museum that an object is associated with.”, “Drawings, Prints, and Graphic Design Department” and “Exhibitions”. Queries to access departments are simple, as follows:
{
department {
collectionsOnlineIdcollectionsOnlineId (API) A legacy ID specific to Cooper Hewitt's collection site established in 2012
id
identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype
summary
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. {
id
summary
}
}
}
Departments can be both searched and sorted by the following fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields.:
page: int
size: int
sort: [{arg1: order}, {arg2: order}]
general: stringString (Computer Science) A string is a sequence of characters forming words or sentences
collectionsOnlineId:string
id: string
summary: string
Exhibitions
The Exhibitions dataset provides a recordRecord (Computer Science) A unit that groups together related items of data, for example all the fields that represent a museum collection object of the many exhibitions that the Cooper Hewitt Museum has staged, along with the objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection that were displayed in the exhibits. Exhibitions can be queried as follows:
{
exhibitionExhibition (API) A listing of exhibitions where an object was part of the display. {
category
collectionsOnlineIdcollectionsOnlineId (API) A legacy ID specific to Cooper Hewitt's collection site established in 2012
id
identifierIdentifier (API) A group of fields containing different unique identifiers for an object, agent, exhibition, or other unique datatype
label
locationLocation (Museology) The Location is the city, country, or region where the object was created
summary
titleTitle (Museology) The name given to the design or work of art.
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. {
id
summary
}
}
}
The following fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. are searchable:
general
category
id
identifier
label
location
locationId
summary
Exhibitions can be sorted using these fields:
id
summary
Locations
Locations indicate where an objectObject (Museology) Artefact or specimen held in a museum collection. (Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. may be on display, or whether it is in storage.
{
locationLocation (Museology) The Location is the city, country, or region where the object was created {
descriptionDescription (API) Long-form, curatorial, interpretive text created for context and additional descriptive elements.
id
site
summary
titleTitle (Museology) The name given to the design or work of art.
object {
id
summary
}
}
}
Departments can be both searched and sorted by the following fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields.:
id
summary
Tags
The items in the Cooper Hewitt’s collectionCollection (Museology) Museums are distinguished by their collection of unique objects that form the core of their activities for exhibitions, education, and research. have three levels of taxonomic grouping “Terms” and “Tags”. These provide different ways to group and discover items.
Tags
The structure of a TagTag (Museology) Tags are non-hierarchical keywords or terms assigned to Collection Objects which helps describe them and allows them to be found, processed automatically, or to create relationships between them. Tags are usually held within a finite, and Standard Vocabulary created by the Curatorial and Registrar department of the museum queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables is shown below:
{
tag {
id
name
summary
}
}
Tags can be accessed by argumentsArguments (Computer Science) Individual elements of information contained within a query, often structured as name / value pairs, e.g. title="chair". Searchable fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. are:
id
summary
Terms
{
term {
hierarchy
id
parent
summary
term
thesaurus
}
}
Searchable and sortable fields for terms are:
id
summary
thesaurus
Nested queries
Nested queries allow you to queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables items that are linked, for example the agentsAgents (API) The data source representing constituents - people, organizations, and companies related to a work in the collection associated with an objectObject (Museology) Artefact or specimen held in a museum collection. (Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. recordRecord (Computer Science) A unit that groups together related items of data, for example all the fields that represent a museum collection object. This also allows you to specify the fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. you want for both entities.
Agents on objectsObjects (API) The dataset containing all objects held within the Cooper Hewitt's online collection
Find agents linked to an object:
{
object {
id
agent {
id
name
}
}
}
Objects on Agents
Find objects linked to an agent:
{
agent(name: "Frank Lloyd Wright") {
id
object (relationship: "makerMaker (API) Creator of an object"){
id
summary
}
}
}
Aggregations
AggregationsAggregations (Computer Science) Effectively a synonym for Facet., also known as facets, are a powerful tool that allow you to find, and quantify, the commonalities between records within your search results. They can be used for a variety of applications, including the ability to refine search results by specific criteria. Aggregations are commonly used for online shopping interfaces, for example allowing the user to narrow results by aspects such as colour, size, pricing, brand and so on.
In the APIAPI (Computer Science) Application Programming Interface – a facility to allow a computer or application to access the data and/or functionality of another computer system or application results, aggregation data can be found in the responseResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message.’s extension
block. The example below shows a response aggregating on object.departmentDepartment (API) The section of the museum that an object is associated with.
– it offers the top 10 results (known as buckets
) along with the count (doc_count
) of records that match the listed content.
"aggregations": {
"department": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Drawings, Prints, and Graphic Design Department",
"doc_count": 129079
},
{
"key": "Product Design and Decorative Arts Department",
"doc_count": 28924
},
{
"key": "Textiles Department",
"doc_count": 26275
},
{
"key": "Wallcoverings Department",
"doc_count": 9189
},
{
"key": "Exhibitions Department",
"doc_count": 2480
},
{
"key": "Archives Department",
"doc_count": 800
},
{
"key": "Smithsonian Libraries",
"doc_count": 183
},
{
"key": "Digital",
"doc_count": 19
},
{
"key": "Registrars Office",
"doc_count": 1
},
{
"key": "Training",
"doc_count": 1
}
]
}
},
You can queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables multiple aggregations at the same time. This allows you to deploy a number of criteria at the same time in your applicationApplication (Computer Science) A computer software unit that provides functionality for particular use.
{
objectObject (Museology) Artefact or specimen held in a museum collection.
(Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior.(aggregations: ["department", "makerMaker (API) Creator of an object"]) {
id
summary
}
}
Aggregations are at their most useful when combined with a search, for example:
{
object(_general:"chair" aggregations: ["department", "maker"]) {
id
summary
}
}
Dataset | Possible aggregations |
---|---|
Object | classificationClassification (API) A formal terminology that can be applied to any object. Objects can have more than one classification. collector culture department departmentID maker material mediumMedium (Museology) Description of the material quality of the object or technical means of artistic expression, or production (such as metal, plastic, paint and canvas, sculptural stone, or code) period place provenanceProvenance (Museology) A record of ownership of a work of art or an antique, used as a guide to authenticity or quality. subject |
Agent | nationality relationship vocation |
ExhibitionExhibition (API) A listing of exhibitions where an object was part of the display. | label locationLocation (Museology) The Location is the city, country, or region where the object was created locationId |
TagTag (Museology) Tags are non-hierarchical keywords or terms assigned to Collection Objects which helps describe them and allows them to be found, processed automatically, or to create relationships between them. Tags are usually held within a finite, and Standard Vocabulary created by the Curatorial and Registrar department of the museum | thesaurus |