-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelopers.html
199 lines (177 loc) · 5.27 KB
/
developers.html
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
---
layout: default
title: Developers
---
<div class="row">
<div class="span9">
<div class="alert alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>Work in Progress!</h4>
Most of these routes won't be implemented whilst you read this. But they will
be, trust us.
</div>
<h3>Introduction</h3>
<p>It all starts with the root URL, the routes below are all based around this:</p>
<pre>http://api.predictthesky.org</pre>
<p>You should set the Media Type; by default: <code>application/json</code>.
But it will just return JSON regardless. It doesn't talk anything else (but
this might change.)</p>
<h3>Retrieving Space Events</h3>
<p>Events are the core purpose of the API. It returns a list of space objects
(see below) which are visible from your current location, scored by a
likelyhood that it can be seen. A weather object for the start and end of the
event is returned.</p>
<div class="">
<table class="table table-striped">
<tr>
<th>Method</th>
<th>Route</th>
<th>Arguments</th>
</tr>
<tr>
<td><span class="label label-info">GET</span></td>
<td><code>/events/all</code></td>
<td>lat, lon, elevation, limit, date</td>
</tr>
<tr>
<td><span class="label label-info">GET</span></td>
<td><code>/event/<category></code></td>
<td>lat, lon, elevation, limit, date</td>
</tr>
</table>
<h5>Notes</h5>
<ul>
<li><code>lat</code> & <code>lon</code> expect decimal latitude and longitude values. (<strong>Required</strong>)</li>
<li><code>elevation</code> assumes meters. <em>(Optional)</em></li>
<li><code>limit</code> assumes an integer. Default is 5. <em>(Optional)</em></li>
<li><code>date</code> expects an <a href="http://xkcd.com/1179/">ISO 8601</a>
formatted date. <em>(Optional)</em></li>
<ul>
</div>
<div class="">
<pre>{
"space_events": [
{
"object": {
"id": "0123456789",
"name": "International Space Station",
"category": "satellite"
},
"start": {
"timestamp": ""
"location": {
"altitude": "",
"azimuth": ""
}
"weather": {
"cloud_cover": "",
"chance_of_prep": "",
"temperature": 0,
"feels_like_temperature": 0,
"visibility": 0
}
},
"end": {
"timestamp": ""
"location": {
"altitude": "",
"azimuth": ""
}
"weather": {
"cloud_cover": "",
"chance_of_prep": "",
"temperature": 0,
"feels_like_temperature": 0,
"visibility": 0
}
}
}
]
}</pre>
</div>
<h3>Retrieving Possible Space Objects</h3>
<p>Predict the Sky stores a list of space objects that it can provide data for.
This isn't comprehensive like <a href="https://www.space-track.org/">Space
Track</a> is, but enough to return a good list of objects.</p>
<p>But, to return just the objects themselves in the events calls (above), you
need to know the identifier used for them. You can get all or filter by
categories:</p>
<h4>Routes</h4>
<div class="">
<table class="table table-striped">
<tr>
<th>Method</th>
<th>Route</th>
<th>Arguments</th>
</tr>
<tr>
<td><span class="label label-info">GET</span></td>
<td><code>/objects/all</code></td>
<td>None</td>
</tr>
<tr>
<td><span class="label label-info">GET</span></td>
<td><code>/objects/<category></code></td>
<td>None</td>
</tr>
</table>
</div>
<div class="">
<h4>The possible category values are:</h4>
</div>
<div class="">
<table class="table table-striped">
<tr>
<th>Identifier</th>
<th>Notes</th>
</tr>
<tr>
<td>satellites</td>
<td>Including the ISS.</td>
</tr>
<tr>
<td>meteor_showers</td>
<td> </td>
</tr>
<tr>
<td>lunar_eclipses</td>
<td> </td>
</tr>
<tr>
<td>aurora</td>
<td> </td>
</tr>
<tr>
<td>planets</td>
<td> </td>
</tr>
<tr>
<td>moon_phase</td>
<td> </td>
</tr>
<tr>
<td>comets</td>
<td> </td>
</tr>
<tr>
<td>iridium_flare</td>
<td> </td>
</tr>
</table>
</div>
<h4>Response</h4>
<p>Both space objects calls return a collection of object dictionaries, they
look like this:</p>
<div class="">
<pre>{
"space_objects": [
{
"id": "0123456789",
"name": "International Space Station",
"category": "satellite"
}
]
}</pre>
</div>
</div>
</div>