-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs.ejs
104 lines (91 loc) · 3.02 KB
/
docs.ejs
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>oilshit - oilprice-api docs</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="main.css" type="text/css" />
</head>
<body>
<nav>
<ul>
<li><a href="docs">Documentation</a></li>
<li><a href="blend-list">Blend List</a></li>
</ul>
</nav>
<main>
<div class="docs-row">
<div class="col col-endpoint">GET <code>/</code></div>
<div class="col col-description">
<p>
First time using <strong>oilprice-api</strong>? You can use this
endpoint as your first test. It should returns JSON text with
<code>"Hello, world!"</code> message.
</p>
</div>
<div class="col col-example">
<p class="example-title">Request</p>
<pre><code>https://oilprice-api.herokuapp.com/</code></pre>
<p class="example-title">Response (Success)</p>
<pre><code>{
message: "Hello, world!"
}</code></pre>
</div>
</div>
<div class="docs-row">
<div class="col col-endpoint">GET <code>/prices/:blend/:period</code></div>
<div class="col col-description">
<p>
Get the oil and gas prices based on <code>:blend</code> and
<code>:period</code> parameters.
</p>
</div>
<div class="col col-example">
<p class="example-title">Request</p>
<p>
Let say, we want to get <strong>monthly</strong> price of
<strong>Duri</strong> field (located in Indonesia).
</p>
<pre><code>https://oilprice-api.herokuapp.com/prices/duri/monthly</code></pre>
<p class="example-title">Response (Success)</p>
<pre><code>{
"blend": {
"last_price_timestamp": "1627534800",
"volume": null,
"prev_volume": null,
"open": null,
"name": "Duri (Indonesia)"
},
"last_close_price": "76.34",
"last_price": 76.99,
"change_percent": 0.85,
"change_direction": "up",
"prices": [
{ "time": 1625032800, "price": "77.39" },
{ "time": 1625119200, "price": "78.87" },
{ "time": 1626674400, "price": "75.96" },
/* many more */
],
"amount": 31,
"time_dif": 86400,
"last_time": "1627534800",
"end_time": 1627686000,
"nulls": 0,
"min": "73.04",
"max": "78.87",
"change": 0.6499999999999915
}</code></pre>
</div>
</div>
</main>
<footer class="footer">
<a href="https://oilshit.github.io/" target="_blank" rel="nofollow noreferrer">
<span id="logo"><i class="fa fa-tint" style="margin-right: 2px"></i><strong>ilshit</strong></span></a>
<span><strong><a href="https://github.com/oilshit/oilprice-api" target="_blank" rel="nofollow noreferrer"><i
class="fab fa fa-github" style="margin-right: 2px"></i></a></strong></span>
</footer>
<script src="main.js"></script>
</body>
</html>