Spacex-api: What's the best way to get a specific launch?

Created on 8 Sep 2018  路  12Comments  路  Source: r-spacex/SpaceX-API

I can't seem to find documentation for or working endpoints that returns a specific launch. The only way I seem to be able to replicate this is by querying a specific flight number:

https://api.spacexdata.com/v2/launches?flight_number=50

However, this obviously returns an array instead of a single object, which is slightly annoying 馃槃

Would it make sense to follow the principle of most other endpoint by having a detail endpoint like

https://api.spacexdata.com/v2/launches/{flight_number or some sort of ID}
Question

All 12 comments

v3 endpoint supports this

https://api.spacexdata.com/v3/launches/65

v3 is coming in a few weeks. Still getting tests and documentation taken care of

Awesome!

And just to completely understand your versioning approach: Since /v3 is already available now, do you then just recommend not using it in production until it's done?

And also, most endpoints that reference specific missions - like /ships or /parts/cores - only reference them by name:

"missions": [
    "Iridium NEXT 7",
    "SAOCOM 1A"
]

So what is the best way to load the corresponding launch from that?

Most of the endpoints are unlikely to change, but until it's officially released, I would wait on using it in production, just in case we decide to make last minute changes.

If you want a peek at the v3 documentation, it's located here

OMG, Postman docs 馃槏

But what about my second question? 馃檪

My feeling exactly 鉂わ笍

As far as the second question goes

Currently we can get launches with a mission name like:
https://api.spacexdata.com/v3/launches?mission_name=TESS

One option is changing the v3 endpoint to accept a mission name param instead of flight number:
https://api.spacexdata.com/v3/launches/TESS

The name is just not guaranteed to be unique 馃槙What if all the endpoints that return references to missions return a list of objects like

"missions": [
    {
        "name": "Iridium NEXT 7",
        "flight": 55
    },
    {
        "name": "SAOCOM 1A",
        "flight": 45
    }
]

Then a client can still show the name as preview and then use the ID to get the full thing.

Sounds good to me 馃憤

Capsules, Cores, and Ships have all been updated with this style 馃憤

You blow my mind every single day 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haroldadmin picture haroldadmin  路  6Comments

samg11 picture samg11  路  4Comments

jesusrp98 picture jesusrp98  路  8Comments

Tearth picture Tearth  路  4Comments

esper-creative picture esper-creative  路  3Comments