Feb. 2, 2016
I’ve been spending a lot of time lately looking at paintings, so I decided to streamline it and write a simple API to pull from The Metropolitan Museum of Art. It turned out to be a bigger challenge than expected, since The Met doesn’t offer an API or even an RSS feed. I built this simple little thing by scraping. It’s just hacked together right now, but I have some plans for it, mentioned below.
It is possible to get either a random piece of art:
var api = new MetApi(); api.GetPaintingPage(); var painting = api.GetPaintingInfo();
Or a specific one by passing in an Id:
var api = new MetApi(); api.GetPaintingPage(); var painting = api.GetPaintingInfo(12434);
Examples of other functionality can be seen in the tests, including JSON results.
I hope to eventually pull in list of art based on various criteria to make it more useful. But I mostly built it because I like randomly browsing the Met’s collection.
A working demo can be seen here: brentwaggoner.com/painting
JSON results can be seen here: brentwaggoner.com/painting/json/api
Need a solution for your website or business? Contact Me!
I love to build things. I love making the web work.
But what really matters is solving your problems. I can do that too.
Need a web site? Fill out the form below and I'll contact you to work out the details. Or email me directly at email@example.com