Showing preview only (337K chars total). Download the full file or copy to clipboard to get everything.
Repository: r-spacex/SpaceX-API
Branch: master
Commit: 9f56af14a75a
Files: 161
Total size: 304.4 KB
Directory structure:
gitextract_mkb_w92a/
├── .dockerignore
├── .eslintrc.json
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── codeql-analysis.yml
│ └── deploy.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── app.js
├── docs/
│ ├── README.md
│ ├── apps.md
│ ├── capsules/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── clients.md
│ ├── company/
│ │ └── v4/
│ │ ├── all.md
│ │ └── schema.md
│ ├── cores/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── crew/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── dragons/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── history/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── landpads/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── launches/
│ │ ├── v4/
│ │ │ ├── all.md
│ │ │ ├── latest.md
│ │ │ ├── next.md
│ │ │ ├── one.md
│ │ │ ├── past.md
│ │ │ ├── query.md
│ │ │ ├── schema.md
│ │ │ └── upcoming.md
│ │ └── v5/
│ │ ├── README.md
│ │ ├── all.md
│ │ ├── latest.md
│ │ ├── next.md
│ │ ├── one.md
│ │ ├── past.md
│ │ ├── query.md
│ │ ├── schema.md
│ │ └── upcoming.md
│ ├── launchpads/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── payloads/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── queries.md
│ ├── roadster/
│ │ └── v4/
│ │ ├── get.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── rockets/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── ships/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ └── starlink/
│ └── v4/
│ ├── all.md
│ ├── one.md
│ ├── query.md
│ └── schema.md
├── jobs/
│ ├── capsules.js
│ ├── cores.js
│ ├── landpads.js
│ ├── launch-library.js
│ ├── launches.js
│ ├── launchpads.js
│ ├── payloads.js
│ ├── roadster.js
│ ├── starlink.js
│ ├── upcoming.js
│ ├── webcast.js
│ └── worker.js
├── lib/
│ ├── constants.js
│ ├── healthchecks/
│ │ ├── fail.js
│ │ ├── index.js
│ │ ├── start.js
│ │ └── success.js
│ └── utils/
│ └── healthcheck.js
├── middleware/
│ ├── auth.js
│ ├── authz.js
│ ├── cache.js
│ ├── errors.js
│ ├── index.js
│ ├── logger.js
│ └── response-time.js
├── models/
│ ├── capsules.js
│ ├── company.js
│ ├── cores.js
│ ├── crew.js
│ ├── dragons.js
│ ├── history.js
│ ├── index.js
│ ├── landpads.js
│ ├── launches.js
│ ├── launchpads.js
│ ├── payloads.js
│ ├── roadster.js
│ ├── rockets.js
│ ├── ships.js
│ ├── starlink.js
│ └── users.js
├── package.json
├── routes/
│ ├── admin/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── capsules/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── company/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── cores/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── crew/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── dragons/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── history/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── index.js
│ ├── landpads/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── launches/
│ │ ├── index.js
│ │ ├── v4/
│ │ │ ├── _transform-query.js
│ │ │ ├── _transform-response.js
│ │ │ └── index.js
│ │ └── v5/
│ │ └── index.js
│ ├── launchpads/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── payloads/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── roadster/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── rockets/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── ships/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── starlink/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ └── users/
│ ├── index.js
│ └── v4/
│ └── index.js
├── server.js
├── start.sh
└── tests/
└── index.test.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
.git
node_modules
npm-debug.log
*.md
test
docs
Dockerfile
coverage
LICENSE
.eslintrc
.gitignore
.nvmrc
.env
================================================
FILE: .eslintrc.json
================================================
{
"env": {
"node": true,
"es2022": true,
"jest": true
},
"extends": ["airbnb-base"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"overrides": [
{
"files": ["tests/**"],
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"]
}
],
"rules": {
"no-console": 0,
"import/extensions": ["error", "always"],
"import/no-unresolved": ["error", { "ignore": ["^got$"] }]
}
}
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
day: saturday
open-pull-requests-limit: 10
ignore:
- dependency-name: eslint
versions:
- 7.21.0
- 7.24.0
- dependency-name: eslint-plugin-no-secrets
versions:
- 0.8.9
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: "CodeQL"
on:
push:
branches: [master, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 4 * * 2'
jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
================================================
FILE: .github/workflows/deploy.yml
================================================
name: Deploy
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
pull_request:
env:
IMAGE_NAME: spacex-api
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "18.x"
- run: npm install
- run: npm run check-dependencies
- run: npm test
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into registry
run: echo "${{ secrets.GITLAB_PASSWORD }}" | docker login registry.gitlab.com -u ${{ secrets.GITLAB_USERNAME }} --password-stdin
- name: Push image
run: |
IMAGE_ID=registry.gitlab.com/jakewmeyer/spacex-api
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# General
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# JetBrains IDE project files
/.idea
TODO.md
test.json
spacex-api
.envrc
================================================
FILE: Dockerfile
================================================
FROM node:18-alpine
LABEL maintainer="jakewmeyer@gmail.com"
LABEL autoheal="true"
HEALTHCHECK --interval=10s --timeout=3s \
CMD ./lib/utils/healthcheck.js
RUN apk add --no-cache --upgrade bash
ENV NODE_ENV=production
ENV HEALTH_URL=http://localhost:6673/v4/admin/health
EXPOSE 6673
# Run as an unprivileged user.
RUN addgroup -S spacex && adduser -S -G spacex spacex
RUN mkdir /app && chown spacex /app
USER spacex
WORKDIR /app
ENTRYPOINT ["/app/start.sh"]
COPY --chown=spacex:spacex package.json package-lock.json /app/
RUN npm install --production
COPY --chown=spacex:spacex . .
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017-2022 Jake Meyer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
<p align="center"><img src="https://live.staticflickr.com/65535/49185149122_37f5c52e43_k.jpg"></p>
<h1 align="center">SpaceX REST API</h1>
<h3 align="center">
Open Source REST API for launch, rocket, core, capsule, starlink, launchpad, and landing pad data.
</h3>
<p align="center">
<a href="https://github.com/r-spacex/SpaceX-API/actions?query=workflow%3ATest"><img src="https://img.shields.io/github/workflow/status/r-spacex/SpaceX-API/Test?style=flat-square"></a>
<a href="https://hub.docker.com/r/jakewmeyer/spacex-api/"><img src="https://img.shields.io/docker/pulls/jakewmeyer/spacex-api?style=flat-square"></a>
<a href="https://github.com/r-spacex/SpaceX-API/releases"><img src="https://img.shields.io/github/release/r-spacex/SpaceX-API.svg?longCache=true&style=flat-square"></a>
<a href="https://en.wikipedia.org/wiki/Representational_state_transfer"><img src="https://img.shields.io/badge/interface-REST-brightgreen.svg?longCache=true&style=flat-square"></a>
</p>
<h4 align="center">
<i>
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.
</i>
</h4>
<h3 align="center">
<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 Exports</a>
<br/>
</h3>
## Usage
```
GET https://api.spacexdata.com/v5/launches/latest
```
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/eb/0f/Vev7xkUX_o.png",
"large": "https://images2.imgbox.com/ab/79/Wyc9K7fv_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/fjf6rr/dm2_launch_campaign_thread/",
"launch": "https://www.reddit.com/r/spacex/comments/glwz6n/rspacex_cctcap_demonstration_mission_2_general",
"media": "https://www.reddit.com/r/spacex/comments/gp1gf5/rspacex_dm2_media_thread_photographer_contest/",
"recovery": "https://www.reddit.com/r/spacex/comments/gu5gkd/cctcap_demonstration_mission_2_stage_1_recovery/"
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49927519643_b43c6d4c44_o.jpg",
"https://live.staticflickr.com/65535/49927519588_8a39a3994f_o.jpg",
"https://live.staticflickr.com/65535/49928343022_6fb33cbd9c_o.jpg",
"https://live.staticflickr.com/65535/49934168858_cacb00d790_o.jpg",
"https://live.staticflickr.com/65535/49934682271_fd6a31becc_o.jpg",
"https://live.staticflickr.com/65535/49956109906_f88d815772_o.jpg",
"https://live.staticflickr.com/65535/49956109706_cffa847208_o.jpg",
"https://live.staticflickr.com/65535/49956109671_859b323ede_o.jpg",
"https://live.staticflickr.com/65535/49955609618_4cca01d581_o.jpg",
"https://live.staticflickr.com/65535/49956396622_975c116b71_o.jpg",
"https://live.staticflickr.com/65535/49955609378_9b77e5c771_o.jpg",
"https://live.staticflickr.com/65535/49956396262_ef41c1d9b0_o.jpg"
]
},
"presskit": "https://www.nasa.gov/sites/default/files/atoms/files/commercialcrew_press_kit.pdf",
"webcast": "https://youtu.be/xY96v0OIcK4",
"youtube_id": "xY96v0OIcK4",
"article": "https://spaceflightnow.com/2020/05/30/nasa-astronauts-launch-from-us-soil-for-first-time-in-nine-years/",
"wikipedia": "https://en.wikipedia.org/wiki/Crew_Dragon_Demo-2"
},
"static_fire_date_utc": "2020-05-22T17:39:00.000Z",
"static_fire_date_unix": 1590169140,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"details": "SpaceX will launch the second demonstration mission of its Crew Dragon vehicle as part of NASA's Commercial Crew Transportation Capability Program (CCtCap), carrying two NASA astronauts to the International Space Station. Barring unexpected developments, this mission will be the first crewed flight to launch from the United States since the end of the Space Shuttle program in 2011. DM-2 demonstrates the Falcon 9 and Crew Dragon's ability to safely transport crew to the space station and back to Earth and it is the last major milestone for certification of Crew Dragon. Initially the mission duration was planned to be no longer than two weeks, however NASA has been considering an extension to as much as six weeks or three months. The astronauts have been undergoing additional training for the possible longer mission.",
"crew": [
"5ebf1b7323a9a60006e03a7b",
"5ebf1a6e23a9a60006e03a7a"
],
"ships": [
"5ea6ed30080df4000697c913",
"5ea6ed2f080df4000697c90b",
"5ea6ed2f080df4000697c90c",
"5ea6ed2e080df4000697c909",
"5ea6ed2f080df4000697c90d"
],
"capsules": [
"5e9e2c5df359188aba3b2676"
],
"payloads": [
"5eb0e4d1b6c3bb0006eeb257"
],
"launchpad": "5e9e4502f509094188566f88",
"auto_update": true,
"flight_number": 94,
"name": "CCtCap Demo Mission 2",
"date_utc": "2020-05-30T19:22:00.000Z",
"date_unix": 1590866520,
"date_local": "2020-05-30T15:22:00-04:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f3591817f23b2663",
"flight": 1,
"gridfins": true,
"legs": true,
"reused": false,
"landing_attempt": true,
"landing_success": true,
"landing_type": "ASDS",
"landpad": "5e9e3032383ecb6bb234e7ca"
}
],
"id": "5eb87d46ffd86e000604b388"
}
```
## Cron Job Status
<p align="left">
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/zDDqPvw1-2/Capsules.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/iJIWcg9u-2/Cores.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/soA1Z2t1-2/Landpads.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/tc7aK4Iw-2/Launchpads.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/uB7PIyUo-2/Past-Launches.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/bQw1ZrmZ-2/Payloads.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/HhIoHcF6-2/Roadster.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/wPz7gFQJ-2/Starlink.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/3L5HxZKX-2/Upcoming-Launches.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/YvnZYkED-2/Webcast.svg">
<br/>
<img src="https://healthchecks.io/badge/a99e6369-9795-417e-9a1c-31ea91/_Z-lNpev-2/launch-library-v2.svg">
</p>
## Sponsors
### [Studio 3T](https://studio3t.com/)
[](https://studio3t.com/)
## FAQ's
* If you have any questions or corrections, please open an issue and we'll get it merged ASAP
* For any other questions or concerns, just shoot me an email.
================================================
FILE: app.js
================================================
import conditional from 'koa-conditional-get';
import etag from 'koa-etag';
import cors from 'koa2-cors';
import dotenv from 'dotenv';
import helmet from 'koa-helmet';
import Koa from 'koa';
import bodyParser from 'koa-bodyparser';
import mongoose from 'mongoose';
import { responseTime, errors, logger } from './middleware/index.js';
import routes from './routes/index.js';
// Env init
dotenv.config();
const app = new Koa();
mongoose.connect(process.env.SPACEX_MONGO, {
bufferCommands: false,
family: 4,
});
const db = mongoose.connection;
db.on('error', (err) => {
logger.error(err);
});
db.once('connected', () => {
logger.info('Mongo connected');
app.emit('ready');
});
db.on('reconnected', () => {
logger.info('Mongo re-connected');
});
db.on('disconnected', () => {
logger.info('Mongo disconnected');
});
// disable console.errors for pino
app.silent = true;
// Error handler
app.use(errors);
app.use(conditional());
app.use(etag());
app.use(bodyParser());
// HTTP header security
app.use(helmet());
// Enable CORS for all routes
app.use(cors({
origin: '*',
allowMethods: ['GET', 'POST', 'PATCH', 'DELETE'],
allowHeaders: ['Content-Type', 'Accept'],
exposeHeaders: ['spacex-api-cache', 'spacex-api-response-time'],
}));
// Set header with API response time
app.use(responseTime);
// Register routes
app.use(await routes());
export default app;
================================================
FILE: docs/README.md
================================================
# r/SpaceX API Docs
[](https://app.getpostman.com/run-collection/ed4ed700dcc55b2c1f1c)
## Disclaimer
*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.*
## Base URL
`https://api.spacexdata.com`
## Versioning
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.
## Authentication
Authentication via api key is required for all destructive routes. This includes all `create`, `update`, and `delete` routes.
Authenticate by passing the header `spacex-key` with your api key. Protected routes return `401` without a valid key.
## Pagination + Custom Queries
All `/query` routes support pagination, custom queries, and other output controls.
See the [pagination + query](queries.md) guide for more details and examples.
## Launch date FAQ's
* **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`
## Launch date field explanations
* `date_utc` - UTC launch date/time in ISO 8601 format
* `date_unix` - UTC launch date/time as a UNIX timestamp in seconds
* `date_local` - Local launch time with time zone offset in ISO 8601 format
* `date_precision` - Gives the date precision for partial dates. Valid values are `quarter`, `half`, `year`, `month`, `day`, `hour`.
* `tbd` - Set as true if date is `To be determined`
* `net` - Set as true if the date is `No earlier than`
## Caching
The api makes use of response caching via Redis for all `GET` requests, and `POST` requests on `/query` endpoints.
Standard cache times are as follows:
**launches** - 20 seconds
**capsules**, **cores**, **launchpads**, **landpads**, **crew**, **ships**, **payloads** - 5 minutes
**dragons**, **rockets** - 24 hours
Cache can be cleared with the following endpoint:
* 🔒 [Clear cache](cache/clear.md) : `DELETE /admin/cache`
## Routes
### [Capsules](capsules) - Detailed info for serialized dragon capsules
### [Company Info](company) - Detailed info about SpaceX as a company
### [Cores](cores) - Detailed info for serialized first stage cores
### [Crew](crew) - Detailed info on dragon crew members
### [Dragons](dragons) - Detailed info about dragon capsule versions
### [Landpads](landpads) - Detailed info about landing pads and ships
### [Launches](launches) - Detailed info about launches
### [Launchpads](launchpads) - Detailed info about launchpads
### [Payloads](payloads) - Detailed info about launch payloads
### [Roadster info](roadster) - Detailed info about Elon's Tesla roadster's current position
### [Rockets](rockets) - Detailed info about rocket versions
### [Ships](ships) - Detailed info about ships in the SpaceX fleet
### [Starlink](starlink) - Detailed info about Starlink satellites and orbits
Includes raw orbit data from [Space Track](https://www.space-track.org/auth/login), updated hourly.
Space Track data adheres to the standard for [Orbit Data Messages](https://public.ccsds.org/Pubs/502x0b2c1e2.pdf)
### [History](history) - Detailed info on SpaceX historical events
================================================
FILE: docs/apps.md
================================================
# List of known Apps / UI clients
> _Do you, or do you know of some app, that makes use of this community maintained service? If so, please [create an issue](https://github.com/r-spacex/SpaceX-API/issues/new) or [submit a PR](https://github.com/r-spacex/SpaceX-API/pulls) with additions to this list. Thanks_
|App|Type|Creator(s)|Repo|More|
|:---|:---|:---|:---|:---|
| [2Space](https://play.google.com/store/apps/details?id=abandonedstudio.app.tospace) | Android App | [Pawel Kremienowski](https://github.com/riddick-boss) | [GitHub](https://github.com/riddick-boss/2Space) | |
| [SpaceX](http://spacex.elc0mpa.me/#/) | Website | [elC0mpa](https://github.com/elC0mpa) | [GitHub](https://github.com/elC0mpa/spacex) | built with Vue3 & Composition API |
| [SpaceX History](https://spacex-history.netlify.app) | Website | [Bedirhan Karadoğan](https://github.com/bedirhankaradogan) | [GitHub](https://github.com/bedirhankaradogan/spacex-history) | built with React |
| [🚀 SpaceX CLI](https://www.npmjs.com/package/@orhanemree/spacex-cli) | CLI Tool | [Orhan Emre Dikicigil](https://github.com/orhanemree) | [GitHub](https://github.com/orhanemree/spacex-cli) | built with Node |
| [SpaceX Live Info 🔴️](https://spacex-live.netlify.app/) | Website | [Pawel Pisulski](https://github.com/pislagz) | [GitHub](https://github.com/pislagz/spacex-live) | built with React & Redux |
| [SpaceXtale](https://tsensei.github.io/spaceXtale/) | Website | [tsensei](https://github.com/tsensei/) | [GitHub](https://github.com/tsensei/spaceXtale) | React app with spaceX-api |
| [Rocket Downrange](https://rocketdownrange.com) | Website | [Cavan Lemasters](https://github.com/TheKicker) | [GitHub](https://github.com/TheKicker/rocket-downrange) | |
| [SpaceX-Dashboard🚀](https://thespacexdashboard.netlify.app/) | Website | [Sanjay Rajesh](https://github.com/sanjayrjs16) | [GitHub](https://github.com/sanjayrjs16/spaceX-dashboard-react)||
| [SpaceX-Launches](https://spacex.prutkowski.tech/) | Website | [Piotr Rutkowski](https://github.com/PiotrRut) | [GitHub](https://github.com/PiotrRut/SpaceX-Launches) | |
| [SpaceX and Mars](https://www.spacexandmars.com/) | Website | [Jiacheng Zhang](https://github.com/jiachengzhang1) | [GitHub](https://github.com/jiachengzhang1/spacex-and-mars) | |
| [When is the next SpaceX launch](https://whenisthenextspacexlaunch.com) | Website | [Warwick Ward](https://warwick.io) | [GitHub](https://github.com/warwickofthegh/whenisthenextspacexlaunch.com) | |
| [SpaceX Mission Watch](https://spacexmissionwatch.com) | Website | Quent McCoy | | [QMDD](https://quentmccoy.com) |
| [SpaceX Stats](http://spacexstats.xyz) | Website | Luke Davia | [GitHub](https://github.com/r-spacex/spacexstats-react) |
| [SpaceX Data.Info](http://spacexdata.info) | Website | [Charles Omer](https://www.charlesomer.co.uk) | | [Zyndex](https://www.zyndex.co.uk) |
| [SpaceX Wiki](https://www.spacexwiki.com/) | Website | [Chris Stielper](https://github.com/cstielper) | [GitHub](https://github.com/cstielper/react-spacex-wiki) |
| [X-Watch](https://x-watch.xyz/) | Website | [Matt Mills](https://github.com/mattmillsxyz) | [GitHub](https://github.com/mattmillsxyz/x-watch) |
| [SpaceXLaunches.com](https://spacexlaunches.com) | Website | [louisjc](https://github.com/louisjc/) | [GitHub](https://github.com/louisjc/spacexlaunches.com) |
| [SpaceFax](https://spacefax1.web.app) | Website | [James Hendrie](https://github.com/jimmyboix) | [GitHub](https://github.com/jimmyboix/SpaceFax) | |
| [Deploy to Space](https://spacex-fs.deployto.space/) | Website | [Yannick Durden](https://github.com/YannickDurden) | | |
| [SpaceX Track](https://www.spacextrack.com/) | Website | [Joe Dineen](https://github.com/jdineen21) | [GitHub](https://github.com/jdineen21/space_django) | [Portfolio](https://www.jdineen.co.uk) |
| [SpaceX Guide Site](https://spacex-guide.weebly.com) | Website | Jared-Base | | [Mission Control Page](https://spacex-guide.weebly.com/mission-control.html) |
| [SpaceX info Site](https://infospacex.vercel.app/) | Website | [Tigran Mkrtchyan](https://github.com/mkrtchyan98) | [Github](https://github.com/mkrtchyan98/SpaceInfo) |
| [spacexdash](https://spacexdash.github.io/x) | Website | [spacexdash](https://github.com/spacexdash) | [Github](https://github.com/spacexdash/x/tree/master) | Easy searching of SpaceX data |
| [x-info](https://x-info.eu) | Website | [Patryk Wojcieszak](https://github.com/PatrykWojcieszak) | [GitHub](https://github.com/PatrykWojcieszak/X-Info) | |
| [SpaceX Launch Tracker](https://www.spacexlaunchtracker.com/) | Website | [Emil Sadek](https://github.com/esadek) | [GitHub](https://github.com/esadek/spacex-launch-tracker) | |
| [SpX](https://apps.apple.com/gb/app/spx/id1511355787) | iOS App | [Russell Warwick](https://github.com/waruss321) | |
| [XLaunch](https://apps.apple.com/us/app/xlaunch/id1502939751) | iOS App | [Travis Stanifer](https://github.com/stanifert) | |
| [SpaceXPedia](https://itunes.apple.com/app/spacexpedia/id1434177600?mt=8) | iOS App | [Philip Engberg](https://github.com/philipengberg) | [GitHub](https://github.com/philipengberg/SpaceXPedia) |
| [SpaceDash](https://apps.apple.com/in/app/space-dash/id1527766640) | iOS App | [Pushpinder Pal Singh](https://github.com/pushpinderpalsingh) | [GitHub](https://github.com/pushpinderpalsingh/SpaceDash) |
| [Space Xploration](https://apps.apple.com/app/space-xploration/id1530580909) | iOS App | [Bartolome Estelrich](https://github.com/BEstelrich) | | |
| [SpacExtra](https://apps.apple.com/ca/app/spacextra/id1559360281) | iOS App | [Charlie Kingsland](https://github.com/ChopsKingsland) | | [Website](https://spacextra.github.io) |
| [Norminal](https://apps.apple.com/app/norminal/id1540171547) | iOS App | [Riccardo Persello](https://github.com/persello) | [GitHub](https://github.com/persello/norminal) | |
| [SpaceX Tracker](https://play.google.com/store/apps/details?id=com.magnetar.spacexlauncher) | Android App | [Timo Nelen](https://github.com/TNelen) | [Github](https://github.com/TNelen/SpacexLaunchApp) | |
| [SpaceX Companion](https://play.google.com/store/apps/details?id=nl.studionoorderlicht.spacex) | Android App | [Jeroen Boumans](https://github.com/jeroenboumans) | Not open sourced yet | [Website](https://spacexcompanion.app)
| [SpaceXLaunches](https://play.google.com/store/apps/details?id=com.danielscholte.spacexlaunches) | Android App | [Daniël Scholte](https://github.com/linuxfreak23) | Closed source |
| [SpaceX GO!](https://play.google.com/store/apps/details?id=com.chechu.cherry) | Android App | [Chechu](https://github.com/jesusrp98) | [GitHub](https://github.com/jesusrp98/spacex-go) |
| [SpaceX Universe](https://play.google.com/store/apps/details?id=com.aastudio.spacexuniverse) | Android App | [Oleksii Chernov](https://github.com/chert12) | [Github](https://github.com/chert12/SpaceX-Universe) | |
| [SpaceXFollower](https://github.com/OMIsie11/SpaceXFollower) | Android App | [Oskar Misiewicz @OMIsie11](https://omisie11.github.io) | [Github](https://github.com/OMIsie11/SpaceXFollower) | |
| [Spacexopedia](https://play.google.com/store/apps/details?id=com.thealphamerc.flutter_spacexopedia) | Android App | [Sonu Sharma](https://github.com/TheAlphamerc) | [GitHub](https://github.com/TheAlphamerc/flutter_spacexopedia) | |
| [SpaceX Wiki](https://github.com/prasannajeet/SpaceX_Wiki_KMM_iOS_Android) | Android & iOS App | [Prasan @prasannajeet](https://github.com/prasannajeet) | [Github](https://github.com/prasannajeet/SpaceX_Wiki_KMM_iOS_Android) | Built with Kotlin Multiplatform Mobile |
| [Launchpad](https://github.com/skyffx/Launchpad/releases) | Windows App | [Wojciech Piekielniak](https://github.com/skyffx/) | [Github](https://github.com/skyffx/Launchpad) |
| [InElonWeTrust](https://github.com/Tearth/InElonWeTrust) | Discord bot | [Tearth](https://github.com/Tearth) | [GitHub](https://github.com/Tearth/InElonWeTrust) |
| [SpaceX-Launch-Bot](https://github.com/SpaceXLaunchBot/SpaceXLaunchBot) | Discord bot | [Simon](https://github.com/psidex) | [Github](https://github.com/SpaceXLaunchBot/SpaceXLaunchBot) | |
| [Space Launch Now](https://spacelaunchnow.me/) | API/Website/Apps | [Caleb Jones](https://github.com/ItsCalebJones) | [Github](https://github.com/ItsCalebJones/SpaceLaunchNow-Server) | |
| [AV-SpaceX DB](https://av-spacex.surge.sh/) | API/Website | [Aswin Varghese](http://aswinvarghese.com) | [Github]() | |
| SpaceX Info | Alexa Skill | Andrew Shapton | [Github](https://github.com/alshapton/Space-X-Info-Alexa.git) | Invoke with "Alexa Open SpaceX Info" |
| [SpaceX - Launch Tracker](https://play.google.com/store/apps/details?id=uk.co.zac_h.spacex) | Android App | [Zac Hadjineophytou](https://github.com/zacdevil10) | [GitHub](https://github.com/zacdevil10/spacex-launch-tracker) |
| [Space Bot](https://t.me/spacex_mezgoodle_bot) | Telegram Bot | [Maxim Zavalniuk](https://github.com/mezgoodle) | [GitHub](https://github.com/mezgoodle/space-bot) |
| [SpaceX Launch Data](http://spacexlaunchdata.com) | Website | [Sam Girshovich](https://github.com/samg11) | [GitHub](https://github.com/samg11/SpaceX-Launch-Data) |
| [SpaceX Times](https://play.google.com/store/apps/details?id=ru.alexmaryin.spacextimes_rx) | Android App | [Alex Maryin](https://github.com/alexmaryin) | [GitHub](https://github.com/alexmaryin/spacextimes) |
| [SpaceX Missions](https://spacex-missions.netlify.app) | Website | [Bruno Porcel](https://github.com/bporcel) | [GitHub](https://github.com/bporcel/Space-X) |
| [Launch Tracker - SpaceX](https://play.google.com/store/apps/details?id=com.bvdwalt.spacex_flights) | Android App | [Bennie van der Walt](https://github.com/bvdwalt) | [GitHub](https://github.com/bvdwalt/Launch-Tracker-SpaceX)
| [SpaceX Dashboard](https://tdunn891.github.io/spacex-dashboard/) | Website | [Thomas Dunn](https://github.com/tdunn891) | [GitHub](https://github.com/tdunn891/spacex-dashboard) | |
| [SpaceX Launches](https://spacexlaunches.github.io/) | Website | [l3ycle](https://github.com/l3ycle) | [GitHub](https://github.com/spacexlaunches/spacexlaunches.github.io/) | |
| [SpaceX-Launches](https://amazing-austin-1853eb.netlify.app) 🚀 | Website | [Atamyrat Abdyrahmanov](https://github.com/aaabdyrahmanov) | [GitHub](https://github.com/aaabdyrahmanov/SpaceX-Launches) | |
| [SpaceX history timeline](https://www.orbitaterrestre.com/la-storia-di-spaceX-in-timeline-component) | Website | [Vincenzo](https://github.com/vincenzomarcovecchio) | [GitHub](https://github.com/aaabdyrahmanov/SpaceX-Launches) | |
| [Elon Musk Tracker](https://play.google.com/store/apps/details?id=com.ingenuity.elonmusktracker) | Android/iOS App | [Aman Trifi](https://github.com/TrifiAmanallah) | Closed source | |
| [SpaceX Data](https://spacexdata.pages.dev/) | Website | [Chien Tran](https://github.com/chientrm) | Closed source | Built with SvelteKit, deployed with Cloudflare Pages |
| [SpaceX Portal](https://spacex-portal.vercel.app) | Website | [Daniel Yasakov](https://github.com/ne-danik) | [GitHub](https://github.com/ne-danik/spacex-portal) | built with React |
================================================
FILE: docs/capsules/v4/all.md
================================================
# Get all capsules
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/capsules`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"reuse_count": 1,
"water_landings": 1,
"land_landings": 0,
"last_update": "Reentered after three weeks in orbit",
"launches": [
"5eb87cdeffd86e000604b330"
],
"serial": "C101",
"status": "retired",
"type": "Dragon 1.0",
"id": "5e9e2c5bf35918ed873b2664"
},
...
]
```
================================================
FILE: docs/capsules/v4/one.md
================================================
# Get one capsule
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/capsules/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the capsule
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"reuse_count": 1,
"water_landings": 1,
"land_landings": 0,
"last_update": "Reentered after three weeks in orbit",
"launches": [
"5eb87cdeffd86e000604b330"
],
"serial": "C101",
"status": "retired",
"type": "Dragon 1.0",
"id": "5e9e2c5bf35918ed873b2664"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/capsules/v4/query.md
================================================
# Query capsules
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/capsules/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"reuse_count": 1,
"water_landings": 1,
"land_landings": 0,
"last_update": "Reentered after three weeks in orbit",
"launches": [
"5eb87cdeffd86e000604b330"
],
"serial": "C101",
"status": "retired",
"type": "Dragon 1.0",
"id": "5e9e2c5bf35918ed873b2664"
},
...
],
"totalDocs": 19,
"offset": 0,
"limit": 10,
"totalPages": 2,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/capsules/v4/schema.md
================================================
# Capsule Schema
```json
{
"serial": {
"type": "String",
"required": true,
"unique": true,
},
"status": {
"type": "String",
"enum": ["unknown", "active", "retired", "destroyed"],
"required": true,
},
"type": {
"type": "String",
"enum": ["Dragon 1.0", "Dragon 1.1", "Dragon 2.0"],
"required": true,
},
"dragon": {
"type": "UUID",
},
"reuse_count": {
"type": "Number",
"default": 0,
},
"water_landings": {
"type": "Number",
"default": 0,
},
"land_landings": {
"type": "Number",
"default": 0,
},
"last_update": {
"type": "String",
"default": null,
},
"launches": [{
"type": "UUID",
}],
}
```
================================================
FILE: docs/clients.md
================================================
# List of known API clients / wrappers
> _Do you, or do you know of some client/wrapper, that makes use of this community maintained service? If so, please [create an issue](https://github.com/r-spacex/SpaceX-API/issues/new) or [submit a PR](https://github.com/r-spacex/SpaceX-API/pulls) with additions to this list. Thanks_
NOTE: Clients are grouped by API version(s) supported
### V4 (Latest)
|Name|Lang|Creator(s)|Repo|
|:---|:---|:---|:---|
| Oddity | .NET | Tearth | [GitHub](https://github.com/Tearth/Oddity) |
| SpaceXPy | Python | Ryu JuHeon | [GitHub](https://github.com/SaidBySolo/SpaceXPy) |
| KSBSpacexKit | Swift | SaiBalaji K| [GitHub](https://github.com/SaiBalaji22/KSBSpacexKit) |
| Marsy | C++ | AzuxDario | [GitHub](https://github.com/AzuxDario/Marsy) |
| Spacex-api.js | Node.js | AkiaCode | [Github](https://github.com/AkiaCode/spacex-api.js) |
| spacex_api | Dart | Ahsanz024 | [Github](https://github.com/ahsanz024/spacex_api) |
| spacex_api | Ruby | Victor Perez | [Github](https://github.com/victorperez/spacex-api-ruby) |
| xploration-graphql | TypeScript | Kartik Kumar Gujarati | [Github](https://github.com/Kartikkumargujarati/xploration-graphql) |
| spacex-graphql-gateway | TypeScript | Kevin Hermawan | [Github](https://github.com/kevinstd/spacex-graphql-gateway) |
| r/SpaceX (Independent Publisher) | [Power Platform](https://docs.microsoft.com/en-us/connectors/rspacexip/) | Troy Taylor | [Github](https://github.com/troystaylor/PowerPlatformConnectors/tree/r/SpaceX/independent-publisher-connectors/rSpaceX) |
| spacex-api | Java | Andrey Vasilyev | [Github](https://github.com/artfultom/spacex-api) |
### V3, V2, V1 (Deprecated)
|Name|Lang|Creator(s)|Repo|
|:---|:---|:---|:---|
| SpaceX-GraphQL | TypeScript | Jordan Owens | [GitHub](https://github.com/jor-dan/SpaceX-GraphQL) |
| spacex-graphql-api | GraphQL | Emerson Laurentino | [GitHub](https://github.com/emersonlaurentino/spacex-qraphql-api) |
| SpaceX-API-Wrapper | Node.js | Thomas Smyth | [GitHub](https://github.com/Thomas-Smyth/SpaceX-API-Wrapper) |
| spacex-api | TypeScript / Node.js | Tomasz Borowski | [GitHub](https://github.com/tbprojects/spacex-api), [NPM](https://www.npmjs.com/package/spacex-api) |
| SpaceX | PowerShell | François-Xavier Cat | [GitHub](https://github.com/lazywinadmin/SpaceX) |
| SpacePY-X | Python | Andrew Shapton | [GitHub](https://github.com/alshapton/SpacePY-X) |
| SpaceX-PY | Python | Kaylum Lally | [GitHub](https://github.com/HiKaylum/SpaceX-PY) |
| SpaceNIM-X | Nim | Andrew Shapton | [GitHub](https://github.com/alshapton/SpaceNIM-X) |
| SpaceCRYST-X | Crystal | Andrew Shapton | [GitHub](https://github.com/alshapton/SpaceCRYST-X) |
| spacex | Go | Or Hiltch | [GitHub](https://github.com/orcaman/spacex) |
| spacex-api-wrapper | Rust | Alex Gutan | [GitHub](https://github.com/AGutan/spacex-api-wrapper)|
| spacex-graphql-rust | Rust | Aaron Feigenbaum | [GitHub](https://github.com/adace123/spacex-graphql-rust)|
| space-rx | Rust | Tyler Wilcock | [GitHub](https://github.com/twilco/space-rx) |
| spacex | Ruby | Rodolfo | [GitHub](https://github.com/rodolfobandeira/spacex) |
| spacex | PHP | Aires Gonçalves | [GitHub](https://github.com/airesvsg/spacex) |
| spacex_ex | Elixir | Chen Zhao | [GitHub](https://github.com/crunchysoul/spacex_ex) |
| SpaceX | R | Johannes Friedrich | [GitHub](https://github.com/JohannesFriedrich/SpaceX) |
| SpaceXAPI-Swift | Swift | Sami Sharafeddine | [GitHub](https://github.com/devsamsh/SpaceXAPI-Swift) |
================================================
FILE: docs/company/v4/all.md
================================================
# Get all company info
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/company`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
{
"headquarters": {
"address": "Rocket Road",
"city": "Hawthorne",
"state": "California"
},
"links": {
"website": "https://www.spacex.com/",
"flickr": "https://www.flickr.com/photos/spacex/",
"twitter": "https://twitter.com/SpaceX",
"elon_twitter": "https://twitter.com/elonmusk"
},
"name": "SpaceX",
"founder": "Elon Musk",
"founded": 2002,
"employees": 8000,
"vehicles": 3,
"launch_sites": 3,
"test_sites": 1,
"ceo": "Elon Musk",
"cto": "Elon Musk",
"coo": "Gwynne Shotwell",
"cto_propulsion": "Tom Mueller",
"valuation": 52000000000,
"summary": "SpaceX designs, manufactures and launches advanced rockets and spacecraft. The company was founded in 2002 to revolutionize space technology, with the ultimate goal of enabling people to live on other planets.",
"id": "5eb75edc42fea42237d7f3ed"
}
```
================================================
FILE: docs/company/v4/schema.md
================================================
# Company Info Schema
```json
{
"name": {
"type": "String"
},
"founder": {
"type": "String"
},
"founded": {
"type": "Number"
},
"employees": {
"type": "Number"
},
"vehicles": {
"type": "Number"
},
"launch_sites": {
"type": "Number"
},
"test_sites": {
"type": "Number"
},
"ceo": {
"type": "String"
},
"cto": {
"type": "String"
},
"coo": {
"type": "String"
},
"cto_propulsion": {
"type": "String"
},
"valuation": {
"type": "Number"
},
"headquarters": {
"address": {
"type": "String"
},
"city": {
"type": "String"
},
"state": {
"type": "String"
}
},
"links": {
"website": {
"type": "String"
},
"flickr": {
"type": "String"
},
"twitter": {
"type": "String"
},
"elon_twitter": {
"type": "String"
}
},
"summary": {
"type": "String"
}
}
```
================================================
FILE: docs/cores/v4/all.md
================================================
# Get all cores
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/cores`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"block": 5,
"reuse_count": 3,
"rtls_attempts": 1,
"rtls_landings": 1,
"asds_attempts": 3,
"asds_landings": 3,
"last_update": "Landed on OCISLY as of Jan 29, 2020. ",
"launches": [
"5eb87d2bffd86e000604b375",
"5eb87d31ffd86e000604b379",
"5eb87d3fffd86e000604b382",
"5eb87d44ffd86e000604b386"
],
"serial": "B1051",
"status": "active",
"id": "5e9e28a6f35918c0803b265c"
},
...
]
```
================================================
FILE: docs/cores/v4/one.md
================================================
# Get one core
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/cores/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the core
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"block": 5,
"reuse_count": 3,
"rtls_attempts": 1,
"rtls_landings": 1,
"asds_attempts": 3,
"asds_landings": 3,
"last_update": "Landed on OCISLY as of Jan 29, 2020. ",
"launches": [
"5eb87d2bffd86e000604b375",
"5eb87d31ffd86e000604b379",
"5eb87d3fffd86e000604b382",
"5eb87d44ffd86e000604b386"
],
"serial": "B1051",
"status": "active",
"id": "5e9e28a6f35918c0803b265c"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/cores/v4/query.md
================================================
# Query cores
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/cores/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"block": 5,
"reuse_count": 3,
"rtls_attempts": 1,
"rtls_landings": 1,
"asds_attempts": 2,
"asds_landings": 2,
"last_update": "Missed the droneship and made successful water landing; apparently scuttled at sea afterward. ",
"launches": [
"5eb87d2effd86e000604b377",
"5eb87d36ffd86e000604b37b",
"5eb87d3bffd86e000604b37f",
"5eb87d41ffd86e000604b383"
],
"serial": "B1056",
"status": "lost",
"id": "5e9e28a7f3591809313b2660"
},
...
],
"totalDocs": 65,
"offset": 0,
"limit": 10,
"totalPages": 7,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/cores/v4/schema.md
================================================
# Core Schema
```json
{
"serial": {
"type": "String",
"unique": true,
"required": true,
},
"block": {
"type": "Number",
"default": null,
},
"status": {
"type": "String",
"enum": ["active", "inactive", "unknown", "expended", "lost", "retired"],
"required": true,
},
"reuse_count": {
"type": "Number",
"default": 0,
},
"rtls_attempts": {
"type": "Number",
"default": 0,
},
"rtls_landings": {
"type": "Number",
"default": 0,
},
"asds_attempts": {
"type": "Number",
"default": 0,
},
"asds_landings": {
"type": "Number",
"default": 0,
},
"last_update": {
"type": "String",
"default": null,
},
"launches": [{
"type": "UUID",
}],
}
```
================================================
FILE: docs/crew/v4/all.md
================================================
# Get all crew
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/crew`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"name": "Robert Behnken",
"agency": "NASA",
"image": "https://imgur.com/0smMgMH.png",
"wikipedia": "https://en.wikipedia.org/wiki/Robert_L._Behnken",
"launches": [
"5eb87d46ffd86e000604b388"
],
"status": "active",
"id": "5ebf1a6e23a9a60006e03a7a"
},
...
]
```
================================================
FILE: docs/crew/v4/one.md
================================================
# Get one crew member
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/crew/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the crew member
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"name": "Douglas Hurley",
"agency": "NASA",
"image": "https://i.imgur.com/ooaayWf.png",
"wikipedia": "https://en.wikipedia.org/wiki/Douglas_G._Hurley",
"launches": [
"5eb87d46ffd86e000604b388"
],
"status": "active",
"id": "5ebf1b7323a9a60006e03a7b"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/crew/v4/query.md
================================================
# Query crew members
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/crew/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"name": "Robert Behnken",
"agency": "NASA",
"image": "https://imgur.com/0smMgMH.png",
"wikipedia": "https://en.wikipedia.org/wiki/Robert_L._Behnken",
"launches": [
"5eb87d46ffd86e000604b388"
],
"status": "active",
"id": "5ebf1a6e23a9a60006e03a7a"
},
...
],
"totalDocs": 2,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/crew/v4/schema.md
================================================
# Crew Schema
```json
{
"name": {
"type": "String",
"default": null
},
"status": {
"type": "String",
"required": true,
"enum": ["active", "inactive", "retired", "unknown"]
},
"agency": {
"type": "String",
"default": null
},
"image": {
"type": "String",
"default": null
},
"wikipedia": {
"type": "String",
"default": null
},
"launches": [{
"type": "UUID"
}]
}
```
================================================
FILE: docs/dragons/v4/all.md
================================================
# Get all Dragons
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/dragons`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"heat_shield": {
"material": "PICA-X",
"size_meters": 3.6,
"temp_degrees": 3000,
"dev_partner": "NASA"
},
"launch_payload_mass": {
"kg": 6000,
"lb": 13228
},
"launch_payload_vol": {
"cubic_meters": 25,
"cubic_feet": 883
},
"return_payload_mass": {
"kg": 3000,
"lb": 6614
},
"return_payload_vol": {
"cubic_meters": 11,
"cubic_feet": 388
},
"pressurized_capsule": {
"payload_volume": {
"cubic_meters": 11,
"cubic_feet": 388
}
},
"trunk": {
"trunk_volume": {
"cubic_meters": 14,
"cubic_feet": 494
},
"cargo": {
"solar_array": 2,
"unpressurized_cargo": true
}
},
"height_w_trunk": {
"meters": 7.2,
"feet": 23.6
},
"diameter": {
"meters": 3.7,
"feet": 12
},
"first_flight": "2010-12-08",
"flickr_images": [
"https://www.spacex.com/sites/spacex/files/styles/media_gallery_large/public/2015_-_04_crs5_dragon_orbit13.jpg?itok=9p8_l7UP",
"https://www.spacex.com/sites/spacex/files/styles/media_gallery_large/public/2012_-_4_dragon_grapple_cots2-1.jpg?itok=R2-SeuMX",
"https://farm3.staticflickr.com/2815/32761844973_4b55b27d3c_b.jpg",
"https://farm9.staticflickr.com/8618/16649075267_d18cbb4342_b.jpg"
],
"name": "Dragon 1",
"type": "capsule",
"active": true,
"crew_capacity": 0,
"sidewall_angle_deg": 15,
"orbit_duration_yr": 2,
"dry_mass_kg": 4200,
"dry_mass_lb": 9300,
"thrusters": [
{
"type": "Draco",
"amount": 18,
"pods": 4,
"fuel_1": "nitrogen tetroxide",
"fuel_2": "monomethylhydrazine",
"isp": 300,
"thrust": {
"kN": 0.4,
"lbf": 90
}
}
],
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_Dragon",
"description": "Dragon is a reusable spacecraft developed by SpaceX, an American private space transportation company based in Hawthorne, California. Dragon is launched into space by the SpaceX Falcon 9 two-stage-to-orbit launch vehicle. The Dragon spacecraft was originally designed for human travel, but so far has only been used to deliver cargo to the International Space Station (ISS).",
"id": "5e9d058759b1ff74a7ad5f8f"
},
...
]
```
================================================
FILE: docs/dragons/v4/one.md
================================================
# Get one Dragon
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/dragons/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the dragon
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"heat_shield": {
"material": "PICA-X",
"size_meters": 3.6,
"temp_degrees": 3000,
"dev_partner": "NASA"
},
"launch_payload_mass": {
"kg": 6000,
"lb": 13228
},
"launch_payload_vol": {
"cubic_meters": 25,
"cubic_feet": 883
},
"return_payload_mass": {
"kg": 3000,
"lb": 6614
},
"return_payload_vol": {
"cubic_meters": 11,
"cubic_feet": 388
},
"pressurized_capsule": {
"payload_volume": {
"cubic_meters": 11,
"cubic_feet": 388
}
},
"trunk": {
"trunk_volume": {
"cubic_meters": 14,
"cubic_feet": 494
},
"cargo": {
"solar_array": 2,
"unpressurized_cargo": true
}
},
"height_w_trunk": {
"meters": 7.2,
"feet": 23.6
},
"diameter": {
"meters": 3.7,
"feet": 12
},
"first_flight": "2010-12-08",
"flickr_images": [
"https://www.spacex.com/sites/spacex/files/styles/media_gallery_large/public/2015_-_04_crs5_dragon_orbit13.jpg?itok=9p8_l7UP",
"https://www.spacex.com/sites/spacex/files/styles/media_gallery_large/public/2012_-_4_dragon_grapple_cots2-1.jpg?itok=R2-SeuMX",
"https://farm3.staticflickr.com/2815/32761844973_4b55b27d3c_b.jpg",
"https://farm9.staticflickr.com/8618/16649075267_d18cbb4342_b.jpg"
],
"name": "Dragon 1",
"type": "capsule",
"active": true,
"crew_capacity": 0,
"sidewall_angle_deg": 15,
"orbit_duration_yr": 2,
"dry_mass_kg": 4200,
"dry_mass_lb": 9300,
"thrusters": [
{
"type": "Draco",
"amount": 18,
"pods": 4,
"fuel_1": "nitrogen tetroxide",
"fuel_2": "monomethylhydrazine",
"isp": 300,
"thrust": {
"kN": 0.4,
"lbf": 90
}
}
],
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_Dragon",
"description": "Dragon is a reusable spacecraft developed by SpaceX, an American private space transportation company based in Hawthorne, California. Dragon is launched into space by the SpaceX Falcon 9 two-stage-to-orbit launch vehicle. The Dragon spacecraft was originally designed for human travel, but so far has only been used to deliver cargo to the International Space Station (ISS).",
"id": "5e9d058759b1ff74a7ad5f8f"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/dragons/v4/query.md
================================================
# Query Dragons
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/dragons/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"heat_shield": {
"material": "PICA-X",
"size_meters": 3.6,
"temp_degrees": 3000,
"dev_partner": "NASA"
},
"launch_payload_mass": {
"kg": 6000,
"lb": 13228
},
"launch_payload_vol": {
"cubic_meters": 25,
"cubic_feet": 883
},
"return_payload_mass": {
"kg": 3000,
"lb": 6614
},
"return_payload_vol": {
"cubic_meters": 11,
"cubic_feet": 388
},
"pressurized_capsule": {
"payload_volume": {
"cubic_meters": 11,
"cubic_feet": 388
}
},
"trunk": {
"trunk_volume": {
"cubic_meters": 14,
"cubic_feet": 494
},
"cargo": {
"solar_array": 2,
"unpressurized_cargo": true
}
},
"height_w_trunk": {
"meters": 7.2,
"feet": 23.6
},
"diameter": {
"meters": 3.7,
"feet": 12
},
"first_flight": "2010-12-08",
"flickr_images": [
"https://www.spacex.com/sites/spacex/files/styles/media_gallery_large/public/2015_-_04_crs5_dragon_orbit13.jpg?itok=9p8_l7UP",
"https://www.spacex.com/sites/spacex/files/styles/media_gallery_large/public/2012_-_4_dragon_grapple_cots2-1.jpg?itok=R2-SeuMX",
"https://farm3.staticflickr.com/2815/32761844973_4b55b27d3c_b.jpg",
"https://farm9.staticflickr.com/8618/16649075267_d18cbb4342_b.jpg"
],
"name": "Dragon 1",
"type": "capsule",
"active": true,
"crew_capacity": 0,
"sidewall_angle_deg": 15,
"orbit_duration_yr": 2,
"dry_mass_kg": 4200,
"dry_mass_lb": 9300,
"thrusters": [
{
"type": "Draco",
"amount": 18,
"pods": 4,
"fuel_1": "nitrogen tetroxide",
"fuel_2": "monomethylhydrazine",
"isp": 300,
"thrust": {
"kN": 0.4,
"lbf": 90
}
}
],
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_Dragon",
"description": "Dragon is a reusable spacecraft developed by SpaceX, an American private space transportation company based in Hawthorne, California. Dragon is launched into space by the SpaceX Falcon 9 two-stage-to-orbit launch vehicle. The Dragon spacecraft was originally designed for human travel, but so far has only been used to deliver cargo to the International Space Station (ISS).",
"id": "5e9d058759b1ff74a7ad5f8f"
},
...
],
"totalDocs": 2,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/dragons/v4/schema.md
================================================
# Dragon Schema
```json
{
"name": {
"type": "String",
"unique": true,
"required": true
},
"type": {
"type": "String",
"required": true
},
"active": {
"type": "Boolean",
"required": true
},
"crew_capacity": {
"type": "Number",
"required": true
},
"sidewall_angle_deg": {
"type": "Number",
"required": true
},
"orbit_duration_yr": {
"type": "Number",
"required": true
},
"dry_mass_kg": {
"type": "Number",
"required": true
},
"dry_mass_lb": {
"type": "Number",
"required": true
},
"first_flight": {
"type": "String",
"default": null
},
"heat_shield": {
"material": {
"type": "String",
"required": true
},
"size_meters": {
"type": "Number",
"required": true
},
"temp_degrees": {
"type": "Number"
},
"dev_partner": {
"type": "String"
}
},
"thrusters": {
"type": "Object"
},
"launch_payload_mass": {
"kg": {
"type": "Number"
},
"lb": {
"type": "Number"
}
},
"launch_payload_vol": {
"cubic_meters": {
"type": "Number"
},
"cubic_feet": {
"type": "Number"
}
},
"return_payload_mass": {
"kg": {
"type": "Number"
},
"lb": {
"type": "Number"
}
},
"return_payload_vol": {
"cubic_meters": {
"type": "Number"
},
"cubic_feet": {
"type": "Number"
}
},
"pressurized_capsule": {
"payload_volume": {
"cubic_meters": {
"type": "Number"
},
"cubic_feet": {
"type": "Number"
}
}
},
"trunk": {
"trunk_volume": {
"cubic_meters": {
"type": "Number"
},
"cubic_feet": {
"type": "Number"
}
},
"cargo": {
"solar_array": {
"type": "Number"
},
"unpressurized_cargo": {
"type": "Boolean"
}
}
},
"height_w_trunk": {
"meters": {
"type": "Number"
},
"feet": {
"type": "Number"
}
},
"diameter": {
"meters": {
"type": "Number"
},
"feet": {
"type": "Number"
}
},
"flickr_images": {
"type": [
"String"
]
},
"wikipedia": {
"type": "String"
},
"description": {
"type": "String"
}
}
```
================================================
FILE: docs/history/v4/all.md
================================================
# Get all history events
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/history`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"title": "SpaceX successfully launches humans to ISS",
"event_date_utc": "2020-05-30T19:22:00Z",
"event_date_unix": 1590866520,
"details": "This mission was the first crewed flight to launch from the United States since the end of the Space Shuttle program in 2011. It carried NASA astronauts Doug Hurley and Bob Behnken to the ISS.",
"links": {
"article": "https://spaceflightnow.com/2020/05/30/nasa-astronauts-launch-from-us-soil-for-first-time-in-nine-years/"
}
}
...
]
```
================================================
FILE: docs/history/v4/one.md
================================================
# Get one history event
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/history/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the history event
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"title": "SpaceX successfully launches humans to ISS",
"event_date_utc": "2020-05-30T19:22:00Z",
"event_date_unix": 1590866520,
"details": "This mission was the first crewed flight to launch from the United States since the end of the Space Shuttle program in 2011. It carried NASA astronauts Doug Hurley and Bob Behnken to the ISS.",
"links": {
"article": "https://spaceflightnow.com/2020/05/30/nasa-astronauts-launch-from-us-soil-for-first-time-in-nine-years/"
}
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/history/v4/query.md
================================================
# Query history events
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/history/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"title": "SpaceX successfully launches humans to ISS",
"event_date_utc": "2020-05-30T19:22:00Z",
"event_date_unix": 1590866520,
"details": "This mission was the first crewed flight to launch from the United States since the end of the Space Shuttle program in 2011. It carried NASA astronauts Doug Hurley and Bob Behnken to the ISS.",
"links": {
"article": "https://spaceflightnow.com/2020/05/30/nasa-astronauts-launch-from-us-soil-for-first-time-in-nine-years/"
}
}
...
],
"totalDocs": 7,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/history/v4/schema.md
================================================
# History Event Schema
```json
{
"title": {
"type": "String",
"default": null,
},
"event_date_utc": {
"type": "String",
"default": null,
},
"event_date_unix": {
"type": "Number",
"default": null,
},
"details": {
"type": "String",
"default": null,
},
"links": {
"article": {
"type": "String",
"default": null,
},
},
}
```
================================================
FILE: docs/landpads/v4/all.md
================================================
# Get all landing pads
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/landpads`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"name": "LZ-2",
"full_name": "Landing Zone 2",
"status": "active",
"type": "RTLS",
"locality": "Cape Canaveral",
"region": "Florida",
"latitude": 28.485833,
"longitude": -80.544444,
"landing_attempts": 3,
"landing_successes": 3,
"wikipedia": "https://en.wikipedia.org/wiki/Landing_Zones_1_and_2",
"details": "SpaceX's first east coast landing pad is Landing Zone 1, where the historic first Falcon 9 landing occurred in December 2015. LC-13 was originally used as a launch pad for early Atlas missiles and rockets from Lockheed Martin. LC-1 was later expanded to include Landing Zone 2 for side booster RTLS Falcon Heavy missions, and it was first used in February 2018 for that purpose.",
"launches": [
"5eb87d13ffd86e000604b360",
"5eb87d2dffd86e000604b376",
"5eb87d35ffd86e000604b37a"
],
"id": "5e9e3032383ecb90a834e7c8"
},
...
]
```
================================================
FILE: docs/landpads/v4/one.md
================================================
# Get one landing pad
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/landpads/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the landing pad
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"name": "LZ-2",
"full_name": "Landing Zone 2",
"status": "active",
"type": "RTLS",
"locality": "Cape Canaveral",
"region": "Florida",
"latitude": 28.485833,
"longitude": -80.544444,
"landing_attempts": 3,
"landing_successes": 3,
"wikipedia": "https://en.wikipedia.org/wiki/Landing_Zones_1_and_2",
"details": "SpaceX's first east coast landing pad is Landing Zone 1, where the historic first Falcon 9 landing occurred in December 2015. LC-13 was originally used as a launch pad for early Atlas missiles and rockets from Lockheed Martin. LC-1 was later expanded to include Landing Zone 2 for side booster RTLS Falcon Heavy missions, and it was first used in February 2018 for that purpose.",
"launches": [
"5eb87d13ffd86e000604b360",
"5eb87d2dffd86e000604b376",
"5eb87d35ffd86e000604b37a"
],
"id": "5e9e3032383ecb90a834e7c8"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/landpads/v4/query.md
================================================
# Query landing pads
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/landpads/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"name": "LZ-1",
"full_name": "Landing Zone 1",
"status": "active",
"type": "RTLS",
"locality": "Cape Canaveral",
"region": "Florida",
"latitude": 28.485833,
"longitude": -80.544444,
"landing_attempts": 15,
"landing_successes": 14,
"wikipedia": "https://en.wikipedia.org/wiki/Landing_Zones_1_and_2",
"details": "SpaceX's first east coast landing pad is Landing Zone 1, where the historic first Falcon 9 landing occurred in December 2015. LC-13 was originally used as a launch pad for early Atlas missiles and rockets from Lockheed Martin. LC-1 was later expanded to include Landing Zone 2 for side booster RTLS Falcon Heavy missions, and it was first used in February 2018 for that purpose.",
"launches": [
"5eb87cefffd86e000604b342",
"5eb87cf9ffd86e000604b349",
"5eb87cfeffd86e000604b34d",
"5eb87d01ffd86e000604b350",
"5eb87d03ffd86e000604b352",
"5eb87d07ffd86e000604b356",
"5eb87d09ffd86e000604b358",
"5eb87d0effd86e000604b35c",
"5eb87d10ffd86e000604b35e",
"5eb87d13ffd86e000604b360",
"5eb87d26ffd86e000604b371",
"5eb87d2dffd86e000604b376",
"5eb87d35ffd86e000604b37a",
"5eb87d36ffd86e000604b37b",
"5eb87d42ffd86e000604b384"
],
"id": "5e9e3032383ecb267a34e7c7"
},
...
],
"totalDocs": 7,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/landpads/v4/schema.md
================================================
# Landing Pad Schema
```json
{
"name": {
"type": "String",
"default": null
},
"full_name": {
"type": "String",
"default": null
},
"status": {
"type": "String",
"enum": [
"active",
"inactive",
"unknown",
"retired",
"lost",
"under construction"
],
"required": true
},
"type": {
"type": "String",
"default": null
},
"locality": {
"type": "String",
"default": null
},
"region": {
"type": "String",
"default": null
},
"latitude": {
"type": "Number",
"default": null
},
"longitude": {
"type": "Number",
"default": null
},
"landing_attempts": {
"type": "Number",
"default": 0
},
"landing_successes": {
"type": "Number",
"default": 0
},
"wikipedia": {
"type": "String",
"default": null
},
"details": {
"type": "String",
"default": null
},
"launches": [
{
"type": "UUID"
}
]
}
```
================================================
FILE: docs/launches/v4/all.md
================================================
# Get all launches
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launches`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
},
...
]
```
================================================
FILE: docs/launches/v4/latest.md
================================================
# Get latest launch
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launches/latest`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
```
================================================
FILE: docs/launches/v4/next.md
================================================
# Get next launch
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launches/next`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
```
================================================
FILE: docs/launches/v4/one.md
================================================
# Get one launch
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launches/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the launch
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/launches/v4/past.md
================================================
# Get all past launches
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launches/past`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
...
]
```
================================================
FILE: docs/launches/v4/query.md
================================================
# Query launches
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/launches/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"fairings": {
"reused": false,
"recovery_attempt": true,
"recovered": false,
"ships": ["5ea6ed2e080df4000697c908"]
},
"links": {
"patch": {
"small": "https://images2.imgbox.com/02/51/7NLaBm8c_o.png",
"large": "https://images2.imgbox.com/69/f5/04lBXd2F_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/73ttkd/koreasat_5a_launch_campaign_thread/",
"launch": "https://www.reddit.com/r/spacex/comments/79iuvb/rspacex_koreasat_5a_official_launch_discussion/",
"media": "https://www.reddit.com/r/spacex/comments/79lmdu/rspacex_koreasat5a_media_thread_videos_images/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://farm5.staticflickr.com/4477/38056454431_a5f40f9fd7_o.jpg",
"https://farm5.staticflickr.com/4455/26280153979_b8016a829f_o.jpg",
"https://farm5.staticflickr.com/4459/38056455051_79ef2b949a_o.jpg",
"https://farm5.staticflickr.com/4466/26280153539_ecbc2b3fa9_o.jpg",
"https://farm5.staticflickr.com/4482/26280154209_bf08d76361_o.jpg",
"https://farm5.staticflickr.com/4493/38056455211_a4565a9cee_o.jpg"
]
},
"presskit": "http://www.spacex.com/sites/spacex/files/koreasat5apresskit.pdf",
"webcast": "https://www.youtube.com/watch?v=RUjH14vhLxA",
"youtube_id": "RUjH14vhLxA",
"article": "https://spaceflightnow.com/2017/10/30/spacex-launches-and-lands-third-rocket-in-three-weeks/",
"wikipedia": "https://en.wikipedia.org/wiki/Koreasat_5A"
},
"static_fire_date_utc": "2017-10-26T16:00:00.000Z",
"static_fire_date_unix": 1509033600,
"tdb": false,
"net": false,
"window": 8640,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"details": "KoreaSat 5A is a Ku-band satellite capable of providing communication services from East Africa and Central Asia to southern India, Southeast Asia, the Philippines, Guam, Korea, and Japan. The satellite will be placed in GEO at 113° East Longitude, and will provide services ranging from broadband internet to broadcasting services and maritime communications.",
"crew": [],
"ships": [
"5ea6ed2f080df4000697c90d",
"5ea6ed2e080df4000697c908",
"5ea6ed30080df4000697c913"
],
"capsules": [],
"payloads": ["5eb0e4c5b6c3bb0006eeb217"],
"launchpad": "5e9e4502f509094188566f88",
"auto_update": true,
"flight_number": 50,
"name": "KoreaSat 5A",
"date_utc": "2017-10-30T19:34:00.000Z",
"date_unix": 1509392040,
"date_local": "2017-10-30T15:34:00-04:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a4f359185cc03b2651",
"flight": 1,
"gridfins": true,
"legs": true,
"reused": false,
"landing_attempt": true,
"landing_success": true,
"landing_type": "ASDS",
"landpad": "5e9e3032383ecb6bb234e7ca"
}
],
"id": "5eb87d0dffd86e000604b35b"
}
],
"totalDocs": 109,
"limit": 10,
"totalPages": 11,
"page": 5,
"pagingCounter": 41,
"hasPrevPage": true,
"hasNextPage": true,
"prevPage": 4,
"nextPage": 6
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/launches/v4/schema.md
================================================
# Launch Schema
```json
{
"flight_number": {
"type": "Number",
"required": true
},
"name": {
"type": "String",
"unique": true,
"required": true
},
"date_utc": {
"type": "String",
"required": true
},
"date_unix": {
"type": "Number",
"required": true
},
"date_local": {
"type": "String",
"required": true
},
"date_precision": {
"type": "String",
"required": true,
"enum": [
"half",
"quarter",
"year",
"month",
"day",
"hour"
]
},
"static_fire_date_utc": {
"type": "String",
"default": null
},
"static_fire_date_unix": {
"type": "Number",
"default": null
},
"tdb": {
"type": "Boolean",
"default": false
},
"net": {
"type": "Boolean",
"default": false
},
"window": {
"type": "Number",
"default": null
},
"rocket": {
"type": "UUID",
"default": null
},
"success": {
"type": "Boolean",
"default": null
},
"failures": [
{
"time": {
"type": "Number",
},
"altitude": {
"type": "Number",
},
"reason": {
"type": "String",
},
},
],
"upcoming": {
"type": "Boolean",
"required": true
},
"details": {
"type": "String",
"default": null
},
"fairings": {
"reused": {
"type": "Boolean",
"default": null
},
"recovery_attempt": {
"type": "Boolean",
"default": null
},
"recovered": {
"type": "Boolean",
"default": null
},
"ships": [
"UUID"
]
},
"crew": [
"UUID"
],
"ships": [
"UUID"
],
"capsules": [
"UUID"
],
"payloads": [
"UUID"
],
"launchpad": {
"type": "UUID",
"default": null
},
"cores": [
{
"core": {
"type": "UUID",
"default": null
},
"flight": {
"type": "Number",
"default": null
},
"gridfins": {
"type": "Boolean",
"default": null
},
"legs": {
"type": "Boolean",
"default": null
},
"reused": {
"type": "Boolean",
"default": null
},
"landing_attempt": {
"type": "Boolean",
"default": null
},
"landing_success": {
"type": "Boolean",
"default": null
},
"landing_type": {
"type": "String",
"default": null
},
"landpad": {
"type": "UUID",
"default": null
}
}
],
"links": {
"patch": {
"small": {
"type": "String",
"default": null
},
"large": {
"type": "String",
"default": null
}
},
"reddit": {
"campaign": {
"type": "String",
"default": null
},
"launch": {
"type": "String",
"default": null
},
"media": {
"type": "String",
"default": null
},
"recovery": {
"type": "String",
"default": null
}
},
"flickr": {
"small": [
"String"
],
"original": [
"String"
]
},
"presskit": {
"type": "String",
"default": null
},
"webcast": {
"type": "String",
"default": null
},
"youtube_id": {
"type": "String",
"default": null
},
"article": {
"type": "String",
"default": null
},
"wikipedia": {
"type": "String",
"default": null
}
},
"auto_update": {
"type": "Boolean",
"default": true
}
}
```
================================================
FILE: docs/launches/v4/upcoming.md
================================================
# Get all upcoming launches
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launches/upcoming`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
...
]
```
================================================
FILE: docs/launches/v5/README.md
================================================
## Changes from v4 -> v5
* Crew is now an array of objects, to allow for more data on an individual launch for a crew member
### Old Format
```json
{
"crew": [
"1234567890",
"123456789",
"123456789",
]
}
```
### New Format
```json
{
"crew": [
"1234567890",
"123456789",
"123456789",
]
}
```
================================================
FILE: docs/launches/v5/all.md
================================================
# Get all launches
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v5/launches`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
},
...
]
```
================================================
FILE: docs/launches/v5/latest.md
================================================
# Get latest launch
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v5/launches/latest`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
```
================================================
FILE: docs/launches/v5/next.md
================================================
# Get next launch
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v5/launches/next`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
```
================================================
FILE: docs/launches/v5/one.md
================================================
# Get one launch
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v5/launches/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the launch
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/launches/v5/past.md
================================================
# Get all past launches
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v5/launches/past`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
...
]
```
================================================
FILE: docs/launches/v5/query.md
================================================
# Query launches
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v5/launches/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"fairings": {
"reused": false,
"recovery_attempt": true,
"recovered": false,
"ships": ["5ea6ed2e080df4000697c908"]
},
"links": {
"patch": {
"small": "https://images2.imgbox.com/02/51/7NLaBm8c_o.png",
"large": "https://images2.imgbox.com/69/f5/04lBXd2F_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/73ttkd/koreasat_5a_launch_campaign_thread/",
"launch": "https://www.reddit.com/r/spacex/comments/79iuvb/rspacex_koreasat_5a_official_launch_discussion/",
"media": "https://www.reddit.com/r/spacex/comments/79lmdu/rspacex_koreasat5a_media_thread_videos_images/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://farm5.staticflickr.com/4477/38056454431_a5f40f9fd7_o.jpg",
"https://farm5.staticflickr.com/4455/26280153979_b8016a829f_o.jpg",
"https://farm5.staticflickr.com/4459/38056455051_79ef2b949a_o.jpg",
"https://farm5.staticflickr.com/4466/26280153539_ecbc2b3fa9_o.jpg",
"https://farm5.staticflickr.com/4482/26280154209_bf08d76361_o.jpg",
"https://farm5.staticflickr.com/4493/38056455211_a4565a9cee_o.jpg"
]
},
"presskit": "http://www.spacex.com/sites/spacex/files/koreasat5apresskit.pdf",
"webcast": "https://www.youtube.com/watch?v=RUjH14vhLxA",
"youtube_id": "RUjH14vhLxA",
"article": "https://spaceflightnow.com/2017/10/30/spacex-launches-and-lands-third-rocket-in-three-weeks/",
"wikipedia": "https://en.wikipedia.org/wiki/Koreasat_5A"
},
"static_fire_date_utc": "2017-10-26T16:00:00.000Z",
"static_fire_date_unix": 1509033600,
"tdb": false,
"net": false,
"window": 8640,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"details": "KoreaSat 5A is a Ku-band satellite capable of providing communication services from East Africa and Central Asia to southern India, Southeast Asia, the Philippines, Guam, Korea, and Japan. The satellite will be placed in GEO at 113° East Longitude, and will provide services ranging from broadband internet to broadcasting services and maritime communications.",
"crew": [],
"ships": [
"5ea6ed2f080df4000697c90d",
"5ea6ed2e080df4000697c908",
"5ea6ed30080df4000697c913"
],
"capsules": [],
"payloads": ["5eb0e4c5b6c3bb0006eeb217"],
"launchpad": "5e9e4502f509094188566f88",
"auto_update": true,
"flight_number": 50,
"name": "KoreaSat 5A",
"date_utc": "2017-10-30T19:34:00.000Z",
"date_unix": 1509392040,
"date_local": "2017-10-30T15:34:00-04:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a4f359185cc03b2651",
"flight": 1,
"gridfins": true,
"legs": true,
"reused": false,
"landing_attempt": true,
"landing_success": true,
"landing_type": "ASDS",
"landpad": "5e9e3032383ecb6bb234e7ca"
}
],
"id": "5eb87d0dffd86e000604b35b"
}
],
"totalDocs": 109,
"limit": 10,
"totalPages": 11,
"page": 5,
"pagingCounter": 41,
"hasPrevPage": true,
"hasNextPage": true,
"prevPage": 4,
"nextPage": 6
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/launches/v5/schema.md
================================================
# Launch Schema
```json
{
"flight_number": {
"type": "Number",
"required": true
},
"name": {
"type": "String",
"unique": true,
"required": true
},
"date_utc": {
"type": "String",
"required": true
},
"date_unix": {
"type": "Number",
"required": true
},
"date_local": {
"type": "String",
"required": true
},
"date_precision": {
"type": "String",
"required": true,
"enum": [
"half",
"quarter",
"year",
"month",
"day",
"hour"
]
},
"static_fire_date_utc": {
"type": "String",
"default": null
},
"static_fire_date_unix": {
"type": "Number",
"default": null
},
"tdb": {
"type": "Boolean",
"default": false
},
"net": {
"type": "Boolean",
"default": false
},
"window": {
"type": "Number",
"default": null
},
"rocket": {
"type": "UUID",
"default": null
},
"success": {
"type": "Boolean",
"default": null
},
"failures": [
{
"time": {
"type": "Number",
},
"altitude": {
"type": "Number",
},
"reason": {
"type": "String",
},
},
],
"upcoming": {
"type": "Boolean",
"required": true
},
"details": {
"type": "String",
"default": null
},
"fairings": {
"reused": {
"type": "Boolean",
"default": null
},
"recovery_attempt": {
"type": "Boolean",
"default": null
},
"recovered": {
"type": "Boolean",
"default": null
},
"ships": [
"UUID"
]
},
"crew": [
{
"crew": {
"type": "UUID",
"default": null
},
"role": {
"type": "String",
"default": null
},
}
],
"ships": [
"UUID"
],
"capsules": [
"UUID"
],
"payloads": [
"UUID"
],
"launchpad": {
"type": "UUID",
"default": null
},
"cores": [
{
"core": {
"type": "UUID",
"default": null
},
"flight": {
"type": "Number",
"default": null
},
"gridfins": {
"type": "Boolean",
"default": null
},
"legs": {
"type": "Boolean",
"default": null
},
"reused": {
"type": "Boolean",
"default": null
},
"landing_attempt": {
"type": "Boolean",
"default": null
},
"landing_success": {
"type": "Boolean",
"default": null
},
"landing_type": {
"type": "String",
"default": null
},
"landpad": {
"type": "UUID",
"default": null
}
}
],
"links": {
"patch": {
"small": {
"type": "String",
"default": null
},
"large": {
"type": "String",
"default": null
}
},
"reddit": {
"campaign": {
"type": "String",
"default": null
},
"launch": {
"type": "String",
"default": null
},
"media": {
"type": "String",
"default": null
},
"recovery": {
"type": "String",
"default": null
}
},
"flickr": {
"small": [
"String"
],
"original": [
"String"
]
},
"presskit": {
"type": "String",
"default": null
},
"webcast": {
"type": "String",
"default": null
},
"youtube_id": {
"type": "String",
"default": null
},
"article": {
"type": "String",
"default": null
},
"wikipedia": {
"type": "String",
"default": null
}
},
"auto_update": {
"type": "Boolean",
"default": true
}
}
```
================================================
FILE: docs/launches/v5/upcoming.md
================================================
# Get all upcoming launches
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v5/launches/upcoming`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"fairings": null,
"links": {
"patch": {
"small": "https://images2.imgbox.com/53/22/dh0XSLXO_o.png",
"large": "https://images2.imgbox.com/15/2b/NAcsTEB6_o.png"
},
"reddit": {
"campaign": "https://www.reddit.com/r/spacex/comments/ezn6n0/crs20_launch_campaign_thread",
"launch": "https://www.reddit.com/r/spacex/comments/fe8pcj/rspacex_crs20_official_launch_discussion_updates/",
"media": "https://www.reddit.com/r/spacex/comments/fes64p/rspacex_crs20_media_thread_videos_images_gifs/",
"recovery": null
},
"flickr": {
"small": [],
"original": [
"https://live.staticflickr.com/65535/49635401403_96f9c322dc_o.jpg",
"https://live.staticflickr.com/65535/49636202657_e81210a3ca_o.jpg",
"https://live.staticflickr.com/65535/49636202572_8831c5a917_o.jpg",
"https://live.staticflickr.com/65535/49635401423_e0bef3e82f_o.jpg",
"https://live.staticflickr.com/65535/49635985086_660be7062f_o.jpg"
]
},
"presskit": "https://www.spacex.com/sites/spacex/files/crs-20_mission_press_kit.pdf",
"webcast": "https://youtu.be/1MkcWK2PnsU",
"youtube_id": "1MkcWK2PnsU",
"article": "https://spaceflightnow.com/2020/03/07/late-night-launch-of-spacex-cargo-ship-marks-end-of-an-era/",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX_CRS-20"
},
"static_fire_date_utc": "2020-03-01T10:20:00.000Z",
"static_fire_date_unix": 1583058000,
"tdb": false,
"net": false,
"window": 0,
"rocket": "5e9d0d95eda69973a809d1ec",
"success": true,
"failures": [],
"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.",
"crew": [],
"ships": [],
"capsules": [
"5e9e2c5cf359185d753b266f"
],
"payloads": [
"5eb0e4d0b6c3bb0006eeb253"
],
"launchpad": "5e9e4501f509094ba4566f84",
"auto_update": true,
"flight_number": 91,
"name": "CRS-20",
"date_utc": "2020-03-07T04:50:31.000Z",
"date_unix": 1583556631,
"date_local": "2020-03-06T23:50:31-05:00",
"date_precision": "hour",
"upcoming": false,
"cores": [
{
"core": "5e9e28a7f359187afd3b2662",
"flight": 2,
"gridfins": true,
"legs": true,
"reused": true,
"landing_attempt": true,
"landing_success": true,
"landing_type": "RTLS",
"landpad": "5e9e3032383ecb267a34e7c7"
}
],
"id": "5eb87d42ffd86e000604b384"
}
...
]
```
================================================
FILE: docs/launchpads/v4/all.md
================================================
# Get all launchpads
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launchpads`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"name": "VAFB SLC 4E",
"full_name": "Vandenberg Air Force Base Space Launch Complex 4E",
"locality": "Vandenberg Air Force Base",
"region": "California",
"timezone": "America/Los_Angeles",
"latitude": 34.632093,
"longitude": -120.610829,
"launch_attempts": 15,
"launch_successes": 15,
"rockets": [
"5e9d0d95eda69973a809d1ec"
],
"launches": [
"5eb87ce1ffd86e000604b334",
"5eb87cf0ffd86e000604b343",
"5eb87cfdffd86e000604b34c",
"5eb87d05ffd86e000604b354",
"5eb87d08ffd86e000604b357",
"5eb87d0affd86e000604b359",
"5eb87d0fffd86e000604b35d",
"5eb87d14ffd86e000604b361",
"5eb87d16ffd86e000604b363",
"5eb87d1affd86e000604b367",
"5eb87d1fffd86e000604b36b",
"5eb87d23ffd86e000604b36e",
"5eb87d25ffd86e000604b370",
"5eb87d28ffd86e000604b373",
"5eb87d31ffd86e000604b379"
],
"status": "active",
"id": "5e9e4502f509092b78566f87"
},
...
]
```
================================================
FILE: docs/launchpads/v4/one.md
================================================
# Get one launchpad
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/launchpads/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the launchpad
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"name": "VAFB SLC 4E",
"full_name": "Vandenberg Air Force Base Space Launch Complex 4E",
"locality": "Vandenberg Air Force Base",
"region": "California",
"timezone": "America/Los_Angeles",
"latitude": 34.632093,
"longitude": -120.610829,
"launch_attempts": 15,
"launch_successes": 15,
"rockets": [
"5e9d0d95eda69973a809d1ec"
],
"launches": [
"5eb87ce1ffd86e000604b334",
"5eb87cf0ffd86e000604b343",
"5eb87cfdffd86e000604b34c",
"5eb87d05ffd86e000604b354",
"5eb87d08ffd86e000604b357",
"5eb87d0affd86e000604b359",
"5eb87d0fffd86e000604b35d",
"5eb87d14ffd86e000604b361",
"5eb87d16ffd86e000604b363",
"5eb87d1affd86e000604b367",
"5eb87d1fffd86e000604b36b",
"5eb87d23ffd86e000604b36e",
"5eb87d25ffd86e000604b370",
"5eb87d28ffd86e000604b373",
"5eb87d31ffd86e000604b379"
],
"status": "active",
"id": "5e9e4502f509092b78566f87"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/launchpads/v4/query.md
================================================
# Query launchpads
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/launchpads/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"name": "VAFB SLC 4E",
"full_name": "Vandenberg Air Force Base Space Launch Complex 4E",
"locality": "Vandenberg Air Force Base",
"region": "California",
"timezone": "America/Los_Angeles",
"latitude": 34.632093,
"longitude": -120.610829,
"launch_attempts": 15,
"launch_successes": 15,
"rockets": [
"5e9d0d95eda69973a809d1ec"
],
"launches": [
"5eb87ce1ffd86e000604b334",
"5eb87cf0ffd86e000604b343",
"5eb87cfdffd86e000604b34c",
"5eb87d05ffd86e000604b354",
"5eb87d08ffd86e000604b357",
"5eb87d0affd86e000604b359",
"5eb87d0fffd86e000604b35d",
"5eb87d14ffd86e000604b361",
"5eb87d16ffd86e000604b363",
"5eb87d1affd86e000604b367",
"5eb87d1fffd86e000604b36b",
"5eb87d23ffd86e000604b36e",
"5eb87d25ffd86e000604b370",
"5eb87d28ffd86e000604b373",
"5eb87d31ffd86e000604b379"
],
"status": "active",
"id": "5e9e4502f509092b78566f87"
},
...
],
"totalDocs": 6,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/launchpads/v4/schema.md
================================================
# Launchpad Schema
```json
{
"name": {
"type": "String",
"default": null
},
"full_name": {
"type": "String",
"default": null
},
"status": {
"type": "String",
"enum": [
"active",
"inactive",
"unknown",
"retired",
"lost",
"under construction"
],
"required": true
},
"locality": {
"type": "String",
"default": null
},
"region": {
"type": "String",
"default": null
},
"timezone": {
"type": "String",
"default": null
},
"latitude": {
"type": "Number",
"default": null
},
"longitude": {
"type": "Number",
"default": null
},
"launch_attempts": {
"type": "Number",
"default": 0
},
"launch_successes": {
"type": "Number",
"default": 0
},
"rockets": [
"UUID"
],
"launches": [
"UUID"
]
}
```
================================================
FILE: docs/payloads/v4/all.md
================================================
# Get all payloads
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/payloads`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"dragon": {
"capsule": null,
"mass_returned_kg": null,
"mass_returned_lbs": null,
"flight_time_sec": null,
"manifest": null,
"water_landing": null,
"land_landing": null
},
"name": "Tintin A & B",
"type": "Satellite",
"reused": false,
"launch": "5eb87d14ffd86e000604b361",
"customers": [
"SpaceX"
],
"norad_ids": [
43216,
43217
],
"nationalities": [
"United States"
],
"manufacturers": [
"SpaceX"
],
"mass_kg": 800,
"mass_lbs": 1763.7,
"orbit": "SSO",
"reference_system": "geocentric",
"regime": "low-earth",
"longitude": null,
"semi_major_axis_km": 6737.42,
"eccentricity": 0.0012995,
"periapsis_km": 350.53,
"apoapsis_km": 368.04,
"inclination_deg": 97.4444,
"period_min": 91.727,
"lifespan_years": 1,
"epoch": "2020-06-13T13:46:31.000Z",
"mean_motion": 15.69864906,
"raan": 176.6734,
"arg_of_pericenter": 174.2326,
"mean_anomaly": 185.9087,
"id": "5eb0e4c6b6c3bb0006eeb21e"
},
...
]
```
================================================
FILE: docs/payloads/v4/one.md
================================================
# Get one payload
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/payloads/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the payload
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"dragon": {
"capsule": null,
"mass_returned_kg": null,
"mass_returned_lbs": null,
"flight_time_sec": null,
"manifest": null,
"water_landing": null,
"land_landing": null
},
"name": "Tintin A & B",
"type": "Satellite",
"reused": false,
"launch": "5eb87d14ffd86e000604b361",
"customers": [
"SpaceX"
],
"norad_ids": [
43216,
43217
],
"nationalities": [
"United States"
],
"manufacturers": [
"SpaceX"
],
"mass_kg": 800,
"mass_lbs": 1763.7,
"orbit": "SSO",
"reference_system": "geocentric",
"regime": "low-earth",
"longitude": null,
"semi_major_axis_km": 6737.42,
"eccentricity": 0.0012995,
"periapsis_km": 350.53,
"apoapsis_km": 368.04,
"inclination_deg": 97.4444,
"period_min": 91.727,
"lifespan_years": 1,
"epoch": "2020-06-13T13:46:31.000Z",
"mean_motion": 15.69864906,
"raan": 176.6734,
"arg_of_pericenter": 174.2326,
"mean_anomaly": 185.9087,
"id": "5eb0e4c6b6c3bb0006eeb21e"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/payloads/v4/query.md
================================================
# Query payloads
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/payloads/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"dragon": {
"capsule": null,
"mass_returned_kg": null,
"mass_returned_lbs": null,
"flight_time_sec": null,
"manifest": null,
"water_landing": null,
"land_landing": null
},
"name": "Tintin A & B",
"type": "Satellite",
"reused": false,
"launch": "5eb87d14ffd86e000604b361",
"customers": [
"SpaceX"
],
"norad_ids": [
43216,
43217
],
"nationalities": [
"United States"
],
"manufacturers": [
"SpaceX"
],
"mass_kg": 800,
"mass_lbs": 1763.7,
"orbit": "SSO",
"reference_system": "geocentric",
"regime": "low-earth",
"longitude": null,
"semi_major_axis_km": 6737.42,
"eccentricity": 0.0012995,
"periapsis_km": 350.53,
"apoapsis_km": 368.04,
"inclination_deg": 97.4444,
"period_min": 91.727,
"lifespan_years": 1,
"epoch": "2020-06-13T13:46:31.000Z",
"mean_motion": 15.69864906,
"raan": 176.6734,
"arg_of_pericenter": 174.2326,
"mean_anomaly": 185.9087,
"id": "5eb0e4c6b6c3bb0006eeb21e"
}
...
],
"totalDocs": 136,
"offset": 0,
"limit": 10,
"totalPages": 14,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/payloads/v4/schema.md
================================================
# Payload Schema
```json
{
"name": {
"type": "String",
"default": null,
"unique": true
},
"type": {
"type": "String",
"default": null
},
"reused": {
"type": "Boolean",
"default": false
},
"launch": {
"type": "UUID",
"default": null
},
"customers": [
"String"
],
"norad_ids": [
"Number"
],
"nationalities": [
"String"
],
"manufacturers": [
"String"
],
"mass_kg": {
"type": "Number",
"default": null
},
"mass_lbs": {
"type": "Number",
"default": null
},
"orbit": {
"type": "String",
"default": null
},
"reference_system": {
"type": "String",
"default": null
},
"regime": {
"type": "String",
"default": null
},
"longitude": {
"type": "Number",
"default": null
},
"semi_major_axis_km": {
"type": "Number",
"default": null
},
"eccentricity": {
"type": "Number",
"default": null
},
"periapsis_km": {
"type": "Number",
"default": null
},
"apoapsis_km": {
"type": "Number",
"default": null
},
"inclination_deg": {
"type": "Number",
"default": null
},
"period_min": {
"type": "Number",
"default": null
},
"lifespan_years": {
"type": "Number",
"default": null
},
"epoch": {
"type": "String",
"default": null
},
"mean_motion": {
"type": "Number",
"default": null
},
"raan": {
"type": "Number",
"default": null
},
"arg_of_pericenter": {
"type": "Number",
"default": null
},
"mean_anomaly": {
"type": "Number",
"default": null
},
"dragon": {
"capsule": {
"type": "UUID",
"default": null
},
"mass_returned_kg": {
"type": "Number",
"default": null
},
"mass_returned_lbs": {
"type": "Number",
"default": null
},
"flight_time_sec": {
"type": "Number",
"default": null
},
"manifest": {
"type": "String",
"default": null
},
"water_landing": {
"type": "Boolean",
"default": null
},
"land_landing": {
"type": "Boolean",
"default": null
}
}
}
```
================================================
FILE: docs/queries.md
================================================
# Query + Pagination Guide
All `/query` routes support pagination parameters via [mongoose-paginate](https://github.com/aravindnc/mongoose-paginate-v2).
The default body for `/query` routes is:
```json
{
"query": {},
"options": {},
}
```
`query` accepts any valid MongoDB find() query, documented [here](https://docs.mongodb.com/manual/tutorial/query-documents/)
`options` accepts any of the options documented [here](https://github.com/aravindnc/mongoose-paginate-v2#modelpaginatequery-options-callback), but here are some of the most common:
- `select` { Object | String } - Fields to return (by default returns all fields). [Documentation](http://mongoosejs.com/docs/api.html#query_Query-select)
- `sort` { Object | String } - Sort order. [Documentation](http://mongoosejs.com/docs/api.html#query_Query-sort)
- `offset` { Number } - Use `offset` or `page` to set skip position
- `page` { Number }
- `limit` { Number }
- `pagination` { Boolean } - If set to false, it will return all docs without adding limit condition. (Default: True)
- `populate` {Array | Object | String} - Paths which should be populated with other documents. [Documentation](https://mongoosejs.com/docs/api.html#query_Query-populate)
This is the default return structure for paginated results:
```json
{
"docs": [],
"totalDocs": 0,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
By default, UUID's are used to reference documents in another collection. For example, the [launches](launches/query.md) endpoint has an array of UUID's named `payloads` that references a payload in the [payloads](payloads/query.md) endpoint.
```json
{
"payloads": [
"5eb0e4c6b6c3bb0006eeb21e"
]
}
```
This allows us to populate or replace the UUID with the payload that it references. In this example, to populate `payloads` with the corresponding document, we would send a `POST` request to `https://api.spacexdata.com/v4/launches/query` with the following body:
```json
{
"query": {},
"options": {
"populate": [
"payloads"
]
},
}
```
Which returns the linked payload object in place of the UUID:
```json
{
...
"payloads": [
{
"dragon": {
"capsule": null,
"mass_returned_kg": null,
"mass_returned_lbs": null,
"flight_time_sec": null,
"manifest": null,
"water_landing": null,
"land_landing": null
},
"name": "Tintin A & B",
"type": "Satellite",
"reused": false,
"launch": "5eb87d14ffd86e000604b361",
"customers": [
"SpaceX"
],
"norad_ids": [
43216,
43217
],
"nationalities": [
"United States"
],
"manufacturers": [
"SpaceX"
],
"mass_kg": 800,
"mass_lbs": 1763.7,
"orbit": "SSO",
"reference_system": "geocentric",
"regime": "low-earth",
"longitude": null,
"semi_major_axis_km": 6737.42,
"eccentricity": 0.0012995,
"periapsis_km": 350.53,
"apoapsis_km": 368.04,
"inclination_deg": 97.4444,
"period_min": 91.727,
"lifespan_years": 1,
"epoch": "2020-06-13T13:46:31.000Z",
"mean_motion": 15.69864906,
"raan": 176.6734,
"arg_of_pericenter": 174.2326,
"mean_anomaly": 185.9087,
"id": "5eb0e4c6b6c3bb0006eeb21e"
}
]
...
}
```
Populate also allows you to select specific fields to return. For example, if you were only interested in the payload `name`, you could use the following:
```json
{
"options": {
"populate": [
{
"path": "payloads",
"select": {
"name": 1
}
}
]
}
}
```
Which would return:
```json
{
"payloads": [
{
"name": "Tintin A & B",
"id": "5eb0e4c6b6c3bb0006eeb21e"
}
]
}
```
Populate can also be nested inside another populate to recursively fill fields. For example, you could populate the `payloads` array, and also populate the `launch` property inside each payload:
```json
{
"options": {
"populate": [
{
"path":"payloads",
"populate": [
{
"path":"launch"
}
]
}
]
}
}
```
## Examples
### Query between 2 dates
Dates need to be ISO 8601 friendly for these operators to work properly
```json
{
"query": {
"date_utc": {
"$gte": "2017-06-22T00:00:00.000Z",
"$lte": "2017-06-25T00:00:00.000Z"
}
}
}
```
### Full text search
This will search all text indexes in a collection. All string fields get indexed
See the mongo [reference](https://docs.mongodb.com/manual/reference/operator/query/text/) for more details on additional operators.
```json
{
"query": {
"$text": {
"$search": "crs"
}
}
}
```
### Next Upcoming Launch
```json
{
"query":{
"upcoming":true
},
"options":{
"limit":1,
"sort":{
"flight_number":"asc"
}
}
}
```
### Complex Query
```json
{
"query": {
"date_utc": {
"$gte": "2017-06-22T00:00:00.000Z",
"$lte": "2017-06-25T00:00:00.000Z"
},
"$or": [
{
"flight_number": {
"$gt": 30
}
},
{
"tbd": true
}
],
"date_precision": {
"$in": [
"month",
"day"
]
}
},
"options": {
"sort": {
"flight_number": "asc"
},
"limit": 50
}
}
```
================================================
FILE: docs/roadster/v4/get.md
================================================
# Get roadster info
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/roadster`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
{
"flickr_images": [
"https://farm5.staticflickr.com/4615/40143096241_11128929df_b.jpg",
"https://farm5.staticflickr.com/4702/40110298232_91b32d0cc0_b.jpg",
"https://farm5.staticflickr.com/4676/40110297852_5e794b3258_b.jpg",
"https://farm5.staticflickr.com/4745/40110304192_6e3e9a7a1b_b.jpg"
],
"name": "Elon Musk's Tesla Roadster",
"launch_date_utc": "2018-02-06T20:45:00.000Z",
"launch_date_unix": 1517949900,
"launch_mass_kg": 1350,
"launch_mass_lbs": 2976,
"norad_id": 43205,
"epoch_jd": 2459014.345891204,
"orbit_type": "heliocentric",
"apoapsis_au": 1.663950009802517,
"periapsis_au": 0.9859657216725529,
"semi_major_axis_au": 196.2991348009594,
"eccentricity": 0.2558512635239784,
"inclination": 1.077499248052439,
"longitude": 317.0839961949045,
"periapsis_arg": 177.5240278992875,
"period_days": 557.059427465354,
"speed_kph": 72209.97792,
"speed_mph": 44869.18619012833,
"earth_distance_km": 220606726.83228922,
"earth_distance_mi": 137078622.45850638,
"mars_distance_km": 89348334.47067611,
"mars_distance_mi": 55518463.93837848,
"wikipedia": "https://en.wikipedia.org/wiki/Elon_Musk%27s_Tesla_Roadster",
"video": "https://youtu.be/wbSwFU6tY1c",
"details": "Elon Musk's Tesla Roadster is an electric sports car that served as the dummy payload for the February 2018 Falcon Heavy test flight and is now an artificial satellite of the Sun. Starman, a mannequin dressed in a spacesuit, occupies the driver's seat. The car and rocket are products of Tesla and SpaceX. This 2008-model Roadster was previously used by Musk for commuting, and is the only consumer car sent into space.",
"id": "5eb75f0842fea42237d7f3f4"
}
```
================================================
FILE: docs/roadster/v4/query.md
================================================
# Query roadster
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/roadster/query`
**Auth required** : `False`
**Body** :
**NOTE:** Unlike other `/query` endpoints, this does not provide pagination, and only exposes the `select` ability in `options` to allow you to hide/show specific fields in the response. For more info on how select works, see the [mongoose](https://mongoosejs.com/docs/api.html#query_Query-select) docs.
```json
{
"query": {},
"options": {
"select": {
"norad_id": 1,
}
}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"flickr_images": [
"https://farm5.staticflickr.com/4615/40143096241_11128929df_b.jpg",
"https://farm5.staticflickr.com/4702/40110298232_91b32d0cc0_b.jpg",
"https://farm5.staticflickr.com/4676/40110297852_5e794b3258_b.jpg",
"https://farm5.staticflickr.com/4745/40110304192_6e3e9a7a1b_b.jpg"
],
"name": "Elon Musk's Tesla Roadster",
"launch_date_utc": "2018-02-06T20:45:00.000Z",
"launch_date_unix": 1517949900,
"launch_mass_kg": 1350,
"launch_mass_lbs": 2976,
"norad_id": 43205,
"epoch_jd": 2459014.345891204,
"orbit_type": "heliocentric",
"apoapsis_au": 1.663950009802517,
"periapsis_au": 0.9859657216725529,
"semi_major_axis_au": 196.2991348009594,
"eccentricity": 0.2558512635239784,
"inclination": 1.077499248052439,
"longitude": 317.0839961949045,
"periapsis_arg": 177.5240278992875,
"period_days": 557.059427465354,
"speed_kph": 72209.97792,
"speed_mph": 44869.18619012833,
"earth_distance_km": 220606726.83228922,
"earth_distance_mi": 137078622.45850638,
"mars_distance_km": 89348334.47067611,
"mars_distance_mi": 55518463.93837848,
"wikipedia": "https://en.wikipedia.org/wiki/Elon_Musk%27s_Tesla_Roadster",
"video": "https://youtu.be/wbSwFU6tY1c",
"details": "Elon Musk's Tesla Roadster is an electric sports car that served as the dummy payload for the February 2018 Falcon Heavy test flight and is now an artificial satellite of the Sun. Starman, a mannequin dressed in a spacesuit, occupies the driver's seat. The car and rocket are products of Tesla and SpaceX. This 2008-model Roadster was previously used by Musk for commuting, and is the only consumer car sent into space.",
"id": "5eb75f0842fea42237d7f3f4"
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/roadster/v4/schema.md
================================================
# Roadster Schema
```json
{
"name": {
"type": "String"
},
"launch_date_utc": {
"type": "String"
},
"launch_date_unix": {
"type": "Number"
},
"launch_mass_kg": {
"type": "Number"
},
"launch_mass_lbs": {
"type": "Number"
},
"norad_id": {
"type": "Number"
},
"epoch_jd": {
"type": "Number"
},
"orbit_type": {
"type": "String"
},
"apoapsis_au": {
"type": "Number"
},
"periapsis_au": {
"type": "Number"
},
"semi_major_axis_au": {
"type": "Number"
},
"eccentricity": {
"type": "Number"
},
"inclination": {
"type": "Number"
},
"longitude": {
"type": "Number"
},
"periapsis_arg": {
"type": "Number"
},
"period_days": {
"type": "Number"
},
"speed_kph": {
"type": "Number"
},
"speed_mph": {
"type": "Number"
},
"earth_distance_km": {
"type": "Number"
},
"earth_distance_mi": {
"type": "Number"
},
"mars_distance_km": {
"type": "Number"
},
"mars_distance_mi": {
"type": "Number"
},
"flickr_images": [
"String"
],
"wikipedia": {
"type": "String"
},
"video": {
"type": "String"
},
"details": {
"type": "String"
}
}
```
================================================
FILE: docs/rockets/v4/all.md
================================================
# Get all rockets
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/rockets`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"height": {
"meters": 70,
"feet": 229.6
},
"diameter": {
"meters": 12.2,
"feet": 39.9
},
"mass": {
"kg": 1420788,
"lb": 3125735
},
"first_stage": {
"thrust_sea_level": {
"kN": 22819,
"lbf": 5130000
},
"thrust_vacuum": {
"kN": 24681,
"lbf": 5548500
},
"reusable": true,
"engines": 27,
"fuel_amount_tons": 1155,
"burn_time_sec": 162
},
"second_stage": {
"thrust": {
"kN": 934,
"lbf": 210000
},
"payloads": {
"composite_fairing": {
"height": {
"meters": 13.1,
"feet": 43
},
"diameter": {
"meters": 5.2,
"feet": 17.1
}
},
"option_1": "dragon"
},
"reusable": false,
"engines": 1,
"fuel_amount_tons": 90,
"burn_time_sec": 397
},
"engines": {
"isp": {
"sea_level": 288,
"vacuum": 312
},
"thrust_sea_level": {
"kN": 845,
"lbf": 190000
},
"thrust_vacuum": {
"kN": 914,
"lbf": 205500
},
"number": 27,
"type": "merlin",
"version": "1D+",
"layout": "octaweb",
"engine_loss_max": 6,
"propellant_1": "liquid oxygen",
"propellant_2": "RP-1 kerosene",
"thrust_to_weight": 180.1
},
"landing_legs": {
"number": 12,
"material": "carbon fiber"
},
"payload_weights": [
{
"id": "leo",
"name": "Low Earth Orbit",
"kg": 63800,
"lb": 140660
},
{
"id": "gto",
"name": "Geosynchronous Transfer Orbit",
"kg": 26700,
"lb": 58860
},
{
"id": "mars",
"name": "Mars Orbit",
"kg": 16800,
"lb": 37040
},
{
"id": "pluto",
"name": "Pluto Orbit",
"kg": 3500,
"lb": 7720
}
],
"flickr_images": [
"https://farm5.staticflickr.com/4599/38583829295_581f34dd84_b.jpg",
"https://farm5.staticflickr.com/4645/38583830575_3f0f7215e6_b.jpg",
"https://farm5.staticflickr.com/4696/40126460511_b15bf84c85_b.jpg",
"https://farm5.staticflickr.com/4711/40126461411_aabc643fd8_b.jpg"
],
"name": "Falcon Heavy",
"type": "rocket",
"active": true,
"stages": 2,
"boosters": 2,
"cost_per_launch": 90000000,
"success_rate_pct": 100,
"first_flight": "2018-02-06",
"country": "United States",
"company": "SpaceX",
"wikipedia": "https://en.wikipedia.org/wiki/Falcon_Heavy",
"description": "With the ability to lift into orbit over 54 metric tons (119,000 lb)--a mass equivalent to a 737 jetliner loaded with passengers, crew, luggage and fuel--Falcon Heavy can lift more than twice the payload of the next closest operational vehicle, the Delta IV Heavy, at one-third the cost.",
"id": "5e9d0d95eda69974db09d1ed"
},
...
]
```
================================================
FILE: docs/rockets/v4/one.md
================================================
# Get one rocket
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/rockets/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the rocket
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"height": {
"meters": 70,
"feet": 229.6
},
"diameter": {
"meters": 12.2,
"feet": 39.9
},
"mass": {
"kg": 1420788,
"lb": 3125735
},
"first_stage": {
"thrust_sea_level": {
"kN": 22819,
"lbf": 5130000
},
"thrust_vacuum": {
"kN": 24681,
"lbf": 5548500
},
"reusable": true,
"engines": 27,
"fuel_amount_tons": 1155,
"burn_time_sec": 162
},
"second_stage": {
"thrust": {
"kN": 934,
"lbf": 210000
},
"payloads": {
"composite_fairing": {
"height": {
"meters": 13.1,
"feet": 43
},
"diameter": {
"meters": 5.2,
"feet": 17.1
}
},
"option_1": "dragon"
},
"reusable": false,
"engines": 1,
"fuel_amount_tons": 90,
"burn_time_sec": 397
},
"engines": {
"isp": {
"sea_level": 288,
"vacuum": 312
},
"thrust_sea_level": {
"kN": 845,
"lbf": 190000
},
"thrust_vacuum": {
"kN": 914,
"lbf": 205500
},
"number": 27,
"type": "merlin",
"version": "1D+",
"layout": "octaweb",
"engine_loss_max": 6,
"propellant_1": "liquid oxygen",
"propellant_2": "RP-1 kerosene",
"thrust_to_weight": 180.1
},
"landing_legs": {
"number": 12,
"material": "carbon fiber"
},
"payload_weights": [
{
"id": "leo",
"name": "Low Earth Orbit",
"kg": 63800,
"lb": 140660
},
{
"id": "gto",
"name": "Geosynchronous Transfer Orbit",
"kg": 26700,
"lb": 58860
},
{
"id": "mars",
"name": "Mars Orbit",
"kg": 16800,
"lb": 37040
},
{
"id": "pluto",
"name": "Pluto Orbit",
"kg": 3500,
"lb": 7720
}
],
"flickr_images": [
"https://farm5.staticflickr.com/4599/38583829295_581f34dd84_b.jpg",
"https://farm5.staticflickr.com/4645/38583830575_3f0f7215e6_b.jpg",
"https://farm5.staticflickr.com/4696/40126460511_b15bf84c85_b.jpg",
"https://farm5.staticflickr.com/4711/40126461411_aabc643fd8_b.jpg"
],
"name": "Falcon Heavy",
"type": "rocket",
"active": true,
"stages": 2,
"boosters": 2,
"cost_per_launch": 90000000,
"success_rate_pct": 100,
"first_flight": "2018-02-06",
"country": "United States",
"company": "SpaceX",
"wikipedia": "https://en.wikipedia.org/wiki/Falcon_Heavy",
"description": "With the ability to lift into orbit over 54 metric tons (119,000 lb)--a mass equivalent to a 737 jetliner loaded with passengers, crew, luggage and fuel--Falcon Heavy can lift more than twice the payload of the next closest operational vehicle, the Delta IV Heavy, at one-third the cost.",
"id": "5e9d0d95eda69974db09d1ed"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/rockets/v4/query.md
================================================
# Query rockets
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/rockets/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"height": {
"meters": 70,
"feet": 229.6
},
"diameter": {
"meters": 3.7,
"feet": 12
},
"mass": {
"kg": 549054,
"lb": 1207920
},
"first_stage": {
"thrust_sea_level": {
"kN": 7607,
"lbf": 1710000
},
"thrust_vacuum": {
"kN": 8227,
"lbf": 1849500
},
"reusable": true,
"engines": 9,
"fuel_amount_tons": 385,
"burn_time_sec": 162
},
"second_stage": {
"thrust": {
"kN": 934,
"lbf": 210000
},
"payloads": {
"composite_fairing": {
"height": {
"meters": 13.1,
"feet": 43
},
"diameter": {
"meters": 5.2,
"feet": 17.1
}
},
"option_1": "dragon"
},
"reusable": false,
"engines": 1,
"fuel_amount_tons": 90,
"burn_time_sec": 397
},
"engines": {
"isp": {
"sea_level": 288,
"vacuum": 312
},
"thrust_sea_level": {
"kN": 845,
"lbf": 190000
},
"thrust_vacuum": {
"kN": 914,
"lbf": 205500
},
"number": 9,
"type": "merlin",
"version": "1D+",
"layout": "octaweb",
"engine_loss_max": 2,
"propellant_1": "liquid oxygen",
"propellant_2": "RP-1 kerosene",
"thrust_to_weight": 180.1
},
"landing_legs": {
"number": 4,
"material": "carbon fiber"
},
"payload_weights": [
{
"id": "leo",
"name": "Low Earth Orbit",
"kg": 22800,
"lb": 50265
},
{
"id": "gto",
"name": "Geosynchronous Transfer Orbit",
"kg": 8300,
"lb": 18300
},
{
"id": "mars",
"name": "Mars Orbit",
"kg": 4020,
"lb": 8860
}
],
"flickr_images": [
"https://farm1.staticflickr.com/929/28787338307_3453a11a77_b.jpg",
"https://farm4.staticflickr.com/3955/32915197674_eee74d81bb_b.jpg",
"https://farm1.staticflickr.com/293/32312415025_6841e30bf1_b.jpg",
"https://farm1.staticflickr.com/623/23660653516_5b6cb301d1_b.jpg",
"https://farm6.staticflickr.com/5518/31579784413_d853331601_b.jpg",
"https://farm1.staticflickr.com/745/32394687645_a9c54a34ef_b.jpg"
],
"name": "Falcon 9",
"type": "rocket",
"active": true,
"stages": 2,
"boosters": 0,
"cost_per_launch": 50000000,
"success_rate_pct": 97,
"first_flight": "2010-06-04",
"country": "United States",
"company": "SpaceX",
"wikipedia": "https://en.wikipedia.org/wiki/Falcon_9",
"description": "Falcon 9 is a two-stage rocket designed and manufactured by SpaceX for the reliable and safe transport of satellites and the Dragon spacecraft into orbit.",
"id": "5e9d0d95eda69973a809d1ec"
},
...
],
"totalDocs": 4,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/rockets/v4/schema.md
================================================
# Rocket Schema
```json
{
"name": {
"type": "String"
},
"type": {
"type": "String"
},
"active": {
"type": "Boolean"
},
"stages": {
"type": "Number"
},
"boosters": {
"type": "Number"
},
"cost_per_launch": {
"type": "Number"
},
"success_rate_pct": {
"type": "Number"
},
"first_flight": {
"type": "String"
},
"country": {
"type": "String"
},
"company": {
"type": "String"
},
"height": {
"meters": {
"type": "Number"
},
"feet": {
"type": "Number"
}
},
"diameter": {
"meters": {
"type": "Number"
},
"feet": {
"type": "Number"
}
},
"mass": {
"kg": {
"type": "Number"
},
"lb": {
"type": "Number"
}
},
"payload_weights": {
"type": [
"Object"
]
},
"first_stage": {
"reusable": {
"type": "Boolean"
},
"engines": {
"type": "Number"
},
"fuel_amount_tons": {
"type": "Number"
},
"burn_time_sec": {
"type": "Number"
},
"thrust_sea_level": {
"kN": {
"type": "Number"
},
"lbf": {
"type": "Number"
}
},
"thrust_vacuum": {
"kN": {
"type": "Number"
},
"lbf": {
"type": "Number"
}
}
},
"second_stage": {
"reusable": {
"type": "Boolean"
},
"engines": {
"type": "Number"
},
"fuel_amount_tons": {
"type": "Number"
},
"burn_time_sec": {
"type": "Number"
},
"thrust": {
"kN": {
"type": "Number"
},
"lbf": {
"type": "Number"
}
},
"payloads": {
"option_1": {
"type": "String"
},
"composite_fairing": {
"height": {
"meters": {
"type": "Number"
},
"feet": {
"type": "Number"
}
},
"diameter": {
"meters": {
"type": "Number"
},
"feet": {
"type": "Number"
}
}
}
}
},
"engines": {
"number": {
"type": "Number"
},
"type": {
"type": "String"
},
"version": {
"type": "String"
},
"layout": {
"type": "String"
},
"isp": {
"sea_level": {
"type": "Number"
},
"vacuum": {
"type": "Number"
}
},
"engine_loss_max": {
"type": "Number"
},
"propellant_1": {
"type": "String"
},
"propellant_2": {
"type": "String"
},
"thrust_sea_level": {
"kN": {
"type": "Number"
},
"lbf": {
"type": "Number"
}
},
"thrust_vacuum": {
"kN": {
"type": "Number"
},
"lbf": {
"type": "Number"
}
},
"thrust_to_weight": {
"type": "Number"
}
},
"landing_legs": {
"number": {
"type": "Number"
},
"material": {
"type": "Object"
}
},
"flickr_images": {
"type": [
"String"
]
},
"wikipedia": {
"type": "String"
},
"description": {
"type": "String"
}
}
```
================================================
FILE: docs/ships/v4/all.md
================================================
# Get all ships
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/ships`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"legacy_id": "GOPURSUIT",
"model": null,
"type": "Cargo",
"roles": [
"Support Ship",
"Fairing Recovery"
],
"imo": 9458884,
"mmsi": 367191410,
"abs": 1201189,
"class": 7174230,
"mass_kg": 502999,
"mass_lbs": 1108925,
"year_built": 2007,
"home_port": "Port Canaveral",
"status": "",
"speed_kn": null,
"course_deg": null,
"latitude": null,
"longitude": null,
"last_ais_update": null,
"link": "https://www.marinetraffic.com/en/ais/details/ships/shipid:439594/mmsi:367191410/imo:9458884/vessel:GO_PURSUIT",
"image": "https://i.imgur.com/5w1ZWre.jpg",
"launches": [
"5eb87d18ffd86e000604b365",
"5eb87d19ffd86e000604b366",
"5eb87d1bffd86e000604b368",
"5eb87d1effd86e000604b36a"
],
"name": "GO Pursuit",
"active": false,
"id": "5ea6ed2e080df4000697c90a"
},
...
]
```
================================================
FILE: docs/ships/v4/one.md
================================================
# Get one ship
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/ships/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the ship
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"legacy_id": "GOPURSUIT",
"model": null,
"type": "Cargo",
"roles": [
"Support Ship",
"Fairing Recovery"
],
"imo": 9458884,
"mmsi": 367191410,
"abs": 1201189,
"class": 7174230,
"mass_kg": 502999,
"mass_lbs": 1108925,
"year_built": 2007,
"home_port": "Port Canaveral",
"status": "",
"speed_kn": null,
"course_deg": null,
"latitude": null,
"longitude": null,
"last_ais_update": null,
"link": "https://www.marinetraffic.com/en/ais/details/ships/shipid:439594/mmsi:367191410/imo:9458884/vessel:GO_PURSUIT",
"image": "https://i.imgur.com/5w1ZWre.jpg",
"launches": [
"5eb87d18ffd86e000604b365",
"5eb87d19ffd86e000604b366",
"5eb87d1bffd86e000604b368",
"5eb87d1effd86e000604b36a"
],
"name": "GO Pursuit",
"active": false,
"id": "5ea6ed2e080df4000697c90a"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/ships/v4/query.md
================================================
# Query ships
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/ships/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"legacy_id": "GOPURSUIT",
"model": null,
"type": "Cargo",
"roles": [
"Support Ship",
"Fairing Recovery"
],
"imo": 9458884,
"mmsi": 367191410,
"abs": 1201189,
"class": 7174230,
"mass_kg": 502999,
"mass_lbs": 1108925,
"year_built": 2007,
"home_port": "Port Canaveral",
"status": "",
"speed_kn": null,
"course_deg": null,
"latitude": null,
"longitude": null,
"last_ais_update": null,
"link": "https://www.marinetraffic.com/en/ais/details/ships/shipid:439594/mmsi:367191410/imo:9458884/vessel:GO_PURSUIT",
"image": "https://i.imgur.com/5w1ZWre.jpg",
"launches": [
"5eb87d18ffd86e000604b365",
"5eb87d19ffd86e000604b366",
"5eb87d1bffd86e000604b368",
"5eb87d1effd86e000604b36a"
],
"name": "GO Pursuit",
"active": false,
"id": "5ea6ed2e080df4000697c90a"
},
...
],
"totalDocs": 22,
"offset": 0,
"limit": 10,
"totalPages": 3,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/ships/v4/schema.md
================================================
# Ship Schema
```json
{
"name": {
"type": "String",
"unique": true,
"required": true
},
"legacy_id": {
"type": "String",
"default": null
},
"model": {
"type": "String",
"default": null
},
"type": {
"type": "String",
"default": null
},
"roles": [
"String"
],
"active": {
"type": "Boolean",
"required": true
},
"imo": {
"type": "Number",
"default": null
},
"mmsi": {
"type": "Number",
"default": null
},
"abs": {
"type": "Number",
"default": null
},
"class": {
"type": "Number",
"default": null
},
"mass_kg": {
"type": "Number",
"default": null
},
"mass_lbs": {
"type": "Number",
"default": null
},
"year_built": {
"type": "Number",
"default": null
},
"home_port": {
"type": "String",
"default": null
},
"status": {
"type": "String",
"default": null
},
"speed_kn": {
"type": "Number",
"default": null
},
"course_deg": {
"type": "Number",
"default": null
},
"latitude": {
"type": "Number",
"default": null
},
"longitude": {
"type": "Number",
"default": null
},
"last_ais_update": {
"type": "String",
"default": null
},
"link": {
"type": "String",
"default": null
},
"image": {
"type": "String",
"default": null
},
"launches": [
{
"type": "UUID"
}
]
}
```
================================================
FILE: docs/starlink/v4/all.md
================================================
# Get all Starlink satellites
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/starlink`
**Auth required** : `False`
## Success Responses
**Code** : `200 OK`
```json
[
{
"spaceTrack": {
"CCSDS_OMM_VERS": "2.0",
"COMMENT": "GENERATED VIA SPACE-TRACK.ORG API",
"CREATION_DATE": "2020-06-19 21:46:09",
"ORIGINATOR": "18 SPCS",
"OBJECT_NAME": "STARLINK-1506",
"OBJECT_ID": "2020-038T",
"CENTER_NAME": "EARTH",
"REF_FRAME": "TEME",
"TIME_SYSTEM": "UTC",
"MEAN_ELEMENT_THEORY": "SGP4",
"EPOCH": "2020-06-19 20:00:01.000224",
"MEAN_MOTION": 15.88829743,
"ECCENTRICITY": 0.0087515,
"INCLINATION": 53.002,
"RA_OF_ASC_NODE": 266.3302,
"ARG_OF_PERICENTER": 69.9474,
"MEAN_ANOMALY": 221.4733,
"EPHEMERIS_TYPE": 0,
"CLASSIFICATION_TYPE": "U",
"NORAD_CAT_ID": 45747,
"ELEMENT_SET_NO": 999,
"REV_AT_EPOCH": 212,
"BSTAR": 0.01007,
"MEAN_MOTION_DOT": 0.03503094,
"MEAN_MOTION_DDOT": 0.01265,
"SEMIMAJOR_AXIS": 6683.699,
"PERIOD": 90.632,
"APOAPSIS": 364.057,
"PERIAPSIS": 247.072,
"OBJECT_TYPE": "PAYLOAD",
"RCS_SIZE": null,
"COUNTRY_CODE": "US",
"LAUNCH_DATE": "2020-06-13",
"SITE": "AFETR",
"DECAY_DATE": null,
"DECAYED": 0,
"FILE": 2768947,
"GP_ID": 155985688,
"TLE_LINE0": "0 STARLINK-1506",
"TLE_LINE1": "1 45747U 20038T 20171.83334491 .03503094 12654-1 10068-1 0 9995",
"TLE_LINE2": "2 45747 53.0017 266.3302 0087515 69.9474 221.4733 15.88829743 2124"
},
"version": "v1.0",
"launch": "5eb87d46ffd86e000604b389",
"longitude": 165.93047730624068,
"latitude": -52.91311434465077,
"height_km": 446.61936740361125,
"velocity_kms": 7.643507427834188,
"id": "5eed7716096e590006985825"
}
...
]
```
================================================
FILE: docs/starlink/v4/one.md
================================================
# Get one Starlink satellite
**Method** : `GET`
**URL** : `https://api.spacexdata.com/v4/starlink/:id`
**URL Parameters** : `id=[string]` where `id` is the ID of the Starlink sat
**Auth required** : `False`
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"spaceTrack": {
"CCSDS_OMM_VERS": "2.0",
"COMMENT": "GENERATED VIA SPACE-TRACK.ORG API",
"CREATION_DATE": "2020-06-19 21:46:09",
"ORIGINATOR": "18 SPCS",
"OBJECT_NAME": "STARLINK-1506",
"OBJECT_ID": "2020-038T",
"CENTER_NAME": "EARTH",
"REF_FRAME": "TEME",
"TIME_SYSTEM": "UTC",
"MEAN_ELEMENT_THEORY": "SGP4",
"EPOCH": "2020-06-19 20:00:01.000224",
"MEAN_MOTION": 15.88829743,
"ECCENTRICITY": 0.0087515,
"INCLINATION": 53.002,
"RA_OF_ASC_NODE": 266.3302,
"ARG_OF_PERICENTER": 69.9474,
"MEAN_ANOMALY": 221.4733,
"EPHEMERIS_TYPE": 0,
"CLASSIFICATION_TYPE": "U",
"NORAD_CAT_ID": 45747,
"ELEMENT_SET_NO": 999,
"REV_AT_EPOCH": 212,
"BSTAR": 0.01007,
"MEAN_MOTION_DOT": 0.03503094,
"MEAN_MOTION_DDOT": 0.01265,
"SEMIMAJOR_AXIS": 6683.699,
"PERIOD": 90.632,
"APOAPSIS": 364.057,
"PERIAPSIS": 247.072,
"OBJECT_TYPE": "PAYLOAD",
"RCS_SIZE": null,
"COUNTRY_CODE": "US",
"LAUNCH_DATE": "2020-06-13",
"SITE": "AFETR",
"DECAY_DATE": null,
"DECAYED": 0,
"FILE": 2768947,
"GP_ID": 155985688,
"TLE_LINE0": "0 STARLINK-1506",
"TLE_LINE1": "1 45747U 20038T 20171.83334491 .03503094 12654-1 10068-1 0 9995",
"TLE_LINE2": "2 45747 53.0017 266.3302 0087515 69.9474 221.4733 15.88829743 2124"
},
"version": "v1.0",
"launch": "5eb87d46ffd86e000604b389",
"longitude": 165.93047730624068,
"latitude": -52.91311434465077,
"height_km": 446.61936740361125,
"velocity_kms": 7.643507427834188,
"id": "5eed7716096e590006985825"
}
```
## Error Responses
**Code** : `404 NOT FOUND`
**Content** : `Not Found`
================================================
FILE: docs/starlink/v4/query.md
================================================
# Query Starlink satellites
**Method** : `POST`
**URL** : `https://api.spacexdata.com/v4/starlink/query`
**Auth required** : `False`
**Body** :
See [query](../../queries.md) guide for more details on building queries and paginating results.
```json
{
"query": {},
"options": {}
}
```
## Success Response
**Code** : `200 OK`
**Content example** :
```json
{
"docs": [
{
"spaceTrack": {
"CCSDS_OMM_VERS": "2.0",
"COMMENT": "GENERATED VIA SPACE-TRACK.ORG API",
"CREATION_DATE": "2020-06-19 21:36:08",
"ORIGINATOR": "18 SPCS",
"OBJECT_NAME": "STARLINK-30",
"OBJECT_ID": "2019-029K",
"CENTER_NAME": "EARTH",
"REF_FRAME": "TEME",
"TIME_SYSTEM": "UTC",
"MEAN_ELEMENT_THEORY": "SGP4",
"EPOCH": "2020-06-19 20:00:01.000224",
"MEAN_MOTION": 15.43862877,
"ECCENTRICITY": 0.000125,
"INCLINATION": 52.996,
"RA_OF_ASC_NODE": 195.8544,
"ARG_OF_PERICENTER": 108.6906,
"MEAN_ANOMALY": 109.3199,
"EPHEMERIS_TYPE": 0,
"CLASSIFICATION_TYPE": "U",
"NORAD_CAT_ID": 44244,
"ELEMENT_SET_NO": 999,
"REV_AT_EPOCH": 5947,
"BSTAR": 0.00007,
"MEAN_MOTION_DOT": 0.00002829,
"MEAN_MOTION_DDOT": 0,
"SEMIMAJOR_AXIS": 6812.858,
"PERIOD": 93.272,
"APOAPSIS": 435.574,
"PERIAPSIS": 433.871,
"OBJECT_TYPE": "PAYLOAD",
"RCS_SIZE": "LARGE",
"COUNTRY_CODE": "US",
"LAUNCH_DATE": "2019-05-24",
"SITE": "AFETR",
"DECAY_DATE": null,
"DECAYED": 0,
"FILE": 2768931,
"GP_ID": 155985469,
"TLE_LINE0": "0 STARLINK-30",
"TLE_LINE1": "1 44244U 19029K 20171.83334491 .00002829 00000-0 70479-4 0 9997",
"TLE_LINE2": "2 44244 52.9964 195.8544 0001250 108.6906 109.3199 15.43862877 59477"
},
"version": "v0.9",
"launch": "5eb87d30ffd86e000604b378",
"longitude": 10.551678198548517,
"latitude": 8.26018124742001,
"height_km": 434.5577668080887,
"velocity_kms": 7.653046786650296,
"id": "5eed770f096e59000698560d"
},
...
],
"totalDocs": 537,
"offset": 0,
"limit": 10,
"totalPages": 54,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}
```
## Error Responses
**Code** : `400 Bad Request`
**Content** : Mongoose error is shown, with suggestions to fix the query.
================================================
FILE: docs/starlink/v4/schema.md
================================================
# Starlink Schema
```json
{
"version": {
"type": "String",
"default": null
},
"launch": {
"type": "UUID",
"ref": "Launch",
"default": null
},
"longitude": {
"type": "Number",
"default": null,
},
"latitude": {
"type": "Number",
"default": null,
},
"height_km": {
"type": "Number",
"default": null,
},
"velocity_kms": {
"type": "Number",
"default": null,
},
"spaceTrack": {
"CCSDS_OMM_VERS": {
"type": "String",
"default": null
},
"COMMENT": {
"type": "String",
"default": null
},
"CREATION_DATE": {
"type": "String",
"default": null
},
"ORIGINATOR": {
"type": "String",
"default": null
},
"OBJECT_NAME": {
"type": "String",
"default": null
},
"OBJECT_ID": {
"type": "String",
"default": null
},
"CENTER_NAME": {
"type": "String",
"default": null
},
"REF_FRAME": {
"type": "String",
"default": null
},
"TIME_SYSTEM": {
"type": "String",
"default": null
},
"MEAN_ELEMENT_THEORY": {
"type": "String",
"default": null
},
"EPOCH": {
"type": "String",
"default": null
},
"MEAN_MOTION": {
"type": "Number",
"default": null
},
"ECCENTRICITY": {
"type": "Number",
"default": null
},
"INCLINATION": {
"type": "Number",
"default": null
},
"RA_OF_ASC_NODE": {
"type": "Number",
"default": null
},
"ARG_OF_PERICENTER": {
"type": "Number",
"default": null
},
"MEAN_ANOMALY": {
"type": "Number",
"default": null
},
"EPHEMERIS_TYPE": {
"type": "Number",
"default": null
},
"CLASSIFICATION_TYPE": {
"type": "String",
"default": null
},
"NORAD_CAT_ID": {
"type": "Number",
"default": null
},
"ELEMENT_SET_NO": {
"type": "Number",
"default": null
},
"REV_AT_EPOCH": {
"type": "Number",
"default": null
},
"BSTAR": {
"type": "Number",
"default": null
},
"MEAN_MOTION_DOT": {
"type": "Number",
"default": null
},
"MEAN_MOTION_DDOT": {
"type": "Number",
"default": null
},
"SEMIMAJOR_AXIS": {
"type": "Number",
"default": null
},
"PERIOD": {
"type": "Number",
"default": null
},
"APOAPSIS": {
"type": "Number",
"default": null
},
"PERIAPSIS": {
"type": "Number",
"default": null
},
"OBJECT_TYPE": {
"type": "String",
"default": null
},
"RCS_SIZE": {
"type": "String",
"default": null
},
"COUNTRY_CODE": {
"type": "String",
"default": null
},
"LAUNCH_DATE": {
"type": "String",
"default": null
},
"SITE": {
"type": "String",
"default": null
},
"DECAY_DATE": {
"type": "String",
"default": null
},
"DECAYED": {
"type": "Number",
"default": null
},
"FILE": {
"type": "Number",
"default": null
},
"GP_ID": {
"type": "Number",
"default": null
},
"TLE_LINE0": {
"type": "String",
"default": null
},
"TLE_LINE1": {
"type": "String",
"default": null
},
"TLE_LINE2": {
"type": "String",
"default": null
}
}
}
```
================================================
FILE: jobs/capsules.js
================================================
import got from 'got';
import { load } from 'cheerio';
import { logger } from '../middleware/index.js';
const API = process.env.SPACEX_API;
const KEY = process.env.SPACEX_KEY;
const HEALTHCHECK = process.env.CAPSULES_HEALTHCHECK;
const REDDIT_CAPSULES = 'https://old.reddit.com/r/spacex/wiki/capsules';
/**
* Update capsule landings/reuse count
*
gitextract_mkb_w92a/
├── .dockerignore
├── .eslintrc.json
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── codeql-analysis.yml
│ └── deploy.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── app.js
├── docs/
│ ├── README.md
│ ├── apps.md
│ ├── capsules/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── clients.md
│ ├── company/
│ │ └── v4/
│ │ ├── all.md
│ │ └── schema.md
│ ├── cores/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── crew/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── dragons/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── history/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── landpads/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── launches/
│ │ ├── v4/
│ │ │ ├── all.md
│ │ │ ├── latest.md
│ │ │ ├── next.md
│ │ │ ├── one.md
│ │ │ ├── past.md
│ │ │ ├── query.md
│ │ │ ├── schema.md
│ │ │ └── upcoming.md
│ │ └── v5/
│ │ ├── README.md
│ │ ├── all.md
│ │ ├── latest.md
│ │ ├── next.md
│ │ ├── one.md
│ │ ├── past.md
│ │ ├── query.md
│ │ ├── schema.md
│ │ └── upcoming.md
│ ├── launchpads/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── payloads/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── queries.md
│ ├── roadster/
│ │ └── v4/
│ │ ├── get.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── rockets/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ ├── ships/
│ │ └── v4/
│ │ ├── all.md
│ │ ├── one.md
│ │ ├── query.md
│ │ └── schema.md
│ └── starlink/
│ └── v4/
│ ├── all.md
│ ├── one.md
│ ├── query.md
│ └── schema.md
├── jobs/
│ ├── capsules.js
│ ├── cores.js
│ ├── landpads.js
│ ├── launch-library.js
│ ├── launches.js
│ ├── launchpads.js
│ ├── payloads.js
│ ├── roadster.js
│ ├── starlink.js
│ ├── upcoming.js
│ ├── webcast.js
│ └── worker.js
├── lib/
│ ├── constants.js
│ ├── healthchecks/
│ │ ├── fail.js
│ │ ├── index.js
│ │ ├── start.js
│ │ └── success.js
│ └── utils/
│ └── healthcheck.js
├── middleware/
│ ├── auth.js
│ ├── authz.js
│ ├── cache.js
│ ├── errors.js
│ ├── index.js
│ ├── logger.js
│ └── response-time.js
├── models/
│ ├── capsules.js
│ ├── company.js
│ ├── cores.js
│ ├── crew.js
│ ├── dragons.js
│ ├── history.js
│ ├── index.js
│ ├── landpads.js
│ ├── launches.js
│ ├── launchpads.js
│ ├── payloads.js
│ ├── roadster.js
│ ├── rockets.js
│ ├── ships.js
│ ├── starlink.js
│ └── users.js
├── package.json
├── routes/
│ ├── admin/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── capsules/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── company/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── cores/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── crew/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── dragons/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── history/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── index.js
│ ├── landpads/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── launches/
│ │ ├── index.js
│ │ ├── v4/
│ │ │ ├── _transform-query.js
│ │ │ ├── _transform-response.js
│ │ │ └── index.js
│ │ └── v5/
│ │ └── index.js
│ ├── launchpads/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── payloads/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── roadster/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── rockets/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── ships/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ ├── starlink/
│ │ ├── index.js
│ │ └── v4/
│ │ └── index.js
│ └── users/
│ ├── index.js
│ └── v4/
│ └── index.js
├── server.js
├── start.sh
└── tests/
└── index.test.js
SYMBOL INDEX (39 symbols across 14 files) FILE: jobs/capsules.js constant API (line 5) | const API = process.env.SPACEX_API; constant KEY (line 6) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 7) | const HEALTHCHECK = process.env.CAPSULES_HEALTHCHECK; constant REDDIT_CAPSULES (line 8) | const REDDIT_CAPSULES = 'https://old.reddit.com/r/spacex/wiki/capsules'; FILE: jobs/cores.js constant REDDIT_CORES (line 5) | const REDDIT_CORES = 'https://old.reddit.com/r/spacex/wiki/cores'; constant API (line 6) | const API = process.env.SPACEX_API; constant KEY (line 7) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 8) | const HEALTHCHECK = process.env.CORES_HEALTHCHECK; FILE: jobs/landpads.js constant API (line 4) | const API = process.env.SPACEX_API; constant KEY (line 5) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 6) | const HEALTHCHECK = process.env.LANDPADS_HEALTHCHECK; FILE: jobs/launch-library.js constant LAUNCH_LIBRARY_API (line 11) | const LAUNCH_LIBRARY_API = 'https://ll.thespacedevs.com/2.2.0/launch/upc... FILE: jobs/launches.js constant API (line 5) | const API = process.env.SPACEX_API; constant KEY (line 6) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 7) | const HEALTHCHECK = process.env.LAUNCHES_HEALTHCHECK; FILE: jobs/launchpads.js constant API (line 4) | const API = process.env.SPACEX_API; constant KEY (line 5) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 6) | const HEALTHCHECK = process.env.LAUNCHPADS_HEALTHCHECK; FILE: jobs/payloads.js constant API (line 5) | const API = process.env.SPACEX_API; constant KEY (line 6) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 7) | const HEALTHCHECK = process.env.PAYLOADS_HEALTHCHECK; FILE: jobs/roadster.js constant API (line 5) | const API = process.env.SPACEX_API; constant KEY (line 6) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 7) | const HEALTHCHECK = process.env.ROADSTER_HEALTHCHECK; FILE: jobs/starlink.js constant API (line 8) | const API = process.env.SPACEX_API; constant KEY (line 9) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 10) | const HEALTHCHECK = process.env.STARLINK_HEALTHCHECK; FILE: jobs/upcoming.js constant REDDIT_WIKI (line 10) | const REDDIT_WIKI = 'https://old.reddit.com/r/spacex/wiki/launches/manif... constant API (line 11) | const API = process.env.SPACEX_API; constant KEY (line 12) | const KEY = process.env.SPACEX_KEY; constant HEALTHCHECK (line 13) | const HEALTHCHECK = process.env.UPCOMING_HEALTHCHECK; FILE: jobs/webcast.js constant YOUTUBE_PREFIX (line 7) | const YOUTUBE_PREFIX = 'https://youtu.be'; constant CHANNEL_ID (line 8) | const CHANNEL_ID = 'UCtI0Hodo5o5dUb67FeUjDeA'; FILE: lib/constants.js constant HEALTHCHECK_PREFIX (line 4) | const HEALTHCHECK_PREFIX = 'https://hc-ping.com'; constant DEFAULT_PORT (line 9) | const DEFAULT_PORT = 6673; FILE: routes/index.js constant FOLDERS (line 4) | const FOLDERS = await Promise.all([ constant ROUTER (line 23) | const ROUTER = new Router(); FILE: server.js constant PORT (line 7) | const PORT = process.env.PORT ?? DEFAULT_PORT; constant SERVER (line 8) | const SERVER = http.createServer(app.callback());
Condensed preview — 161 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (341K chars).
[
{
"path": ".dockerignore",
"chars": 107,
"preview": ".git\nnode_modules\nnpm-debug.log\n*.md\ntest\ndocs\nDockerfile\ncoverage\nLICENSE\n.eslintrc\n.gitignore\n.nvmrc\n.env"
},
{
"path": ".eslintrc.json",
"chars": 547,
"preview": "{\n \"env\": {\n \"node\": true,\n \"es2022\": true,\n \"jest\": true\n },\n \"extends\": [\"airbnb-base\"],\n \"parser\": \"@typ"
},
{
"path": ".github/dependabot.yml",
"chars": 294,
"preview": "version: 2\nupdates:\n- package-ecosystem: npm\n directory: \"/\"\n schedule:\n interval: weekly\n day: saturday\n open-"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 1665,
"preview": "name: \"CodeQL\"\n\non:\n push:\n branches: [master, ]\n pull_request:\n # The branches below must be a subset of the br"
},
{
"path": ".github/workflows/deploy.yml",
"chars": 1741,
"preview": "name: Deploy\n\non:\n push:\n # Publish `master` as Docker `latest` image.\n branches:\n - master\n\n # Publish `"
},
{
"path": ".gitignore",
"chars": 1360,
"preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directo"
},
{
"path": "Dockerfile",
"chars": 595,
"preview": "\nFROM node:18-alpine\n\nLABEL maintainer=\"jakewmeyer@gmail.com\"\nLABEL autoheal=\"true\"\n\nHEALTHCHECK --interval=10s --timeou"
},
{
"path": "LICENSE",
"chars": 11343,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 7208,
"preview": "<p align=\"center\"><img src=\"https://live.staticflickr.com/65535/49185149122_37f5c52e43_k.jpg\"></p>\n\n<h1 align=\"center\">S"
},
{
"path": "app.js",
"chars": 1388,
"preview": "import conditional from 'koa-conditional-get';\nimport etag from 'koa-etag';\nimport cors from 'koa2-cors';\nimport dotenv "
},
{
"path": "docs/README.md",
"chars": 3724,
"preview": "# r/SpaceX API Docs\n\n[](https://app.getpostman.com/run-collection/ed4e"
},
{
"path": "docs/apps.md",
"chars": 11057,
"preview": "# List of known Apps / UI clients\n\n> _Do you, or do you know of some app, that makes use of this community maintained se"
},
{
"path": "docs/capsules/v4/all.md",
"chars": 545,
"preview": "# Get all capsules\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/capsules`\n\n**Auth required** : `False`\n"
},
{
"path": "docs/capsules/v4/one.md",
"chars": 652,
"preview": "# Get one capsule\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/capsules/:id`\n\n**URL Parameters** : `id="
},
{
"path": "docs/capsules/v4/query.md",
"chars": 1138,
"preview": "# Query capsules\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/capsules/query`\n\n**Auth required** : `Fa"
},
{
"path": "docs/capsules/v4/schema.md",
"chars": 702,
"preview": "# Capsule Schema\n\n```json\n{\n \"serial\": {\n \"type\": \"String\",\n \"required\": true,\n \"unique\": true,\n },\n \"status"
},
{
"path": "docs/clients.md",
"chars": 3491,
"preview": "# List of known API clients / wrappers\n\n> _Do you, or do you know of some client/wrapper, that makes use of this communi"
},
{
"path": "docs/company/v4/all.md",
"chars": 1103,
"preview": "# Get all company info\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/company`\n\n**Auth required** : `Fals"
},
{
"path": "docs/company/v4/schema.md",
"chars": 945,
"preview": "# Company Info Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\"\n },\n \"founder\": {\n \"type\": \"String\"\n },\n \"found"
},
{
"path": "docs/cores/v4/all.md",
"chars": 705,
"preview": "# Get all cores\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/cores`\n\n**Auth required** : `False`\n\n## Su"
},
{
"path": "docs/cores/v4/one.md",
"chars": 789,
"preview": "# Get one core\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/cores/:id`\n\n**URL Parameters** : `id=[strin"
},
{
"path": "docs/cores/v4/query.md",
"chars": 1303,
"preview": "# Query cores\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/cores/query`\n\n**Auth required** : `False`\n\n"
},
{
"path": "docs/cores/v4/schema.md",
"chars": 754,
"preview": "# Core Schema\n\n```json\n{\n \"serial\": {\n \"type\": \"String\",\n \"unique\": true,\n \"required\": true,\n },\n \"block\": {"
},
{
"path": "docs/crew/v4/all.md",
"chars": 516,
"preview": "# Get all crew\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/crew`\n\n**Auth required** : `False`\n\n## Succ"
},
{
"path": "docs/crew/v4/one.md",
"chars": 645,
"preview": "# Get one crew member\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/crew/:id`\n\n**URL Parameters** : `id="
},
{
"path": "docs/crew/v4/query.md",
"chars": 1112,
"preview": "# Query crew members\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/crew/query`\n\n**Auth required** : `Fa"
},
{
"path": "docs/crew/v4/schema.md",
"chars": 438,
"preview": "# Crew Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\",\n \"default\": null\n },\n \"status\": {\n \"type\": \"String\",\n"
},
{
"path": "docs/dragons/v4/all.md",
"chars": 2834,
"preview": "# Get all Dragons\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/dragons`\n\n**Auth required** : `False`\n\n#"
},
{
"path": "docs/dragons/v4/one.md",
"chars": 2834,
"preview": "# Get one Dragon\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/dragons/:id`\n\n**URL Parameters** : `id=[s"
},
{
"path": "docs/dragons/v4/query.md",
"chars": 3860,
"preview": "# Query Dragons\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/dragons/query`\n\n**Auth required** : `Fals"
},
{
"path": "docs/dragons/v4/schema.md",
"chars": 2315,
"preview": "# Dragon Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\",\n \"unique\": true,\n \"required\": true\n },\n \"type\": {\n "
},
{
"path": "docs/history/v4/all.md",
"chars": 694,
"preview": "# Get all history events\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/history`\n\n**Auth required** : `Fa"
},
{
"path": "docs/history/v4/one.md",
"chars": 860,
"preview": "# Get one history event\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/history/:id`\n\n**URL Parameters** :"
},
{
"path": "docs/history/v4/query.md",
"chars": 1310,
"preview": "# Query history events\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/history/query`\n\n**Auth required** "
},
{
"path": "docs/history/v4/schema.md",
"chars": 394,
"preview": "# History Event Schema\n\n```json\n{\n \"title\": {\n \"type\": \"String\",\n \"default\": null,\n },\n \"event_date_utc\": {\n "
},
{
"path": "docs/landpads/v4/all.md",
"chars": 1184,
"preview": "# Get all landing pads\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/landpads`\n\n**Auth required** : `Fal"
},
{
"path": "docs/landpads/v4/one.md",
"chars": 1267,
"preview": "# Get one landing pad\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/landpads/:id`\n\n**URL Parameters** : "
},
{
"path": "docs/landpads/v4/query.md",
"chars": 2338,
"preview": "# Query landing pads\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/landpads/query`\n\n**Auth required** :"
},
{
"path": "docs/landpads/v4/schema.md",
"chars": 979,
"preview": "# Landing Pad Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\",\n \"default\": null\n },\n \"full_name\": {\n \"type\": "
},
{
"path": "docs/launches/v4/all.md",
"chars": 3715,
"preview": "# Get all launches\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launches`\n\n**Auth required** : `False`\n"
},
{
"path": "docs/launches/v4/latest.md",
"chars": 3430,
"preview": "# Get latest launch\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launches/latest`\n\n**Auth required** : "
},
{
"path": "docs/launches/v4/next.md",
"chars": 3426,
"preview": "# Get next launch\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launches/next`\n\n**Auth required** : `Fal"
},
{
"path": "docs/launches/v4/one.md",
"chars": 3592,
"preview": "# Get one launch\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launches/:id`\n\n**URL Parameters** : `id=["
},
{
"path": "docs/launches/v4/past.md",
"chars": 3724,
"preview": "# Get all past launches\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launches/past`\n\n**Auth required** "
},
{
"path": "docs/launches/v4/query.md",
"chars": 3941,
"preview": "# Query launches\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/launches/query`\n\n**Auth required** : `Fa"
},
{
"path": "docs/launches/v4/schema.md",
"chars": 3591,
"preview": "# Launch Schema\n\n```json\n{\n \"flight_number\": {\n \"type\": \"Number\",\n \"required\": true\n },\n \"name\": {\n \"type\": "
},
{
"path": "docs/launches/v4/upcoming.md",
"chars": 3732,
"preview": "# Get all upcoming launches\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launches/upcoming`\n\n**Auth req"
},
{
"path": "docs/launches/v5/README.md",
"chars": 327,
"preview": "## Changes from v4 -> v5\n\n* Crew is now an array of objects, to allow for more data on an individual launch for a crew m"
},
{
"path": "docs/launches/v5/all.md",
"chars": 3715,
"preview": "# Get all launches\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v5/launches`\n\n**Auth required** : `False`\n"
},
{
"path": "docs/launches/v5/latest.md",
"chars": 3430,
"preview": "# Get latest launch\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v5/launches/latest`\n\n**Auth required** : "
},
{
"path": "docs/launches/v5/next.md",
"chars": 3426,
"preview": "# Get next launch\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v5/launches/next`\n\n**Auth required** : `Fal"
},
{
"path": "docs/launches/v5/one.md",
"chars": 3592,
"preview": "# Get one launch\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v5/launches/:id`\n\n**URL Parameters** : `id=["
},
{
"path": "docs/launches/v5/past.md",
"chars": 3724,
"preview": "# Get all past launches\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v5/launches/past`\n\n**Auth required** "
},
{
"path": "docs/launches/v5/query.md",
"chars": 3941,
"preview": "# Query launches\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v5/launches/query`\n\n**Auth required** : `Fa"
},
{
"path": "docs/launches/v5/schema.md",
"chars": 3740,
"preview": "# Launch Schema\n\n```json\n{\n \"flight_number\": {\n \"type\": \"Number\",\n \"required\": true\n },\n \"name\": {\n \"type\": "
},
{
"path": "docs/launches/v5/upcoming.md",
"chars": 3732,
"preview": "# Get all upcoming launches\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v5/launches/upcoming`\n\n**Auth req"
},
{
"path": "docs/launchpads/v4/all.md",
"chars": 1334,
"preview": "# Get all launchpads\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launchpads`\n\n**Auth required** : `Fal"
},
{
"path": "docs/launchpads/v4/one.md",
"chars": 1363,
"preview": "# Get one launchpad\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/launchpads/:id`\n\n**URL Parameters** : "
},
{
"path": "docs/launchpads/v4/query.md",
"chars": 1918,
"preview": "# Query launchpads\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/launchpads/query`\n\n**Auth required** :"
},
{
"path": "docs/launchpads/v4/schema.md",
"chars": 862,
"preview": "# Launchpad Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\",\n \"default\": null\n },\n \"full_name\": {\n \"type\": \"S"
},
{
"path": "docs/payloads/v4/all.md",
"chars": 1485,
"preview": "# Get all payloads\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/payloads`\n\n**Auth required** : `False`\n"
},
{
"path": "docs/payloads/v4/one.md",
"chars": 1456,
"preview": "# Get one payload\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/payloads/:id`\n\n**URL Parameters** : `id="
},
{
"path": "docs/payloads/v4/query.md",
"chars": 1885,
"preview": "# Query payloads\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/payloads/query`\n\n**Auth required** : `Fa"
},
{
"path": "docs/payloads/v4/schema.md",
"chars": 2170,
"preview": "# Payload Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\",\n \"default\": null,\n \"unique\": true\n },\n \"type\": {\n "
},
{
"path": "docs/queries.md",
"chars": 5520,
"preview": "# Query + Pagination Guide\n\nAll `/query` routes support pagination parameters via [mongoose-paginate](https://github.com"
},
{
"path": "docs/roadster/v4/get.md",
"chars": 1947,
"preview": "# Get roadster info\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/roadster`\n\n**Auth required** : `False`"
},
{
"path": "docs/roadster/v4/query.md",
"chars": 2510,
"preview": "# Query roadster\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/roadster/query`\n\n**Auth required** : `Fa"
},
{
"path": "docs/roadster/v4/schema.md",
"chars": 1215,
"preview": "# Roadster Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\"\n },\n \"launch_date_utc\": {\n \"type\": \"String\"\n },\n \"l"
},
{
"path": "docs/rockets/v4/all.md",
"chars": 3200,
"preview": "# Get all rockets\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/rockets`\n\n**Auth required** : `False`\n\n#"
},
{
"path": "docs/rockets/v4/one.md",
"chars": 3358,
"preview": "# Get one rocket\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/rockets/:id`\n\n**URL Parameters** : `id=[s"
},
{
"path": "docs/rockets/v4/query.md",
"chars": 3832,
"preview": "# Query rockets\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/rockets/query`\n\n**Auth required** : `Fals"
},
{
"path": "docs/rockets/v4/schema.md",
"chars": 3164,
"preview": "# Rocket Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\"\n },\n \"type\": {\n \"type\": \"String\"\n },\n \"active\": {\n "
},
{
"path": "docs/ships/v4/all.md",
"chars": 1075,
"preview": "# Get all ships\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/ships`\n\n**Auth required** : `False`\n\n## Su"
},
{
"path": "docs/ships/v4/one.md",
"chars": 1241,
"preview": "# Get one ship\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/ships/:id`\n\n**URL Parameters** : `id=[strin"
},
{
"path": "docs/ships/v4/query.md",
"chars": 1658,
"preview": "# Query ships\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/ships/query`\n\n**Auth required** : `False`\n\n"
},
{
"path": "docs/ships/v4/schema.md",
"chars": 1435,
"preview": "# Ship Schema\n\n```json\n{\n \"name\": {\n \"type\": \"String\",\n \"unique\": true,\n \"required\": true\n },\n \"legacy_id\": "
},
{
"path": "docs/starlink/v4/all.md",
"chars": 1991,
"preview": "# Get all Starlink satellites\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/starlink`\n\n**Auth required**"
},
{
"path": "docs/starlink/v4/one.md",
"chars": 2038,
"preview": "# Get one Starlink satellite\n\n**Method** : `GET`\n\n**URL** : `https://api.spacexdata.com/v4/starlink/:id`\n\n**URL Paramete"
},
{
"path": "docs/starlink/v4/query.md",
"chars": 2636,
"preview": "# Query Starlink satellites\n\n**Method** : `POST`\n\n**URL** : `https://api.spacexdata.com/v4/starlink/query`\n\n**Auth requi"
},
{
"path": "docs/starlink/v4/schema.md",
"chars": 4382,
"preview": "# Starlink Schema\n\n```json\n{\n \"version\": {\n \"type\": \"String\",\n \"default\": null\n },\n \"launch\": {\n "
},
{
"path": "jobs/capsules.js",
"chars": 3254,
"preview": "import got from 'got';\nimport { load } from 'cheerio';\nimport { logger } from '../middleware/index.js';\n\nconst API = pro"
},
{
"path": "jobs/cores.js",
"chars": 6969,
"preview": "import got from 'got';\nimport { load } from 'cheerio';\nimport { logger } from '../middleware/index.js';\n\nconst REDDIT_CO"
},
{
"path": "jobs/landpads.js",
"chars": 2133,
"preview": "import got from 'got';\nimport { logger } from '../middleware/index.js';\n\nconst API = process.env.SPACEX_API;\nconst KEY ="
},
{
"path": "jobs/launch-library.js",
"chars": 2446,
"preview": "import got from 'got';\nimport moment from 'moment-timezone';\nimport { fail, success } from '../lib/healthchecks/index.js"
},
{
"path": "jobs/launches.js",
"chars": 6864,
"preview": "import _ from 'lodash';\nimport got from 'got';\nimport { logger } from '../middleware/index.js';\n\nconst API = process.env"
},
{
"path": "jobs/launchpads.js",
"chars": 1821,
"preview": "import got from 'got';\nimport { logger } from '../middleware/index.js';\n\nconst API = process.env.SPACEX_API;\nconst KEY ="
},
{
"path": "jobs/payloads.js",
"chars": 2499,
"preview": "import got from 'got';\nimport { CookieJar } from 'tough-cookie';\nimport { logger } from '../middleware/index.js';\n\nconst"
},
{
"path": "jobs/roadster.js",
"chars": 5711,
"preview": "import got from 'got';\nimport moment from 'moment-timezone';\nimport { logger } from '../middleware/index.js';\n\nconst API"
},
{
"path": "jobs/starlink.js",
"chars": 5142,
"preview": "import got from 'got';\nimport { CookieJar } from 'tough-cookie';\nimport Moment from 'moment-timezone';\nimport MomentRang"
},
{
"path": "jobs/upcoming.js",
"chars": 10366,
"preview": "/* eslint-disable no-continue */\n/* eslint-disable no-restricted-syntax */\n\nimport got from 'got';\nimport { load } from "
},
{
"path": "jobs/webcast.js",
"chars": 2718,
"preview": "import got from 'got';\nimport * as fuzz from 'fuzzball';\nimport Parser from 'rss-parser';\nimport { fail, success } from "
},
{
"path": "jobs/worker.js",
"chars": 1853,
"preview": "import { CronJob } from 'cron';\nimport dotenv from 'dotenv';\nimport { logger } from '../middleware/index.js';\nimport lau"
},
{
"path": "lib/constants.js",
"chars": 154,
"preview": "/**\n * Healthchecks.io API prefix\n */\nexport const HEALTHCHECK_PREFIX = 'https://hc-ping.com';\n\n/**\n * Default Port\n */\n"
},
{
"path": "lib/healthchecks/fail.js",
"chars": 566,
"preview": "/**\n * Imports\n */\nimport got from 'got';\nimport { HEALTHCHECK_PREFIX } from '../constants.js';\n\n/**\n * Send fail signal"
},
{
"path": "lib/healthchecks/index.js",
"chars": 143,
"preview": "export { default as fail } from './fail.js';\nexport { default as start } from './start.js';\nexport { default as success "
},
{
"path": "lib/healthchecks/start.js",
"chars": 568,
"preview": "/**\n * Imports\n */\nimport got from 'got';\nimport { HEALTHCHECK_PREFIX } from '../constants.js';\n\n/**\n * Send start signa"
},
{
"path": "lib/healthchecks/success.js",
"chars": 561,
"preview": "/**\n * Imports\n */\nimport got from 'got';\nimport { HEALTHCHECK_PREFIX } from '../constants.js';\n\n/**\n * Send start signa"
},
{
"path": "lib/utils/healthcheck.js",
"chars": 305,
"preview": "#!/usr/bin/env node\n\nimport got from 'got';\n\nconst { HEALTH_URL, SPACEX_WORKER } = process.env;\n\n(async () => {\n try {\n"
},
{
"path": "middleware/auth.js",
"chars": 479,
"preview": "import mongoose from 'mongoose';\n\nconst db = mongoose.connection.useDb('auth', { useCache: true });\n\n/**\n * Authenticati"
},
{
"path": "middleware/authz.js",
"chars": 306,
"preview": "/**\n * Authorization middleware\n *\n * @param {String} role Role for protected route\n * @returns {void}\n */\nexport "
},
{
"path": "middleware/cache.js",
"chars": 2144,
"preview": "import Redis from 'ioredis';\nimport blake3 from 'blake3';\nimport logger from './logger.js';\n\nconst redis = (process.env."
},
{
"path": "middleware/errors.js",
"chars": 392,
"preview": "/**\n * Error handler middleware\n *\n * @param {Object} ctx Koa context\n * @param {function} next Koa n"
},
{
"path": "middleware/index.js",
"chars": 299,
"preview": "export { default as auth } from './auth.js';\nexport { default as authz } from './authz.js';\nexport { default as cache } "
},
{
"path": "middleware/logger.js",
"chars": 49,
"preview": "import pino from 'pino';\n\nexport default pino();\n"
},
{
"path": "middleware/response-time.js",
"chars": 325,
"preview": "/**\n * Return header with response time\n *\n * @param {Object} ctx Koa context\n * @param {Function} next Next "
},
{
"path": "models/capsules.js",
"chars": 1097,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/company.js",
"chars": 1062,
"preview": "import mongoose from 'mongoose';\nimport idPlugin from 'mongoose-id';\n\nconst companySchema = new mongoose.Schema({\n name"
},
{
"path": "models/cores.js",
"chars": 1088,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/crew.js",
"chars": 786,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/dragons.js",
"chars": 2487,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/history.js",
"chars": 746,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/index.js",
"chars": 754,
"preview": "export { default as Capsule } from './capsules.js';\nexport { default as Company } from './company.js';\nexport { default "
},
{
"path": "models/landpads.js",
"chars": 1321,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/launches.js",
"chars": 4046,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/launchpads.js",
"chars": 1350,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/payloads.js",
"chars": 2364,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/roadster.js",
"chars": 1307,
"preview": "import mongoose from 'mongoose';\nimport idPlugin from 'mongoose-id';\n\nconst roadsterSchema = new mongoose.Schema({\n nam"
},
{
"path": "models/rockets.js",
"chars": 3264,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/ships.js",
"chars": 1658,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/starlink.js",
"chars": 3482,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "models/users.js",
"chars": 549,
"preview": "import mongoose from 'mongoose';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport idPlugin from 'mongoose-id'"
},
{
"path": "package.json",
"chars": 1934,
"preview": "{\n \"name\": \"spacex-api\",\n \"version\": \"4.0.0\",\n \"description\": \"Open Source REST API for data about SpaceX\",\n \"main\":"
},
{
"path": "routes/admin/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/admin/v4/index.js",
"chars": 486,
"preview": "import Router from 'koa-router';\nimport { auth, authz, cache } from '../../../middleware/index.js';\n\nconst router = new "
},
{
"path": "routes/capsules/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/capsules/v4/index.js",
"chars": 1745,
"preview": "import Router from 'koa-router';\nimport { Capsule } from '../../../models/index.js';\nimport { auth, authz, cache } from "
},
{
"path": "routes/company/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/company/v4/index.js",
"chars": 754,
"preview": "import Router from 'koa-router';\nimport { Company } from '../../../models/index.js';\nimport { auth, authz, cache } from "
},
{
"path": "routes/cores/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/cores/v4/index.js",
"chars": 1688,
"preview": "import Router from 'koa-router';\nimport { Core } from '../../../models/index.js';\nimport { auth, authz, cache } from '.."
},
{
"path": "routes/crew/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/crew/v4/index.js",
"chars": 1721,
"preview": "import Router from 'koa-router';\nimport { Crew } from '../../../models/index.js';\nimport { auth, authz, cache } from '.."
},
{
"path": "routes/dragons/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/dragons/v4/index.js",
"chars": 1769,
"preview": "import Router from 'koa-router';\nimport { Dragon } from '../../../models/index.js';\nimport { auth, authz, cache } from '"
},
{
"path": "routes/history/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/history/v4/index.js",
"chars": 1784,
"preview": "import Router from 'koa-router';\nimport { History } from '../../../models/index.js';\nimport { auth, authz, cache } from "
},
{
"path": "routes/index.js",
"chars": 953,
"preview": "/* eslint-disable no-restricted-syntax */\nimport Router from 'koa-router';\n\nconst FOLDERS = await Promise.all([\n import"
},
{
"path": "routes/landpads/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/landpads/v4/index.js",
"chars": 1749,
"preview": "import Router from 'koa-router';\nimport { Landpad } from '../../../models/index.js';\nimport { auth, authz, cache } from "
},
{
"path": "routes/launches/index.js",
"chars": 74,
"preview": "export default [\n import('./v4/index.js'),\n import('./v5/index.js'),\n];\n"
},
{
"path": "routes/launches/v4/_transform-query.js",
"chars": 999,
"preview": "import _ from 'lodash';\n\n/**\n * Transform V4 query into V5 query\n *\n * @param {Object} ctx Koa context\n * @pa"
},
{
"path": "routes/launches/v4/_transform-response.js",
"chars": 1045,
"preview": "/* eslint-disable no-underscore-dangle */\nconst buildCrew = (launch) => {\n if (Array.isArray(launch?.crew) && launch.cr"
},
{
"path": "routes/launches/v4/index.js",
"chars": 3479,
"preview": "import Router from 'koa-router';\nimport { Launch } from '../../../models/index.js';\nimport { auth, authz, cache } from '"
},
{
"path": "routes/launches/v5/index.js",
"chars": 3181,
"preview": "import Router from 'koa-router';\nimport { Launch } from '../../../models/index.js';\nimport { auth, authz, cache } from '"
},
{
"path": "routes/launchpads/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/launchpads/v4/index.js",
"chars": 1789,
"preview": "import Router from 'koa-router';\nimport { Launchpad } from '../../../models/index.js';\nimport { auth, authz, cache } fro"
},
{
"path": "routes/payloads/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/payloads/v4/index.js",
"chars": 1762,
"preview": "import Router from 'koa-router';\nimport { Payload } from '../../../models/index.js';\nimport { auth, authz, cache } from "
},
{
"path": "routes/roadster/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/roadster/v4/index.js",
"chars": 1084,
"preview": "import Router from 'koa-router';\nimport { Roadster } from '../../../models/index.js';\nimport { auth, authz, cache } from"
},
{
"path": "routes/rockets/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/rockets/v4/index.js",
"chars": 1776,
"preview": "import Router from 'koa-router';\nimport { Rocket } from '../../../models/index.js';\nimport { auth, authz, cache } from '"
},
{
"path": "routes/ships/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/ships/v4/index.js",
"chars": 1694,
"preview": "import Router from 'koa-router';\nimport { Ship } from '../../../models/index.js';\nimport { auth, authz, cache } from '.."
},
{
"path": "routes/starlink/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/starlink/v4/index.js",
"chars": 1930,
"preview": "import Router from 'koa-router';\nimport { Starlink } from '../../../models/index.js';\nimport { auth, authz, cache } from"
},
{
"path": "routes/users/index.js",
"chars": 47,
"preview": "export default [\n import('./v4/index.js'),\n];\n"
},
{
"path": "routes/users/v4/index.js",
"chars": 1740,
"preview": "import Router from 'koa-router';\nimport { User } from '../../../models/index.js';\nimport { auth, authz } from '../../../"
},
{
"path": "server.js",
"chars": 1029,
"preview": "import http from 'http';\nimport mongoose from 'mongoose';\nimport logger from './middleware/logger.js';\nimport { DEFAULT_"
},
{
"path": "start.sh",
"chars": 109,
"preview": "#!/usr/bin/env sh\n\nif [ \"$SPACEX_WORKER\" = \"true\" ]; then\n node ./jobs/worker.js\nelse\n node ./server.js\nfi\n"
},
{
"path": "tests/index.test.js",
"chars": 75,
"preview": "it('should expect true to be true', () => {\n expect(true).toBe(true);\n});\n"
}
]
About this extraction
This page contains the full source code of the r-spacex/SpaceX-API GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 161 files (304.4 KB), approximately 93.8k tokens, and a symbol index with 39 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.