Get Subject
openlibrary_get_subjectBrowse works by subject. Returns matching works with edition counts and cover IDs, plus the total work count for the subject. Case and spacing are normalized before lookup, so "Science Fiction" and "science_fiction" are the same request. Subject tags are user-contributed and the vocabulary varies — when a subject returns no works, try a different word form (singular/plural), a synonym, or a broader term.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max works to return. Subject pages typically show 12 at a time. | |
| offset | No | Zero-based offset for pagination. | |
| subject | Yes | Subject name. Normalized before lookup — lowercased with spaces converted to underscores (e.g., "Science Fiction" → "science_fiction") — so varying case or spacing does not change the result. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| works | No | Works under this subject, up to limit. | |
| notice | No | Recovery guidance when work_count is 0 — echoes the subject and suggests alternatives. Absent when works are found. | |
| totalCount | No | Total works tagged with this subject across all pages. | |
| work_count | No | Total works tagged with this subject. | |
| subject_key | No | Normalized subject key (lowercase, underscores). | |
| subject_name | No | Canonical subject name as stored on Open Library. |