{
  "components": {
    "schemas": {
      "Citation": {
        "properties": {
          "book": {
            "properties": {
              "authors": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "publisher": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "year": {
                "type": "string"
              }
            },
            "required": [
              "title"
            ],
            "type": "object"
          },
          "cached": {
            "type": "boolean"
          },
          "citations": {
            "properties": {
              "apa": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "bibtex": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "chicago": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mla": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "wp": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [],
            "type": "object"
          },
          "conflicts": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "consulted": {
            "type": "object"
          },
          "coverage": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "isbn": {
            "$ref": "#/components/schemas/ISBN"
          },
          "ok": {
            "const": true
          },
          "quality": {
            "description": "Available field quality, omissions and uncertainty; fields may evolve.",
            "type": "object"
          },
          "supported_styles": {
            "items": {
              "enum": [
                "mla",
                "apa",
                "chicago",
                "wp",
                "bibtex"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "isbn",
          "ok",
          "found",
          "citations",
          "supported_styles",
          "cached"
        ],
        "type": "object"
      },
      "Error": {
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "ok": {
            "const": false
          },
          "supported_styles": {
            "items": {
              "enum": [
                "mla",
                "apa",
                "chicago",
                "wp",
                "bibtex"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "ok",
          "error",
          "message"
        ],
        "type": "object"
      },
      "ISBN": {
        "properties": {
          "input": {
            "type": "string"
          },
          "isbn13": {
            "pattern": "^[0-9]{13}$",
            "type": "string"
          },
          "normalized": {
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          }
        },
        "required": [
          "input",
          "normalized",
          "isbn13",
          "valid"
        ],
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Free access without an account or key. Five styles from an immutable local publication, with normalized ISBN identity and available quality/uncertainty. Current per-client limit: 50 requests/second with burst 100. Limit responses use 429 and Retry-After. These examples are synthetic editions illustrating the wire shape.",
    "title": "OttoBib",
    "version": "6b78e58"
  },
  "openapi": "3.1.0",
  "paths": {
    "/isbn/{isbn}": {
      "get": {
        "description": "Use Accept: application/json for JSON or text/html for the citation page.",
        "operationId": "citeISBN",
        "parameters": [
          {
            "description": "ISBN-10 or ISBN-13; hyphens optional",
            "in": "path",
            "name": "isbn",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Both modes read the immutable local publication; neither performs synchronous acquisition.",
            "in": "query",
            "name": "lookup",
            "schema": {
              "default": "best-effort",
              "enum": [
                "local",
                "best-effort"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "found": {
                    "value": {
                      "book": {
                        "authors": [
                          "A. Example"
                        ],
                        "title": "A fixture edition",
                        "year": "2001"
                      },
                      "cached": false,
                      "citations": {
                        "apa": "Example, A. (2001). A fixture edition.",
                        "bibtex": "@book{fixture, title={A fixture edition}, author={A. Example}, year={2001}}",
                        "chicago": "Example, A. A fixture edition. 2001.",
                        "mla": "Example, A. A fixture edition. 2001.",
                        "wp": "{{cite book |title=A fixture edition |author=A. Example |year=2001}}"
                      },
                      "found": true,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  },
                  "missing": {
                    "value": {
                      "cached": false,
                      "citations": {
                        "apa": null,
                        "bibtex": null,
                        "chicago": null,
                        "mla": null,
                        "wp": null
                      },
                      "found": false,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Citation"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Lookup completed. found:false is terminal for this immediate attempt; it does not establish that the book does not exist."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "isbn-malformed",
                      "message": "Not an ISBN-10 or ISBN-13 after removing separators.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Invalid ISBN, style or lookup mode; correct the input before retrying."
          },
          "429": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "rate-limited",
                      "message": "Too many requests from this client. Slow down and retry; this limit is generous and is not a paywall.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Request limit reached; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "internal",
                      "message": "Unexpected error.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Unexpected temporary failure."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "upstream-unavailable",
                      "message": "Could not reach a metadata source in time. This is temporary; retry shortly.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Temporary publication/read failure; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Read prepared citations by ISBN"
      }
    },
    "/isbn/{isbn}.json": {
      "get": {
        "description": "Explicit .json selects JSON independently of Accept or user-agent.",
        "operationId": "citeISBNJSON",
        "parameters": [
          {
            "description": "ISBN-10 or ISBN-13; hyphens optional",
            "in": "path",
            "name": "isbn",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Both modes read the immutable local publication; neither performs synchronous acquisition.",
            "in": "query",
            "name": "lookup",
            "schema": {
              "default": "best-effort",
              "enum": [
                "local",
                "best-effort"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "found": {
                    "value": {
                      "book": {
                        "authors": [
                          "A. Example"
                        ],
                        "title": "A fixture edition",
                        "year": "2001"
                      },
                      "cached": false,
                      "citations": {
                        "apa": "Example, A. (2001). A fixture edition.",
                        "bibtex": "@book{fixture, title={A fixture edition}, author={A. Example}, year={2001}}",
                        "chicago": "Example, A. A fixture edition. 2001.",
                        "mla": "Example, A. A fixture edition. 2001.",
                        "wp": "{{cite book |title=A fixture edition |author=A. Example |year=2001}}"
                      },
                      "found": true,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  },
                  "missing": {
                    "value": {
                      "cached": false,
                      "citations": {
                        "apa": null,
                        "bibtex": null,
                        "chicago": null,
                        "mla": null,
                        "wp": null
                      },
                      "found": false,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Citation"
                }
              }
            },
            "description": "Lookup completed. found:false is terminal for this immediate attempt; it does not establish that the book does not exist."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "isbn-malformed",
                      "message": "Not an ISBN-10 or ISBN-13 after removing separators.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid ISBN, style or lookup mode; correct the input before retrying."
          },
          "429": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "rate-limited",
                      "message": "Too many requests from this client. Slow down and retry; this limit is generous and is not a paywall.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request limit reached; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "internal",
                      "message": "Unexpected error.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected temporary failure."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "upstream-unavailable",
                      "message": "Could not reach a metadata source in time. This is temporary; retry shortly.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Temporary publication/read failure; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Read prepared citations by ISBN"
      }
    },
    "/isbn/{isbn}/{style}": {
      "get": {
        "description": "Use Accept: application/json for JSON or text/html for the citation page.",
        "operationId": "citeISBNStyle",
        "parameters": [
          {
            "description": "ISBN-10 or ISBN-13; hyphens optional",
            "in": "path",
            "name": "isbn",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Both modes read the immutable local publication; neither performs synchronous acquisition.",
            "in": "query",
            "name": "lookup",
            "schema": {
              "default": "best-effort",
              "enum": [
                "local",
                "best-effort"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "style",
            "required": true,
            "schema": {
              "enum": [
                "mla",
                "apa",
                "chicago",
                "wp",
                "bibtex"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "found": {
                    "summary": "Example for style=mla",
                    "value": {
                      "book": {
                        "authors": [
                          "A. Example"
                        ],
                        "title": "A fixture edition",
                        "year": "2001"
                      },
                      "cached": false,
                      "citations": {
                        "mla": "Example, A. A fixture edition. 2001."
                      },
                      "found": true,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  },
                  "missing": {
                    "summary": "Example for style=mla",
                    "value": {
                      "cached": false,
                      "citations": {
                        "mla": null
                      },
                      "found": false,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Citation"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Lookup completed. found:false is terminal for this immediate attempt; it does not establish that the book does not exist."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "isbn-malformed",
                      "message": "Not an ISBN-10 or ISBN-13 after removing separators.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Invalid ISBN, style or lookup mode; correct the input before retrying."
          },
          "429": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "rate-limited",
                      "message": "Too many requests from this client. Slow down and retry; this limit is generous and is not a paywall.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Request limit reached; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "internal",
                      "message": "Unexpected error.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Unexpected temporary failure."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "upstream-unavailable",
                      "message": "Could not reach a metadata source in time. This is temporary; retry shortly.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/html": {
                "examples": {
                  "page": {
                    "value": "\u003c!doctype html\u003e\u003chtml lang=\"en\"\u003e\u003ctitle\u003eCitation lookup\u003c/title\u003e\u003cp\u003eLookup result\u003c/p\u003e\u003c/html\u003e"
                  }
                },
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Temporary publication/read failure; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Read prepared citations by ISBN"
      }
    },
    "/isbn/{isbn}/{style}.json": {
      "get": {
        "description": "Explicit .json selects JSON independently of Accept or user-agent.",
        "operationId": "citeISBNStyleJSON",
        "parameters": [
          {
            "description": "ISBN-10 or ISBN-13; hyphens optional",
            "in": "path",
            "name": "isbn",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Both modes read the immutable local publication; neither performs synchronous acquisition.",
            "in": "query",
            "name": "lookup",
            "schema": {
              "default": "best-effort",
              "enum": [
                "local",
                "best-effort"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "style",
            "required": true,
            "schema": {
              "enum": [
                "mla",
                "apa",
                "chicago",
                "wp",
                "bibtex"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "found": {
                    "summary": "Example for style=mla",
                    "value": {
                      "book": {
                        "authors": [
                          "A. Example"
                        ],
                        "title": "A fixture edition",
                        "year": "2001"
                      },
                      "cached": false,
                      "citations": {
                        "mla": "Example, A. A fixture edition. 2001."
                      },
                      "found": true,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  },
                  "missing": {
                    "summary": "Example for style=mla",
                    "value": {
                      "cached": false,
                      "citations": {
                        "mla": null
                      },
                      "found": false,
                      "isbn": {
                        "input": "9780226458113",
                        "isbn13": "9780226458113",
                        "normalized": "9780226458113",
                        "valid": true
                      },
                      "ok": true,
                      "supported_styles": [
                        "mla",
                        "apa",
                        "chicago",
                        "wp",
                        "bibtex"
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Citation"
                }
              }
            },
            "description": "Lookup completed. found:false is terminal for this immediate attempt; it does not establish that the book does not exist."
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "isbn-malformed",
                      "message": "Not an ISBN-10 or ISBN-13 after removing separators.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid ISBN, style or lookup mode; correct the input before retrying."
          },
          "429": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "rate-limited",
                      "message": "Too many requests from this client. Slow down and retry; this limit is generous and is not a paywall.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request limit reached; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "internal",
                      "message": "Unexpected error.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected temporary failure."
          },
          "503": {
            "content": {
              "application/json": {
                "examples": {
                  "example": {
                    "value": {
                      "error": "upstream-unavailable",
                      "message": "Could not reach a metadata source in time. This is temporary; retry shortly.",
                      "ok": false
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Temporary publication/read failure; follow Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Read prepared citations by ISBN"
      }
    }
  },
  "servers": [
    {
      "url": "https://www.ottobib.com"
    }
  ]
}
