Skip to content

Commit 2015642

Browse files
committed
refactor docs for new versioned routes
1 parent 55dcdf7 commit 2015642

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+925
-1862
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Open Source REST API for launch, rocket, core, capsule, starlink, launchpad, and
2020
</h4>
2121

2222
<h3 align="center">
23-
<a href="docs/v4/README.md">Docs</a> - <a href="docs/clients.md">API Clients</a> - <a href="docs/apps.md">Apps</a> - <a href="https://status.spacexdata.com">Status</a> - <a href="https://backups.spacexdata.com">Database Dumps</a>
23+
<a href="docs/README.md">Docs</a> - <a href="docs/clients.md">API Clients</a> - <a href="docs/apps.md">Apps</a> - <a href="https://status.spacexdata.com">Status</a> - <a href="https://backups.spacexdata.com">Database Dumps</a>
2424
<br/>
2525
</h3>
2626

docs/README.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# r/SpaceX API Docs
2+
3+
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/ed4ed700dcc55b2c1f1c)
4+
5+
## Disclaimer
6+
7+
*We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with Space Exploration Technologies Corp (SpaceX), or any of its subsidiaries or its affiliates. The names SpaceX as well as related names, marks, emblems and images are registered trademarks of their respective owners.*
8+
9+
## Base URL
10+
11+
`https://api.spacexdata.com`
12+
13+
## Versioning
14+
15+
Each route is individually versioned, see route list below for all avaliable versions. The API can also be pinned to the lastest version with `https://api.spacexdata.com/latest`, but only do this if you're cool with potential breaking changes.
16+
17+
## Authentication
18+
19+
Authentication via api key is required for all destructive routes. This includes all `create`, `update`, and `delete` routes.
20+
21+
Authenticate by passing the header `spacex-key` with your api key. Protected routes return `401` without a valid key.
22+
23+
## Pagination + Custom Queries
24+
25+
All `/query` routes support pagination, custom queries, and other output controls.
26+
27+
See the [pagination + query](queries.md) guide for more details and examples.
28+
29+
## Launch date FAQ's
30+
31+
* **Why does the date appear wrong?** - This is usually due to the way we store and display partial dates in the api. For example, a launch scheduled for `2020 July` would be represented as `2020-07-01T00:00:00.000Z`. In this case, the field `date_precision` would be set as `month`, meaning the date is only valid to the `month` level, or `2020-07`
32+
33+
## Launch date field explanations
34+
35+
* `date_utc` - UTC launch date/time in ISO 8601 format
36+
37+
* `date_unix` - UTC launch date/time as a UNIX timestamp in seconds
38+
39+
* `date_local` - Local launch time with time zone offset in ISO 8601 format
40+
41+
* `date_precision` - Gives the date precision for partial dates. Valid values are `quarter`, `half`, `year`, `month`, `day`, `hour`.
42+
43+
* `tbd` - Set as true if date is `To be determined`
44+
45+
* `net` - Set as true if the date is `No earlier than`
46+
47+
## Caching
48+
49+
The api makes use of response caching via Redis for all `GET` requests, and `POST` requests on `/query` endpoints.
50+
51+
Standard cache times are as follows:
52+
53+
**launches** - 20 seconds
54+
55+
**capsules**, **cores**, **launchpads**, **landpads**, **crew**, **ships**, **payloads** - 5 minutes
56+
57+
**dragons**, **rockets** - 24 hours
58+
59+
Cache can be cleared with the following endpoint:
60+
61+
* 🔒 [Clear cache](cache/clear.md) : `DELETE /admin/cache`
62+
63+
## Routes
64+
65+
### [Capsules](capsules)
66+
67+
### [Company Info](company)
68+
69+
### [Cores](cores) - Detailed info for serialized first stage cores
70+
71+
### [Crew](crew) - Detailed info on dragon crew members
72+
73+
### [Dragons](dragons) - Detailed info about dragon capsule versions
74+
75+
### [Landpads](landpads) - Detailed info about landing pads and ships
76+
77+
### [Launches](launches) - Detailed info about launches
78+
79+
### [Launchpads](launchpads) - Detailed info about launchpads
80+
81+
### [Payloads](payloads) - Detailed info about launch payloads
82+
83+
### [Roadster info](roadster) - Detailed info about Elon's Tesla roadster's current position
84+
85+
### [Rockets](rockets) - Detailed info about rocket versions
86+
87+
### [Ships](ships) - Detailed info about ships in the SpaceX fleet
88+
89+
### [Starlink](starlink) - Detailed info about Starlink satellites and orbits
90+
91+
Includes raw orbit data from [Space Track](https://www.space-track.org/auth/login), updated hourly.
92+
93+
Space Track data adheres to the standard for [Orbit Data Messages](https://public.ccsds.org/pubs/502x0b2c1.pdf)
94+
95+
### [History](history) - Detailed info on SpaceX historical events
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/launches/v5/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Changes from v4 -> v5
2+
3+
* Crew is now an array of objects, to allow for more data on an individual launch for a crew member
4+
5+
### Old Format
6+
7+
```json
8+
{
9+
"crew": [
10+
"1234567890",
11+
"123456789",
12+
"123456789",
13+
]
14+
}
15+
```
16+
17+
### New Format
18+
19+
```json
20+
{
21+
"crew": [
22+
"1234567890",
23+
"123456789",
24+
"123456789",
25+
]
26+
}
27+
```

docs/launches/v5/all.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Get all launches
2+
3+
**Method** : `GET`
4+
5+
**URL** : `https://api.spacexdata.com/v5/launches`
6+
7+
**Auth required** : `False`
8+
9+
## Success Responses
10+
11+
**Code** : `200 OK`
12+
13+
```json
14+
[
15+
{
16+
"fairings": null,
17+
"links": {
18+
"patch": {
19+
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
20+
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
21+
},
22+
"reddit": {
23+
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
24+
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
25+
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
26+
"recovery": null
27+
},
28+
"flickr": {
29+
"small": [],
30+
"original": [
31+
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
32+
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
33+
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
34+
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
35+
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
36+
]
37+
},
38+
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
39+
"webcast": "https://youtu.be/1MkcWK2PnsU",
40+
"youtube_id": "1MkcWK2PnsU",
41+
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
42+
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
43+
},
44+
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
45+
"static_fire_date_unix": 1583058000,
46+
"tdb": false,
47+
"net": false,
48+
"window": 0,
49+
"rocket": "5e9d0d95eda69973a809d1ec",
50+
"success": true,
51+
"failures": [],
52+
"details": "SpaceX's 20th and final Crew Resupply Mission under the original NASA CRS contract, this mission brings essential supplies to the International Space Station using SpaceX's reusable Dragon spacecraft. It is the last scheduled flight of a Dragon 1 capsule. (CRS-21 and up under the new Commercial Resupply Services 2 contract will use Dragon 2.) The external payload for this mission is the Bartolomeo ISS external payload hosting platform. Falcon 9 and Dragon will launch from SLC-40, Cape Canaveral Air Force Station and the booster will land at LZ-1. The mission will be complete with return and recovery of the Dragon capsule and down cargo.",
53+
"crew": [],
54+
"ships": [],
55+
"capsules": [
56+
"5e9e2c5cf359185d753b266f"
57+
],
58+
"payloads": [
59+
"5eb0e4d0b6c3bb0006eeb253"
60+
],
61+
"launchpad": "5e9e4501f509094ba4566f84",
62+
"auto_update": true,
63+
"flight_number": 91,
64+
"name": "CRS-20",
65+
"date_utc": "2020-03-07T04:50:31.000Z",
66+
"date_unix": 1583556631,
67+
"date_local": "2020-03-06T23:50:31-05:00",
68+
"date_precision": "hour",
69+
"upcoming": false,
70+
"cores": [
71+
{
72+
"core": "5e9e28a7f359187afd3b2662",
73+
"flight": 2,
74+
"gridfins": true,
75+
"legs": true,
76+
"reused": true,
77+
"landing_attempt": true,
78+
"landing_success": true,
79+
"landing_type": "RTLS",
80+
"landpad": "5e9e3032383ecb267a34e7c7"
81+
}
82+
],
83+
"id": "5eb87d42ffd86e000604b384"
84+
},
85+
...
86+
]
87+
```

docs/launches/v5/latest.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Get latest launch
2+
3+
**Method** : `GET`
4+
5+
**URL** : `https://api.spacexdata.com/v5/launches/latest`
6+
7+
**Auth required** : `False`
8+
9+
## Success Responses
10+
11+
**Code** : `200 OK`
12+
13+
```json
14+
{
15+
"fairings": null,
16+
"links": {
17+
"patch": {
18+
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
19+
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
20+
},
21+
"reddit": {
22+
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
23+
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
24+
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
25+
"recovery": null
26+
},
27+
"flickr": {
28+
"small": [],
29+
"original": [
30+
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
31+
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
32+
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
33+
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
34+
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
35+
]
36+
},
37+
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
38+
"webcast": "https://youtu.be/1MkcWK2PnsU",
39+
"youtube_id": "1MkcWK2PnsU",
40+
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
41+
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
42+
},
43+
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
44+
"static_fire_date_unix": 1583058000,
45+
"tdb": false,
46+
"net": false,
47+
"window": 0,
48+
"rocket": "5e9d0d95eda69973a809d1ec",
49+
"success": true,
50+
"failures": [],
51+
"details": "SpaceX's 20th and final Crew Resupply Mission under the original NASA CRS contract, this mission brings essential supplies to the International Space Station using SpaceX's reusable Dragon spacecraft. It is the last scheduled flight of a Dragon 1 capsule. (CRS-21 and up under the new Commercial Resupply Services 2 contract will use Dragon 2.) The external payload for this mission is the Bartolomeo ISS external payload hosting platform. Falcon 9 and Dragon will launch from SLC-40, Cape Canaveral Air Force Station and the booster will land at LZ-1. The mission will be complete with return and recovery of the Dragon capsule and down cargo.",
52+
"crew": [],
53+
"ships": [],
54+
"capsules": [
55+
"5e9e2c5cf359185d753b266f"
56+
],
57+
"payloads": [
58+
"5eb0e4d0b6c3bb0006eeb253"
59+
],
60+
"launchpad": "5e9e4501f509094ba4566f84",
61+
"auto_update": true,
62+
"flight_number": 91,
63+
"name": "CRS-20",
64+
"date_utc": "2020-03-07T04:50:31.000Z",
65+
"date_unix": 1583556631,
66+
"date_local": "2020-03-06T23:50:31-05:00",
67+
"date_precision": "hour",
68+
"upcoming": false,
69+
"cores": [
70+
{
71+
"core": "5e9e28a7f359187afd3b2662",
72+
"flight": 2,
73+
"gridfins": true,
74+
"legs": true,
75+
"reused": true,
76+
"landing_attempt": true,
77+
"landing_success": true,
78+
"landing_type": "RTLS",
79+
"landpad": "5e9e3032383ecb267a34e7c7"
80+
}
81+
],
82+
"id": "5eb87d42ffd86e000604b384"
83+
}
84+
```

docs/launches/v5/next.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Get next launch
2+
3+
**Method** : `GET`
4+
5+
**URL** : `https://api.spacexdata.com/v5/launches/next`
6+
7+
**Auth required** : `False`
8+
9+
## Success Responses
10+
11+
**Code** : `200 OK`
12+
13+
```json
14+
{
15+
"fairings": null,
16+
"links": {
17+
"patch": {
18+
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
19+
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
20+
},
21+
"reddit": {
22+
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
23+
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
24+
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
25+
"recovery": null
26+
},
27+
"flickr": {
28+
"small": [],
29+
"original": [
30+
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
31+
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
32+
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
33+
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
34+
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
35+
]
36+
},
37+
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
38+
"webcast": "https://youtu.be/1MkcWK2PnsU",
39+
"youtube_id": "1MkcWK2PnsU",
40+
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
41+
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
42+
},
43+
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
44+
"static_fire_date_unix": 1583058000,
45+
"tdb": false,
46+
"net": false,
47+
"window": 0,
48+
"rocket": "5e9d0d95eda69973a809d1ec",
49+
"success": true,
50+
"failures": [],
51+
"details": "SpaceX's 20th and final Crew Resupply Mission under the original NASA CRS contract, this mission brings essential supplies to the International Space Station using SpaceX's reusable Dragon spacecraft. It is the last scheduled flight of a Dragon 1 capsule. (CRS-21 and up under the new Commercial Resupply Services 2 contract will use Dragon 2.) The external payload for this mission is the Bartolomeo ISS external payload hosting platform. Falcon 9 and Dragon will launch from SLC-40, Cape Canaveral Air Force Station and the booster will land at LZ-1. The mission will be complete with return and recovery of the Dragon capsule and down cargo.",
52+
"crew": [],
53+
"ships": [],
54+
"capsules": [
55+
"5e9e2c5cf359185d753b266f"
56+
],
57+
"payloads": [
58+
"5eb0e4d0b6c3bb0006eeb253"
59+
],
60+
"launchpad": "5e9e4501f509094ba4566f84",
61+
"auto_update": true,
62+
"flight_number": 91,
63+
"name": "CRS-20",
64+
"date_utc": "2020-03-07T04:50:31.000Z",
65+
"date_unix": 1583556631,
66+
"date_local": "2020-03-06T23:50:31-05:00",
67+
"date_precision": "hour",
68+
"upcoming": false,
69+
"cores": [
70+
{
71+
"core": "5e9e28a7f359187afd3b2662",
72+
"flight": 2,
73+
"gridfins": true,
74+
"legs": true,
75+
"reused": true,
76+
"landing_attempt": true,
77+
"landing_success": true,
78+
"landing_type": "RTLS",
79+
"landpad": "5e9e3032383ecb267a34e7c7"
80+
}
81+
],
82+
"id": "5eb87d42ffd86e000604b384"
83+
}
84+
```

0 commit comments

Comments
 (0)