Get Cover URL
openlibrary_get_cover_urlResolve a cover image URL for a book or author photo. Returns a direct HTTPS URL in the requested size (S/M/L). The Covers API always returns HTTP 200 — missing covers return a 1×1 placeholder GIF, not a 404 — so the identifier format is validated locally first: "id" must be numeric, "isbn" 10 or 13 digits, "olid" an edition OLID (OL…M) for target "book" and an author OLID (OL…A) for target "author". Identifiers with path separators or control characters, and author-by-ISBN lookups, are rejected before any request. URLs can be embedded in markdown as .
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size. S = small (~45px tall), M = medium (~150px tall), L = large (~400px tall). | M |
| target | No | "book" returns a book cover from covers.openlibrary.org/b/. "author" returns an author photo from covers.openlibrary.org/a/ — use with id_type "id" (photo_id) or "olid" (author OLID). | book |
| id_type | Yes | "id" is the numeric cover_i / cover ID from search or work results. "isbn" and "olid" look up the cover from those identifiers. | |
| identifier | Yes | The identifier value, validated against id_type before the URL is built. For "id": a numeric cover or photo ID from work/edition/author data. For "isbn": 10 or 13 digits, hyphens optional. For "olid": an edition OLID (OL…M) for target "book", an author OLID (OL…A) for target "author". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Direct HTTPS URL to the cover image. The Covers API returns HTTP 200 for all requests — a 1×1 placeholder GIF is returned when no cover exists for the identifier. | |
| note | No | Reminder that the URL always returns HTTP 200; a placeholder GIF is served when no cover exists. | |
| error | No | Present when the call failed. Absent on success. |