chasestarr / ideas

Dump for app ideas. Find in issues
0 stars 0 forks source link

Placeholder img from artsy api #3

Open chasestarr opened 8 years ago

chasestarr commented 8 years ago

example json response:

{
  "id": "516dfb9ab31e2b2270000c45",
  "created_at": "2013-04-17T01:32:10+00:00",
  "updated_at": "2015-03-13T07:27:56+00:00",
  "title": "The Old Violin",
  "category": "Painting",
  "medium": "Oil on canvas",
  "date": "1886",
  "dimensions": {
    "in": {
      "text": "38 × 23 5/8 in",
      "height": 38.0,
      "width": 23.625,
      "depth": null,
      "diameter": null
    },
    "cm": {
      "text": "96.5 × 60 cm",
      "height": 96.5,
      "width": 60.0,
      "depth": null,
      "diameter": null
    }
  },
  "website": "",
  "signature": "",
  "series": "",
  "provenance": "",
  "literature": "",
  "exhibition_history": "",
  "collecting_institution": "National Gallery of Art, Washington D.C.",
  "additional_information": "\n    overall: 96.5 x 60 cm (38 x 23 5/8 in.)  framed: 119.7 x 84.1 x 5.1 cm (47 1/8 x 33 1/8 x 2 in.)\n    ",
  "image_rights": "Courtesy National Gallery of Art, Washington",
  "blurb": "",
  "unique": false,
  "cultural_maker": null,
  "can_inquire": false,
  "can_acquire": false,
  "can_share": true,
  "sale_message": null,
  "sold": false,
  "_links": {
    "curies": [
      {
        "name": "image",
        "href": "https://d32dm0rphc51dk.cloudfront.net/dTGcd0Xx0aEp_MDFdHIUIw/{rel}",
        "templated": true
      }
    ],
    "thumbnail": {
      "href": "https://d32dm0rphc51dk.cloudfront.net/dTGcd0Xx0aEp_MDFdHIUIw/medium.jpg"
    },
    "image:self": {
      "href": "https://d32dm0rphc51dk.cloudfront.net/dTGcd0Xx0aEp_MDFdHIUIw/{?image_version}.jpg",
      "templated": true
    },
    "partner": {
      "href": "https://api.artsy.net/api/partners/4f99c7b793ab4b0001000179"
    },
    "self": {
      "href": "https://api.artsy.net/api/artworks/516dfb9ab31e2b2270000c45"
    },
    "permalink": {
      "href": "http://www.artsy.net/artwork/william-michael-harnett-the-old-violin"
    },
    "genes": {
      "href": "https://api.artsy.net/api/genes?artwork_id=516dfb9ab31e2b2270000c45"
    },
    "artists": {
      "href": "https://api.artsy.net/api/artists?artwork_id=516dfb9ab31e2b2270000c45"
    },
    "similar_artworks": {
      "href": "https://api.artsy.net/api/artworks?similar_to_artwork_id=516dfb9ab31e2b2270000c45"
    }
  },
  "image_versions": [
    "large",
    "large_rectangle",
    "larger",
    "medium",
    "medium_rectangle",
    "normalized",
    "square",
    "tall"
  ],
  "_embedded": {
    "editions": [

    ]
  }
}
chasestarr commented 8 years ago

artsy api does not have a way to query for "size of image". I could see a brute force approach of looking for random images, checking height to width ratio, rejecting or accepting the image. Does not seem very optimized....

chasestarr commented 8 years ago

link to artwork documentation

chasestarr commented 8 years ago

Looks like only royalty free images are available for query from the api... Contemporary art examples were the main draw I had to this idea initially