It looks like you're offline.
Open Library logo

Open Library RESTful API → Diff

Added
Modified
Removed
Not changed
Revision 14 by Anand Chitipothu November 10, 2011
Revision 21 by jachamp September 1, 2023
body
0 <style type="text/css"> 0 <style type="text/css">
... ...
5 5
6 * [[#content|Content]] 6 <ul>
7 * [[#query|Query]] 7  <li><a href="#content">Content</a></li>
8 * [[#history|History]] 8  <li><a href="#query">Query</a></li>
9 * [[#save|Save]] 9  <li><a href="#history">History</a></li>
10 * [[#status_codes|Status Codes]] 10  <li><a href="#recent_changes">Recent Changes</a></li>
11  <li><a href="#login">Login</a></li>
12  <li><a href="#save">Save</a></li>
13  <li><a href="#status_codes">Status Codes</a></li>
14 </ul>
11 11
... ...
22    } 22    }
23    $ curl -s -H 'Accept: application/json' http://openlibrary.org/books/OL1M 27    $ curl -s -H 'Accept: application/json' https://openlibrary.org/books/OL1M
24    { 24    {
... ...
38 38
39    $ curl http://openlibrary.org/books/OL6807502M.rdf 43    $ curl https://openlibrary.org/books/OL6807502M.rdf
40    <rdf:Description rdf:about="http://openlibrary.org/books/OL6807502M"> 40    <rdf:Description rdf:about="http://openlibrary.org/books/OL6807502M">
... ...
54    </rdf:RDF> 54    </rdf:RDF>
55    $ curl -H 'Accept: application/rdf+xml' http://openlibrary.org/books/OL6807502M.rdf 59    $ curl -H 'Accept: application/rdf+xml' https://openlibrary.org/books/OL6807502M.rdf
56    <rdf:Description rdf:about="http://openlibrary.org/books/OL6807502M"> 56    <rdf:Description rdf:about="http://openlibrary.org/books/OL6807502M">
... ...
112    ] 112    ]
113    $ curl -H 'Accept: application/json' 'http://openlibrary.org/query?type=/type/edition&authors=/authors/OL1A' 117    $ curl -H 'Accept: application/json' 'https://openlibrary.org/query?type=/type/edition&authors=/authors/OL1A'
114    [ 114    [
... ...
190 190
191 *Please note that this API should not be used for bulk downloads.* Dumps of the entire data are provided at regular intervals and they can be used for bulk access. 195 *Please note that this API should not be used for bulk downloads.* [[/developers/dumps|Dumps of all data]] are provided at regular intervals and they should be used for bulk access.
192 192
... ...
206    ] 206    ]
207    $ curl -H 'Accept: application/json' http://openlibrary.org/books/OL1M?m=history 211    $ curl -H 'Accept: application/json' https://openlibrary.org/books/OL1M?m=history
208    [ 208    [
... ...
238 238
243 <a name="recent_changes">&nbsp;</a>
239 ## Recent Changes 239 ## Recent Changes
... ...
250    ] 250    ]
251    $ curl -H 'Accept: application/json' http://openlibrary.org/recentchanges 256    $ curl -H 'Accept: application/json' https://openlibrary.org/recentchanges
252    [ 252    [
... ...
267 267
268 <a name="login">&nsbp;</a> 273 <a name="login">&nbsp;</a>
269 ## Login 274 ## Login
270 275
271 To login to Open Library programatically, a POST request must be send to `/account/login` with `username` and `password` must be passed as a JSON dictionary. 276 To login to Open Library programatically, a POST request must be send to `/account/login.json` with your S3 `access` and `secret` keys passed as a JSON dictionary.
272 277
273    $ curl -i -H 'Content-Type: application/json' -d '{"username": "joe", "password": "secret"}' http://openlibrary.org/account/login 278    $ curl -i -H 'Content-Type: application/json' -d '{"access": "your access key", "secret": "your secret key"}' https://openlibrary.org/account/login
274    HTTP/1.1 200 OK 279    HTTP/1.1 200 OK
275    Set-Cookie: session="/user/joe%2C2009-02-19T07%3A52%3A13%2C74fc6%24811f4c2e5cf52ed0ef83b680ebed861f"; Path=/ 280    Set-Cookie: session="/user/username%2C2009-02-19T07%3A52%3A13%2C74fc6%24811f4c2e5cf52ed0ef83b680ebed861f"; Path=/
276     281    
277 Upon successful login, a set-cookie header is returned in the response. 282 Upon successful login, a set-cookie header is returned in the response. Include this cookie with subsequent requests.
283
284 Every Open Library account holder has S3 keys. You can find yours <a href="https://archive.org/account/s3.php">here</a>.
278 278
... ...
313 Debug information about the error may be provided in the response to help trouble-shooting the issue. 313 Debug information about the error may be provided in the response to help trouble-shooting the issue.