oEmbed
The oEmbed website
oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.
The Cooper Hewitt oEmbed endpoint allows you to request either link
or photo
information for an object in our collection from the following URLs:
- https://collection.cooperhewitt.org/oembed – defaults to
link
- https://collection.cooperhewitt.org/oembed/link/
- https://collection.cooperhewitt.org/oembed/photo/
You may pass either the URL of a collection object or an image URL representing a collection object. The ability to pass an image URL in order to retrieve metadata is not part of the official oEmbed spec but we thought that it would be a useful feature so we've just gone ahead and added it. All responses are returned as JSON.
For example:
# See the way we've truncated the image # URL below? The actual URL is # http://https://images.collection.cooperhewitt.org//22592_a03339c4ea6345a2_b.jpg # Get link information for a photo GET https://collection.cooperhewitt.org/oembed/?url=.../21310_670174e589d6b723_b.jpg { "object_id": "18704235", "object_url": "https://collection.cooperhewitt.org/objects/18704235/", "provider_name": "Cooper Hewitt", "provider_url": "https://www.cooperhewitt.org/", "title": "Vacuum Cleaner, \"iRobot Roomba Vacuuming Robot\"", "type": "link", "url": "https://images.collection.cooperhewitt.org/21310_670174e589d6b723_b.jpg", "version": "1.0", } # Get photo information for an object GET https://collection.cooperhewitt.org/oembed/photo?url=.../objects/18704235/ { "height": 640, "object_id": "18704235", "object_url": "https://collection.cooperhewitt.org/objects/210726/", "provider_name": "Cooper Hewitt", "provider_url": "https://www.cooperhewitt.org/", "thumbnail_height": 320, "thumbnail_url": "https://images.collection.cooperhewitt.org/21310_670174e589d6b723_n.jpg", "thumbnail_width": 294, "title": "Vacuum Cleaner, \"iRobot Roomba Vacuuming Robot\"", "type": "photo", "url": "https://images.collection.cooperhewitt.org/21310_670174e589d6b723_z.jpg", "version": "1.0", "width": 589 }
Support for Cross-Origin Resource Sharing (CORS) requests is enabled for the oEmbed endpoint.
Remember: Not all objects have images that are available for public display so if you are requesting photo
information for an object with no image the oEmbed endpoint will return a 404 error.