# Books subject catalogue API

Get Open Library Subjects data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, subject, and retrieve structured data including resolved subject name, source-reported subject work count, work identifier, work title, and related catalogue metadata for reading catalogue, and record matching.

Documentation: https://openany.si/books/books-subject-catalogue-api/b6f59e6c-0e83-44e7-a82e-cbbd4d5eac3c/
API ID: b6f59e6c-0e83-44e7-a82e-cbbd4d5eac3c
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/books/v1/subject
Page update time: 2026-12-03T02:44:39.448Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:44:38.402Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## Open Library Subjects API

subject selects a category such as science\_fiction, history or cooking. ebooks=true restricts to books with an e-book; it does not change the underlying access terms. The response lists work-level records and related catalogue facets. limit defaults to 20, maximum 100, and page defaults to 1.

## What You Can Build

- **Reading catalogue**: Retain the returned source IDs and bibliographic links when adding entries to a reading catalogue.
- **Record matching**: Use resource identity and related author or edition records to match catalogue entries.

## Returned Data

| Field | Meaning |
| --- | --- |
| `subject` | Resolved subject name |
| `work_count` | Source-reported subject work count |
| `items[].work_id` | Work identifier |
| `items[].title` | Work title |
| `related` | Related catalogue metadata |
| `next_page` | Next subject page |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Books subject catalogue API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "subject": {
          "type": "string",
          "description": "Subject, e.g. science_fiction, love, history, cooking."
        },
        "ebooks": {
          "type": "boolean",
          "description": "`true`: only books with an e-book."
        },
        "limit": {
          "type": "integer",
          "description": "Per page (default 20, max 100)."
        },
        "page": {
          "type": "integer",
          "description": "Page (default 1)."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      },
      "required": [
        "subject"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "attribution": {
      "type": "string"
    },
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "items": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "authors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              },
              "cover": {
                "type": "string"
              },
              "edition_count": {
                "type": "integer"
              },
              "first_publish_year": {
                "type": "integer"
              },
              "has_fulltext": {
                "type": "boolean"
              },
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "work_id": {
                "type": "string"
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "next_page": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "related": {
      "type": "object",
      "properties": {
        "authors": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "publishers": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "string"
              }
            ]
          }
        },
        "subjects": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "string"
              }
            ]
          }
        }
      }
    },
    "subject": {
      "type": "string"
    },
    "work_count": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/books/v1/subject?output=json&subject=science_fiction' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "attribution": "Source: Open Library (openlibrary.org), Internet Archive",
  "cached": false,
  "count": 20,
  "credits_used": 1,
  "items": [
    {
      "authors": [
        {
          "id": "OL22098A",
          "name": "Lewis Carroll"
        }
      ],
      "cover": "https://covers.openlibrary.org/b/id/10527843-M.jpg",
      "edition_count": 3548,
      "first_publish_year": 1865,
      "has_fulltext": true,
      "title": "Alice's Adventures in Wonderland",
      "url": "https://openlibrary.org/works/OL138052W",
      "work_id": "OL138052W"
    },
    {
      "authors": [
        {
          "id": "OL25342A",
          "name": "Mary Shelley"
        }
      ],
      "cover": "https://covers.openlibrary.org/b/id/12356249-M.jpg",
      "edition_count": 2187,
      "first_publish_year": 1818,
      "has_fulltext": true,
      "title": "Frankenstein; or, The Modern Prometheus",
      "url": "https://openlibrary.org/works/OL450063W",
      "work_id": "OL450063W"
    },
    "… 18 more"
  ],
  "next_page": 2,
  "page": 1,
  "related": {
    "authors": [
      {
        "count": 236,
        "name": "Isaac Asimov"
      },
      {
        "count": 164,
        "name": "Martin H. Greenberg"
      },
      "… 18 more"
    ],
    "publishers": [
      {
        "count": 643,
        "name": "Orion Publishing Group, Limited"
      },
      {
        "count": 589,
        "name": "Tandem Library"
      },
      "… 18 more"
    ],
    "subjects": [
      {
        "count": 9136,
        "name": "Fiction"
      },
      {
        "count": 7315,
        "name": "Children's fiction"
      },
      "… 18 more"
    ]
  },
  "subject": "science fiction",
  "work_count": 21250
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### How do I identify the subject?
Pass a subject name such as science_fiction, love, history or cooking.

### Does ebooks=true mean all copies are freely readable?
No. It filters e-book availability; check the source’s access conditions.

### Are results works or editions?
They are work-level entries; inspect a work for editions.

### How do I continue the list?
Pass next_page as page; limit defaults to 20 and permits up to 100.

### How do I bypass cached results?
Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or set output=json.

## Available implementations
- apish: https://openany.si/books/books-subject-catalogue-api/b6f59e6c-0e83-44e7-a82e-cbbd4d5eac3c/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
