Skip to content

xavxyz/metmuseum-graphql-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The MET - Logo

A GraphQL API wrapping the Metropolitan Museum of Art Collection API.

Usage

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"

Limitations

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

Dev

# Install the dependencies
npm install

# Run the Node server
npm run dev

Monitoring

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.

Aknowledgements

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.

About

A GraphQL API wrapping the Metropolitan Museum of Art Collection API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published