-
Notifications
You must be signed in to change notification settings - Fork 2
/
apiary.apib
178 lines (162 loc) · 4.53 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
HOST: http://api.openbookprices.com/
--- OpenBookPrices ---
---
The [OpenBookPrices](http://www.openbookprices.com/) API lets you get current prices
from book vendors around the world, including shipping costs to your country and all
converted into your currency.
---
-- Book Details --
Return very basic details about the book, currently just title and authors. If you want more details here please [create an issue](https://github.com/OpenBookPrices/openbookprices-api/issues) requesting them.
GET /v1/books/{isbn}/details
< 200
< Content-Type: application/json
{
"authors": [
"Henry David Thoreau"
],
"title": "Walden",
"isbn": "9781619493919"
}
-- Book Prices --
Determine the country (and hence currency) of the IP address making the request and then redirect to the specific url.
GET /v1/books/{isbn}/prices
< 302
< Content-Type: text/plain
Redirecting to http://api.openbookprices.com/v1/books/9780340831496/prices/US/USD
Determine the primary currency of the `country` and redirect to the specific url.
GET /v1/books/{isbn}/prices/{country}
< 302
< Content-Type: text/plain
Redirecting to http://api.openbookprices.com/v1/books/9780340831496/prices/US/USD
Return immediately a list of all the vendors who ship to `country` and the pricing details that are currently known.
GET /v1/books/{isbn}/prices/{country}/{currency}
< 200
< Content-Type: application/json
{
request: {
isbn: "9780340831496",
country: "GB",
currency: "GBP",
url: "http://api.openbookprices.com/v1/books/9780340831496/prices/GB/GBP",
},
results: [
{
"status": "unfetched",
"request": {
"isbn": "9780340831496",
"country": "US",
"currency": "USD",
"vendor": "amazon_uk",
"url": "http://api.openbookprices.com/v1/books/9780340831496/prices/US/USD/amazon_uk"
},
"offers": {},
"vendor": {
"code": "amazon_uk",
"name": "Amazon UK",
"homepage": "http://www.amazon.co.uk/"
"url": null
},
"meta": {
"timestamp": 1381517829,
"ttl": 0,
"retryDelay": 0.1,
"preConversionCurrency": null
}
},
{
"status": "unfetched",
"request": {
"isbn": "9780340831496",
"country": "US",
"currency": "USD",
"vendor": "amazon_us",
"url": "http://api.openbookprices.com/v1/books/9780340831496/prices/US/USD/amazon_us"
},
offers: {},
"vendor": {
"code": "amazon_us",
"name": "Amazon USA",
"homepage": "http://www.amazon.com/",
"url:" null
},
"meta": {
"timestamp": 1381517829,
"ttl": 0,
"retryDelay": 0.1,
"preConversionCurrency": null
}
},
{
"status": "unfetched",
"request": {
"isbn": "9780340831496",
"country": "US",
"currency": "USD",
"vendor": "foyles",
"url": "http://api.openbookprices.com/v1/books/9780340831496/prices/US/USD/foyles"
},
offers: {},
"vendor": {
"code": "foyles",
"name": "Foyles",
"homepage": "http://www.foyles.co.uk/",
"url": null,
},
"meta": {
"timestamp": 1381517829,
"ttl": 0,
"retryDelay": 0.1,
"preConversionCurrency": null
}
}
]
}
Return fresh details for the vendor. If needed this will initiate a fetch of the details so the response may block whilst this is happening.
GET /v1/books/{isbn}/prices/{country}/{currency}/{vendor}
< 200
< Content-Type: application/json
{
"status": "ok",
"request": {
"isbn": "9780340831496",
"country": "US",
"currency": "USD",
"vendor": "amazon_uk",
"url": "http://api.openbookprices.com/v1/books/9780340831496/prices/US/USD/amazon_uk"
},
"offers": {
"new": {
"price": 21.7,
"availabilityNote": "Usually dispatched within 24 hours",
"shippingNote": "5 to 7 business days",
"shipping": 6.98,
"total": 28.68
}
},
"vendor": {
"code": "amazon_uk",
"name": "Amazon UK",
"homepage": "http://www.amazon.co.uk/"
"url": "http://www.amazon.co.uk/dp/0340831499"
},
"meta": {
"timestamp": 1381518231,
"ttl": 3600,
"retryDelay": null,
"preConversionCurrency": "GBP"
}
}
-- Ping --
Ping back your own request - useful for checking what the server thinks the time is and what IP address you appear to have. Response is not cached.
GET /ping
< 200
< Content-Type: application/json
{
"timestamp": 1381509290.302,
"network": {
"ip": "12.34.56.78",
"ips": [
"12.34.56.78"
]
}
}