It looks like you're offline.
Open Library logo

Open Library RESTful API → Diff

Added
Modified
Removed
Not changed
Revision 10 by George December 4, 2009
Revision 11 by Anand Chitipothu May 7, 2010
body
0 <style type="text/css"> 0 <style type="text/css">
... ...
17 17
18    $ curl http://openlibrary.org/a/OL1A.json 18    $ curl http://openlibrary.org/authors/OL1A.json
19    { 19    {
20        "name": "Sachi Rautroy", 20        "name": "Sachi Rautroy",
21        ... 21        ...
22    } 22    }
23    $ curl -s -H 'Accept: application/json' http://openlibrary.org/b/OL1M 23    $ curl -s -H 'Accept: application/json' http://openlibrary.org/books/OL1M
24    { 24    {
... ...
30 30
31    $ curl http://openlibrary.org/a/OL1A.json?callback=process 31    $ curl http://openlibrary.org/authors/OL1A.json?callback=process
32    process({ 32    process({
... ...
38 38
39    $ curl http://openlibrary.org/b/OL6807502M.rdf 39    $ curl http://openlibrary.org/books/OL6807502M.rdf
40    <rdf:Description rdf:about="http://openlibrary.org/b/OL6807502M"> 40    <rdf:Description rdf:about="http://openlibrary.org/books/OL6807502M">
41    <!-- authors --> 41    <!-- authors -->
42    <bibo:authorList rdf:parseType="Collection"> 42    <bibo:authorList rdf:parseType="Collection">
43      <rdf:Description rdf:about="http://openlibrary.org/a/OL1518080A"> 43      <rdf:Description rdf:about="http://openlibrary.org/authors/OL1518080A">
44         <rdf:value>Lawrence Lessig</rdf:value> 44         <rdf:value>Lawrence Lessig</rdf:value>
... ...
54    </rdf:RDF> 54    </rdf:RDF>
55    $ curl -H 'Accept: application/rdf+xml' http://openlibrary.org/b/OL6807502M.rdf 55    $ curl -H 'Accept: application/rdf+xml' http://openlibrary.org/books/OL6807502M.rdf
56    <rdf:Description rdf:about="http://openlibrary.org/b/OL6807502M"> 56    <rdf:Description rdf:about="http://openlibrary.org/books/OL6807502M">
57    <!-- authors --> 57    <!-- authors -->
58    <bibo:authorList rdf:parseType="Collection"> 58    <bibo:authorList rdf:parseType="Collection">
59      <rdf:Description rdf:about="http://openlibrary.org/a/OL1518080A"> 59      <rdf:Description rdf:about="http://openlibrary.org/authors/OL1518080A">
60         <rdf:value>Lawrence Lessig</rdf:value> 60         <rdf:value>Lawrence Lessig</rdf:value>
... ...
72 72
73    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/a/OL1A' 73    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/authors/OL1A'
74    [ 74    [
75        { 75        {
76            "key": "/b/OL1M" 76            "key": "/books/OL1M"
77        }, 77        },
78        { 78        {
79            "key": "/b/OL4731M" 79            "key": "/books/OL4731M"
80        }, 80        },
81        ... 81        ...
82    ] 82    ]
83    $ curl -H 'Accept: application/json' 'http://openlibrary.org/query?type=/type/edition&authors=/a/OL1A' 83    $ curl -H 'Accept: application/json' 'http://openlibrary.org/query?type=/type/edition&authors=/authors/OL1A'
84    [ 84    [
85        { 85        {
86            "key": "/b/OL1M" 86            "key": "/books/OL1M"
87        }, 87        },
88        { 88        {
89            "key": "/b/OL4731M" 89            "key": "/books/OL4731M"
90        }, 90        },
... ...
95 95
96    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/a/OL1A&title=' 96    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/authors/OL1A&title='
97    [ 97    [
98        { 98        {
99            "key": "/b/OL1M", 99            "key": "/books/OL1M",
100            "title": "Kabit\u0101." 100            "title": "Kabit\u0101."
101        }, 101        },
102        { 102        {
103            "key": "/b/OL4731M", 103            "key": "/books/OL4731M",
104            "title": "Sacci Ra\u0304utara\u0304y\u0307a grantha\u0304bal\u0323i\u0304." 104            "title": "Sacci Ra\u0304utara\u0304y\u0307a grantha\u0304bal\u0323i\u0304."
... ...
110 110
111    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/a/OL1A&*=' 111    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/authors/OL1A&*='
112    [ 112    [
... ...
117            ... 117            ...
118            "key": "/b/OL1M", 118            "key": "/books/OL1M",
119            ... 119            ...
... ...
125 125
126    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/a/OL1A&limit=2' 126    $ curl 'http://openlibrary.org/query.json?type=/type/edition&authors=/authors/OL1A&limit=2'
127    [ 127    [
128        { 128        {
129            "key": "/b/OL1M" 129            "key": "/books/OL1M"
130        }, 130        },
131        { 131        {
132            "key": "/b/OL4731M" 132            "key": "/books/OL4731M"
133        } 133        }
... ...
138    # curl fails because it doesn't escape query parameter 138    # curl fails because it doesn't escape query parameter
139    $ wget -q -O - 'http://openlibrary.org/query.json?query={"type": "/type/edition", "authors": "/a/OL1A", "title": null, "limit": 2}' 139    $ wget -q -O - 'http://openlibrary.org/query.json?query={"type": "/type/edition", "authors": "/authors/OL1A", "title": null, "limit": 2}'
140    [ 140    [
141        { 141        {
142            "key": "/b/OL1M", 142            "key": "/books/OL1M",
143            "title": "Kabit\u0101." 143            "title": "Kabit\u0101."
144        }, 144        },
145        { 145        {
146            "key": "/b/OL4731M", 146            "key": "/books/OL4731M",
147            "title": "Sacci Ra\u0304utara\u0304y\u0307a grantha\u0304bal\u0323i\u0304." 147            "title": "Sacci Ra\u0304utara\u0304y\u0307a grantha\u0304bal\u0323i\u0304."
... ...
157 157
158    $ curl http://openlibrary.org/b/OL1M.json?m=history 158    $ curl http://openlibrary.org/books/OL1M.json?m=history
159    [ 159    [
... ...
166    ] 166    ]
167    $ curl -H 'Accept: application/json' http://openlibrary.org/b/OL1M?m=history 167    $ curl -H 'Accept: application/json' http://openlibrary.org/books/OL1M?m=history
168    [ 168    [
... ...
182 182
183    $ curl http://openlibrary.org/b/OL1M.json?m=history&limit=2&offset=1 183    $ curl http://openlibrary.org/books/OL1M.json?m=history&limit=2&offset=1
184    [ 184    [
... ...
223    ... 223    ...
224    $ curl http://openlibrary.org/recentchanges.json?author=/user/anand&offset=20&limit=20 224    $ curl http://openlibrary.org/recentchanges.json?author=/people/anand&offset=20&limit=20
225 225
... ...
234    HTTP/1.1 200 OK 234    HTTP/1.1 200 OK
235    Set-Cookie: ol_session="/user/joe%2C2009-02-19T07%3A52%3A13%2C74fc6%24811f4c2e5cf52ed0ef83b680ebed861f"; Path=/ 235    Set-Cookie: session="/user/joe%2C2009-02-19T07%3A52%3A13%2C74fc6%24811f4c2e5cf52ed0ef83b680ebed861f"; Path=/
236     236    
... ...
273 Debug information about the error may be provided in the response to help trouble-shooting the issue. 273 Debug information about the error may be provided in the response to help trouble-shooting the issue.