Open Library Expert

Open Library Expert · GPT アクション

Open Library Search API

Schema for the Open Library Search API

  • GET /search.jsonSearch for books on Open Library
元の API スキーマ
{
  "openapi": "3.0.0",
  "info": {
    "title": "Open Library Search API",
    "description": "Schema for the Open Library Search API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://openlibrary.org"
    }
  ],
  "paths": {
    "/search.json": {
      "get": {
        "summary": "Search for books on Open Library",
        "operationId": "searchBooks",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "The Solr query to search for books, authors, or titles.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "The fields to retrieve from Solr. Use \"*\" to get all fields.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Sort the results by various facets such as new, old, random, or key.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "The user's language as a two-letter ISO 639-1 code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The starting offset for pagination.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The page number for pagination (starts at 1).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response with book search results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "integer",
                      "description": "The starting index of the results."
                    },
                    "num_found": {
                      "type": "integer",
                      "description": "The total number of results found."
                    },
                    "docs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "cover_i": {
                            "type": "integer",
                            "description": "The cover image ID."
                          },
                          "has_fulltext": {
                            "type": "boolean",
                            "description": "Indicates if the book has full text available."
                          },
                          "edition_count": {
                            "type": "integer",
                            "description": "The number of editions available for the book."
                          },
                          "title": {
                            "type": "string",
                            "description": "The title of the book."
                          },
                          "author_name": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "description": "The name of the author(s) of the book."
                            }
                          },
                          "first_publish_year": {
                            "type": "integer",
                            "description": "The year when the book was first published."
                          },
                          "key": {
                            "type": "string",
                            "description": "The Open Library key for the book."
                          },
                          "ia": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "description": "A list of Internet Archive IDs related to the book."
                            }
                          },
                          "author_key": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "description": "The Open Library key for the author(s) of the book."
                            }
                          },
                          "public_scan_b": {
                            "type": "boolean",
                            "description": "Indicates if the book is available for public scanning."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}