Embed
Embed is a service that provides an embeddable version of content hosted in the Stanford Digital Repository. Embed uses the oEmbed specification for providing an oEmbed response or can embed content directly using an iframe.
API
The base url used for this service is https://embed.stanford.edu.
oEmbed
GET /embed
Summary
Returns a rich oEmbed response for Stanford Digital Repository content.
Parameters
| Name | Located In | Description | Required | Type | Default | Example |
|---|---|---|---|---|---|---|
url |
query | URL of persistent url location of digital library content | Yes | string | null | https://purl.stanford.edu/fw090jw3474 |
format |
query | Format requested of response. Valid values are json or xml |
No | string | json |
json |
maxheight |
query | Maximum height of viewer | No | integer | null | 300 |
maxwidth |
query | Maximum width of viewer | No | integer | null | 500 |
hide_title |
query | Hide the title in the viewer | No | boolean | false |
true |
Example request
$ curl 'https://embed.stanford.edu/embed?url=https://purl.stanford.edu/fw090jw3474'
Example response
{
"type": "rich",
"version": "1.0",
"provider_name": "SUL Embed Service",
"title": "1st Street Arcade San Francisco",
"height": "31.25rem",
"width": null,
"html": "<iframe\n src='https://embed.stanford.edu/iframe?url=https://purl.stanford.edu/fw090jw3474&' style='height: 31.25rem; width: 100%;'\n frameborder='0' marginwidth='0' marginheight='0' scrolling='no' allowfullscreen\n />"
}
iframe
GET /iframe
Summary
Returns an iframe of HTML that can be directly embedded for Stanford Digital Repository content.
Parameters
| Name | Located In | Description | Required | Type | Default | Example |
|---|---|---|---|---|---|---|
url |
query | URL of persistent url location of digital library content | Yes | string | null | https://purl.stanford.edu/fw090jw3474 |
maxheight |
query | Maximum height of viewer | No | integer | null | 300 |
maxwidth |
query | Maximum width of viewer | No | integer | null | 500 |
hide_title |
query | Hide the title in the viewer | No | boolean | false |
true |
Example request
$ curl 'https://embed.stanford.edu/iframe?url=https://purl.stanford.edu/fw090jw3474'
Example response
<!DOCTYPE html>
<html>
<head>
<script src="//js.honeybadger.io/v6.5/honeybadger.min.js" type="text/javascript"></script>
<script type="text/javascript">
Honeybadger.configure({
apiKey: 'f07b0c1b',
environment: 'prod',
debug: false,
onerror: true
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-80J719XWE5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
const debug = false
gtag('js', new Date());
// To turn off debug mode, exclude the parameter altogether (cannot just set to false)
// See https://support.google.com/analytics/answer/7201382?hl=en#zippy=%2Cgoogle-tag-websites
const args = {
'collection': document.querySelector('link[rel="up"]')?.getAttribute('href')
}
if (debug) {
args["debug_mode"] = debug
}
gtag('config', 'G-80J719XWE5', args)
</script>
<script src="https://cdn.jsdelivr.net/npm/ahoy.js@0.4.3/dist/ahoy.js"
integrity="sha384-s9X57Wbu8jIIErBMhudZJEAS1ZkelgbMI7/HUqsgjFBBm9IXyfbpKQ+ZoWUUvpgE"
crossorigin="anonymous"></script>
<script>
// Set up Ahoy
ahoy.configure({
visitDuration: 60, // measured in minutes; this is Zenodo's default
cookies: false, // use anonymity sets instead
urlPrefix: "https://sdr-metrics-api-prod.stanford.edu",
});
</script>
<link rel="stylesheet" href="/assets/mirador-63c391df.css" />
<link rel="up" href="https://purl.stanford.edu/sk882gx0113" />
</head>
<body style="margin: 0">
<div class="sul-embed-container" id='sul-embed-object' hidden>
<div
id='sul-embed-mirador'
class='mirador'
data-mirador-uri='https://purl.stanford.edu/fw090jw3474/iiif/manifest'
data-viewer-config=''
data-canvas-id=''
data-canvas-index=''
data-hide-title='false'
data-show-attribution='false'
data-cdl='false'
data-search=''
data-suggested-search=''>
</div>
<script src="/vite/assets/mirador-BZjCj4LH.js" crossorigin="anonymous" type="module"></script>
</div>
</body>
</html>