Project

spacex

0.02
No release in over 3 years
Low commit activity in last 3 years
Ruby library to consume SpaceX launch data
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 12.3.3
~> 3.8
~> 3.4
~> 1.22
~> 6.0

Runtime

~> 2.0
~> 5.0
 Project Readme

SpaceX Ruby Client

Gem Version Tests

A Ruby library that consumes the SpaceX API.

Table of Contents

  • Installation
  • Quick Start
    • Launches
    • Rockets
    • Starlink
  • Available Resources
  • Contributing
  • Copyright

Installation

Add the gem to your Gemfile:

gem 'spacex'

Then run bundle install.

Quick Start

Launches

# Get the latest launch
launch = SPACEX::Launches.latest
launch.name        # "Starlink 6-14"
launch.date_utc    # "2023-09-08T02:47:00.000Z"
launch.success     # true
launch.details     # "..."

# Get upcoming launches
upcoming = SPACEX::Launches.upcoming
upcoming.first.name     # "Starlink 7-1"
upcoming.first.date_utc # "2024-01-15T00:00:00.000Z"

Also available: SPACEX::Launches.info, SPACEX::Launches.next, SPACEX::Launches.past.

Rockets

# Get all rockets
rockets = SPACEX::Rockets.info
rockets.first.name      # "Falcon 1"
rockets.first.active    # false

# Get a specific rocket by ID
falcon9 = SPACEX::Rockets.info('5e9d0d95eda69973a809d1ec')
falcon9.name            # "Falcon 9"
falcon9.active          # true
falcon9.cost_per_launch # 50_000_000

Starlink

# Get all Starlink satellites
satellites = SPACEX::Starlink.info
satellites.first.latitude     # 53.0   (illustrative — live data will differ)
satellites.first.longitude    # -94.0
satellites.first.height_km    # 550.6
satellites.first.velocity_kms # 7.66

Available Resources

All resources live under the SPACEX:: namespace and support .info and .info('id').

Resource Notes
SPACEX::Capsules
SPACEX::Company Single object — .info only
SPACEX::Cores
SPACEX::Crew
SPACEX::Dragons
SPACEX::History
SPACEX::Landpads
SPACEX::Launches Also: .latest, .next, .past, .upcoming
SPACEX::Launchpads
SPACEX::Payloads
SPACEX::Roadster Single object — .info only
SPACEX::Rockets
SPACEX::Ships
SPACEX::Starlink

Contributing

See CONTRIBUTING.

List of awesome people that already helped this project.

Contributors

Copyright

Copyright (c) 2018, Rodolfo Bandeira and Contributors.

MIT License, see LICENSE for details.