Closed jakewmeyer closed 2 years ago
https://api.spacexdata.com/upcoming Info for next three or so launches which have solid-ish NET dates.
Planning on adding tentative future launch data next.
Thanks for the feedback!
Agreed on the patches 200% π
Links to the original photos?
Patch links are now live! π
@quadrplax I've added an endpoint for upcoming launches, I'll keep adding to it as we find out information.
https://api.spacexdata.com/launches/upcoming
It would be great to make links an array in a hypermedia inspired way. That way you could link a lot of different links like SpaceX instagram posts, gifs, videos, articles,
Something like
links: [ { type: 'video', url: '' }, { type: 'instagram', url: '' }, ]
@jokecamp Looking at a better way to express the data, so it allows for more flexibility going forward.
Not exactly sure of the usefulness, but perhaps links to Reddit launch threads and/or media threads? Perhaps as part of @jokecamp's suggestion for a 'links' object
@HarvsG I'll add it to the list for the links object
@jokecamp @HarvsG Now that I have a good way to add multiple links, I'll make a pass and add the reddit launch threads
Anything else media related that should be included?
Launches + Upcoming Launches now have links to reddit campaign, launch, recovery, and media threads, as well as official presskit PDF's put out by SpaceX π
This is a great data source, thanks for creating this! Curious if there is source for add'l info on the launches -- specifically looking for detailed info to create a 3d visualization of the launches.
@kfarr What kind of additional info?
So the crazy idea is to make a visualization of the earth and the orbit in webvr. This would require at a minimum:
I don't know the right way to suggest providing this data but I think there would be interest in such a visualization and I'm happy to take a stab at it.
I suppose the "pareto superior" next step is to provide a landing position in addition to launch site in the data?
Awesome! I've been wanting to include more detailed telemetry, but haven't had a good way to make it happen easily until now. If we can nail down some specific info that we need, I can add a telemetry section to the flights for easier visualization and analysis.
The idea almost sounds like a VR version of Flight Club from @murphd37, which has super detailed trajectory and data simulations for lots of flights. He would be a good resource for information about the best way to go about it.
Wow Flight Club is incredible, looks like @murphd37 has done the heavy lifting already on the visualization side. So, the missing element is simply linking these together? For example, here's the link to the "playback" view of Bulgaria Sat 1: https://www.flightclub.io/world/?w=2&code=BGS1
It could be yet another item in the link
array, assuming that there is interest in visualizing these things ahead of the mission launch. I also don't know what info is released publicly prior to launch
I'll make a pass on the database and add the links for the launches @murphd37 added previously π
Here's an idea for the rocket associated to each launch
Similar to how the launches have the launch site as:
"launch_site": { "site_id": "kwajalein_atoll", "site_name": "Kwajalein Atoll" }
You could have the rocket for each launch like:
"rocket": { "rocket_id": "falcon9", "rocket_name": "Falcon 9" }
This would allow lookups of rockets from the launch data
@jakewmeyer thoughts?
@waterskier2007 I'll add it to the list, hoping to add this and #31 today/tonight
πyou da man
@jakewmeyer I see some of the launches are beginning to take the structure. I assume your plan is to do this for all launches?
@jakewmeyer also, just an FYI, the launches/cores/coreId and launches/caps/capId endpoints will have to be updated because the core_serial and cap_serial are no longer properties of the launches directly
@waterskier2007 I was fighting with the endpoints last night, and the query wasn't working as it should. So I just moved the serial numbers back out to the root of the object, so the endpoints don't have to be changed.
Everything should be updated at with the rocket name + info at this point π
Iβm not familiar with ruby but canβt you use dot syntax to filter by a child property?
Ex:
collection.find({rocket.core_serial: 'b1034'}
I wrote this on my phone so it may not be accurate.
Sent from my iPhone
On Aug 2, 2017, at 3:58 PM, Jake Meyer notifications@github.com wrote:
@waterskier2007 I was fighting with the endpoints last night, and the query wasn't working as it should. So I just moved the serial numbers back out to the root of the object, so the endpoints don't have to be changed.
Everything should be updated at with the rocket name + info at this point π
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@waterskier2007 That's what I was trying to do, but translating it to Ruby syntax wasn't working properly. I'm pretty sure you can use the dot notation syntax or this style, but neither would work for me.
collection.find(rocket: {core_serial: "#{core}"}, projection: {_id: 0}).sort(rocket: {core_serial: 1})
or
collection.find({'rocket.core_serial': "#{core}"}, projection: {_id: 0}).sort('rocket.core_serial': 1})
In both cases it would work without the projection and sorting statements. Planning on taking another crack at it to see if I can make it work.
@jakewmeyer what is the projection necessary for? It seems like it's only to limit the fields returned, but wouldn't you want all of the fields?
again, my ruby knowledge here is mostly nil but I was just looking at the documentation here https://docs.mongodb.com/manual/reference/method/db.collection.find/
Does it make sense to sort launches by date by default?
@gravitylow What do you mean?
I agree with sorting/ordening. Could be useful to set a param in the api call, like so: ".../launches?order=desc".
Also I'd love to see some more mission details, like a title and maybe some meta data? For example the IRIDIUM-4 MISSION doesn't have a patch-image url right now. Launch is within 16 hours. Also the title Iridiium-4 isn't mentioned in any details yet:
...
"links": {
"mission_patch": null,
"reddit_campaign": "https://www.reddit.com/r/spacex/comments/7cgts7/iridium_next_constellation_mission_4_launch/",
"reddit_launch": null,
"reddit_recovery": null,
"reddit_media": null,
"presskit": null,
"article_link": null,
"video_link": null
},
"details": null
...
Update: I've also noticed the 23 dec launch of Iridium isn't updated. Would it help to have some people update the data?
Adding sorting support in #65
Edit: @jeroenboumans Sorting support is now live for past and upcoming launch endpoints using the following querystrings
order=asc
for ascending order
order=desc
for descending order
The launchpad by ID should not return an array
example: https://api.spacexdata.com/v2/launchpads/ccafs_slc_40
Also, there should be the ability to get cap/core based on serial directly as a route param like above, not as a query parameter
@waterskier2007 I imagine the first part of that should be trivial to change by adding [0]
to wherever the endpoint is defined.
@jhpratt that would be the workaround indeed. Though, I agree with @waterskier2007, an endpoint with an ID (not a param or search term) should return a single object. This is fixed for the capsule and rocket endpoints in #68.
@jhpratt Yeah I know the workaround, it's just more about consistency and following closer to a normal REST standard
@jeroenboumans any reason that it's fixed for capsules but not for cores?
@jhpratt I'm not sure. Best is to ask @jakewmeyer :)
yeah, it looks like it works for capsules but not for detailed capsules... seems like an inconsistency in my book
see here: https://github.com/r-spacex/SpaceX-API/wiki/Capsule-Detail
@jakewmeyer
I agree with @jeroenboumans that endpoints with an ID should only return the object needed. The Launchpad endpoint is the only one not following this, but should be a trivial fix.
@waterskier2007 I'll add routes with ID's for cores/caps
Changes are live @waterskier2007 @jeroenboumans
https://api.spacexdata.com/v2/parts/cores/B1041 https://api.spacexdata.com/v2/parts/caps/C113 https://api.spacexdata.com/v2/launchpads/ccafs_slc_40
Adding 404's for bad ID's shortly
@jakewmeyer you are the man
Thanks for the quick update @jakewmeyer! Will update my app tonight! π
Proposed addition: block of each core.
This should be an easy one to add, given we can find enough data.
Saw that @jhpratt. Should be able to add to to launches and detailed core data
We should be able to fetch a certain launch information regardless of knowing it's from the past or an upcoming launch. Here's a PR with the fix π https://github.com/r-spacex/SpaceX-API/pull/74
First - awesome API! Iβve been having a lot of fun playing with this.
Second - I found a few unexpected ways of how the resources are managed and I think there could be some improvements for REST resources.
I expected to be able to get a specific launches info based on itβs ID (flight_number
) as a resource through the path, e.g. https://api.spacexdata.com/v2/launches/58
would return the information for flight 58. This is possible as a query param, e.g. https://api.spacexdata.com/v2/launches?flight_number=58
, but accessing the resource for flight 58 via the path seems to follow REST.
Continuing on, I also expected that the /launches
resource would have all the launches. As of now Iβm not able to get a future launch through this endpoint, e.g. https://api.spacexdata.com/v2/launches?flight_number=59
returns an empty array.
sidenote: I noticed the docs mention that an empty array is returned if no match is found through querystring filtering. If the API moved to the resource being found through the path, that could return a 404 if the resource wasnβt found.
It would be a big change to the current contract, but /launches
containing all launches and /launches/all
being replaced with /launches/past
would be great. I see the second path param adding the ability to narrow down the results:
launches/upcoming
launches/past
launches/latest
I'm working on a PR to make some of these changes to see how it would work - still learning how to build/test locally.
Thanks for making this awesome API!
Glad you're enjoying it @ahatzz11 ! π
sidenote: This was a big point of debate for awhile, but it makes sense not to return 404, because the resource(aka. collection) is technically found, but no results were found.
https://api.spacexdata.com/v2/launches?flight_number=59 returns flight 59 for me, not an empty array
Originally launches held ALL the launches, but the upcoming ones were moved to a new collection for better separation of responsibility. This would be a major breaking change in the way the launches are currently delivered.
The query filtering could stay in place, and getting a resource of a flight by ID could be an addition. Although a case like https://api.spacexdata.com/v2/launches/58?flight_number=58
might be weird if the path parameter didn't line up with the query parameter.
When I wrote the comment yesterday with the flight 59
example, it didn't exist. Then SpaceX had their Falcon 9 launch yesterday and made my comment out of date! Hard to keep up with so many launches nowadays π
An example that shouldn't go out of date soon: https://api.spacexdata.com/v2/launches?flight_number=100 returns an empty array.
Interesting point here. I'll have to look more closely at how that's being managed.
Thanks for the speedy response here! (and on issue #82 regarding failing tests)
Sounds good! Should make it more RESTful going forward.
Gotcha π
We might be able to figure out a better name option while preserving backwards compatibility.
Hey Jake, Thanks for this sweet API!
I was just wondering, with the mission patches, if it would be advantageous to have them in 2 sizes. The large size they are currently in and a smaller size - maybe half or more.
I'm having performance issues in scrolling a UICollectionView that is displaying a thumbnail of the images (which are actually rendered as full res and scaled down)
Not sure anything can be done but it's a long shot request.
Please feel free to post any suggestions, corrections, or additions I should make to the data. I'll try my best to keep it as current as possible π
Thanks!