Open Library API
openlibrary.org · Data
Internet Archive's Open Library — search 20+ million books, access metadata, covers, author data, and full texts for public domain works. No API key required.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Search books
Search for books by title, author, or keyword.
https://openlibrary.org/search.json?q=the lord of the rings&limit=5
Hover any highlighted part to learn what it does
curl -X GET "https://openlibrary.org/search.json?q=the%20lord%20of%20the%20rings&limit=5"
import requests
params = {
"q": "the lord of the rings",
"limit": "5"
}
response = requests.get(
"https://openlibrary.org/search.json",
params=params,
)
print(response.json())const url = new URL('https://openlibrary.org/search.json');
url.searchParams.set('q', 'the lord of the rings');
url.searchParams.set('limit', '5');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://openlibrary.org/search.json")
q := baseURL.Query()
q.Set("q", "the lord of the rings")
q.Set("limit", "5")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://openlibrary.org/search.json")
uri.query = URI.encode_www_form({
"q" => "the lord of the rings",
"limit" => "5"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://openlibrary.org/search.json?" . http_build_query([
"q" => "the lord of the rings",
"limit" => "5"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Get book by ISBN
Get book details by ISBN.
https://openlibrary.org/isbn/9780743273565.json
Hover any highlighted part to learn what it does
curl -X GET "https://openlibrary.org/isbn/9780743273565.json"
import requests
response = requests.get(
"https://openlibrary.org/isbn/9780743273565.json",
)
print(response.json())const url = 'https://openlibrary.org/isbn/9780743273565.json'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://openlibrary.org/isbn/9780743273565.json"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://openlibrary.org/isbn/9780743273565.json")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://openlibrary.org/isbn/9780743273565.json";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Search: GET https://openlibrary.org/search.json?q=harry+potter&limit=5
- By ISBN: GET https://openlibrary.org/isbn/9780743273565.json
- Book covers: https://covers.openlibrary.org/b/isbn/{isbn}-L.jpg