API docs
Readers

API reference

Readers

Rename a Reader, make it Public or Restricted, delete it, and embed it on your website.

A done PDF Build makes a Reader: the original pages, the Recording and the time of each word, at a short link such as https://app.shiurreader.com/r/0dibrutk. It shows the title and your Organization's name and logo.

The API names a Reader by its short id: reader.id in the Build, which is also the end of its link.

To show a Reader in a player of your own instead of the iframe, get its Reader data: each word's text, box on the page and time.

Rename a Reader or set its Visibility#

PATCH/api/v1/readers/{reader_id}

Send title, visibility or both, as JSON or a form. The link does not change. If any field is refused, nothing changes.

titlestring
The new title, at most 300 characters. Blank is missing_title; too long is invalid_request.
visibility"public" | "restricted"
Takes effect the next time the Reader is opened. Anything else is invalid_visibility.

curl

curl -X PATCH https://app.shiurreader.com/api/v1/readers/0dibrutk \
  -H "Authorization: Bearer $SHIUR_READER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Lehavin 6 (revised)", "visibility": "restricted"}'

Python

import os
import requests  # or httpx: the calls are the same

API = "https://app.shiurreader.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SHIUR_READER_API_KEY']}"}

response = requests.patch(
    f"{API}/readers/0dibrutk",
    headers=HEADERS,
    json={"title": "Lehavin 6 (revised)", "visibility": "restricted"},
)
reader = response.json()  # 200: {"id", "url", "title", "visibility"}

JavaScript

const API = "https://app.shiurreader.com/api/v1";
const HEADERS = { Authorization: `Bearer ${process.env.SHIUR_READER_API_KEY}` };

const response = await fetch(`${API}/readers/0dibrutk`, {
  method: "PATCH",
  headers: { ...HEADERS, "Content-Type": "application/json" },
  body: JSON.stringify({ title: "Lehavin 6 (revised)", visibility: "restricted" }),
});
const reader = await response.json(); // 200: { id, url, title, visibility }
200 OK
{
  "id": "0dibrutk",
  "url": "https://app.shiurreader.com/r/0dibrutk",
  "title": "Lehavin 6 (revised)",
  "visibility": "restricted"
}

Delete a Reader#

DELETE/api/v1/readers/{reader_id}

Takes the Reader offline at once and removes its files. It cannot be undone.

curl

curl -X DELETE https://app.shiurreader.com/api/v1/readers/0dibrutk \
  -H "Authorization: Bearer $SHIUR_READER_API_KEY"

Python

import os
import requests  # or httpx: the calls are the same

API = "https://app.shiurreader.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SHIUR_READER_API_KEY']}"}

response = requests.delete(f"{API}/readers/0dibrutk", headers=HEADERS)
assert response.status_code == 204  # no body

JavaScript

const API = "https://app.shiurreader.com/api/v1";
const HEADERS = { Authorization: `Bearer ${process.env.SHIUR_READER_API_KEY}` };

const response = await fetch(`${API}/readers/0dibrutk`, { method: "DELETE", headers: HEADERS });
if (response.status !== 204) throw new Error((await response.json()).error.message);
Response
HTTP/1.1 204 No Content

After that:

404 Not Found
{
  "error": {
    "code": "not_found",
    "message": "No Reader with this id in your Organization."
  }
}

Visibility#

Public
Anyone with the link can open the Reader, and it can be embedded on any website.
Restricted
The Reader opens only inside an iframe on one of your Organization's Allowed Sites. Opened anywhere else, including directly, it shows "not available here".

New Readers get your Organization's default Visibility, which starts as Public, unless the Build asked for one. An Owner can change the default on the Organization page of the website.

Allowed Sites#

An Owner lists the Allowed Sites on the Organization page: the websites where your Restricted Readers may be embedded, up to 50. They are set on the website, not through the API.

Embed Code#

To show a Reader on your website, put its link in an iframe. The website's Reader page has this snippet ready to copy; from the API, build it from reader.url:

HTML
<iframe src="https://app.shiurreader.com/r/0dibrutk" title="Lehavin 6" width="100%" height="720" style="border:0;max-width:100%" allow="autoplay; fullscreen" referrerpolicy="origin" loading="lazy"></iframe>

Keep referrerpolicy="origin"

A Restricted Reader checks which site embeds it. This attribute makes the browser tell it, even on sites that turn referrers off. Without it, a Restricted Reader may refuse to open.