A GraphQL API wrapping the Metropolitan Museum of Art Collection API.
Visit https://metmuseum-graphql.now.sh/ and run the following query in the playground:
query exploreTheMetCollection {
allObjects(limit: 10) {
total
objects {
title
artist {
displayName
beginDate
endDate
}
url
}
}
}
I invite you to explore the schema via the tab on the right side of the UI and build awesome things with this API 🤩
You can query it like any other GraphQL API, with your favorite GraphQL client or a simple HTTP request: https://metmuseum-graphql.now.sh
The most basic usage would be:
# ask for the artworks total
curl http://metmuseum-graphql.now.sh -X POST -d "{\"query\": \"{ allObjects { total } }\"}" -H "Content-Type: application/json"
You cannot ask more than 20 objects at the same time (= 20 requests in parallel to the REST API), and results are cached one day.
These limitations have been mindfully set to prevent hammering the REST API
# Install the dependencies
npm install
# Run the Node server
npm run dev
Recommended but optional, you can enable cache control to avoid hammering the MET API, you'll need an Apollo Engine API key.
Once you have one, copy .env.sample
to .env
and replace the default value by your API key.
Thanks for the MET team for building an awesome API allowing us to discover more than 470,000 artworks. Find out more at https://metmuseum.github.io.