r-spacex / SpaceX-API

:rocket: Open Source REST API for SpaceX launch, rocket, core, capsule, starlink, launchpad, and landing pad data.
Apache License 2.0
10.43k stars 926 forks source link

Ideas for Expansion #1

Closed jakewmeyer closed 2 years ago

jakewmeyer commented 7 years ago

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!

jakewmeyer commented 6 years ago

Hey Gary! Glad you like it πŸ‘

Shouldn't be a long shot request, since imgur photos can be served in multiple sizes by modifying the end of the url.

Looks like the original ones are 924 x 868 https://i.imgur.com/eHxbiG3.png You can add a l, m, or s to the url to make it smaller.

For example: https://i.imgur.com/eHxbiG3m.png is 320 x 301, which is considerably smaller.

If we can decide what size is best for a smaller image, I'll add a mission_patch_small field with the corrected url πŸ‘

garyjacobs commented 6 years ago

Hey Jake! I didn't know that IMGUR had that feature. In theory that would be awesome and the "m" size would be perfect but it looks like most of the non-full version don't have a transparent background. They render with either black or white squares. (See image attached)

The full version is the only one that has the transparency around the patches. So I appreciate the willingness to add the end point and it would have been a sweet solution but I don't think it would be worth your time (for my needs anyway).

I'll just save the mission patch image for the detail view of the app πŸ‘

Thanks again πŸš€

images

P.S. - I'm not sure what is going on with the 's' sized ones but most of them have been cropped. so it's not even the same image as the others. Weird πŸ€·β€β™‚οΈ

garyjacobs commented 6 years ago

Hey Jake, Just a small one I found and I'm not sure if it matters but the the following flight mission patches have an http instead of an https

35 - http://i.imgur.com/4zo17M6.png 36 - http://i.imgur.com/6Ykkq2B.png 38 - http://i.imgur.com/BzYVR9F.png 39 - http://i.imgur.com/nAzU032.png

jakewmeyer commented 6 years ago

@garyjacobs Went through and corrected the non https links πŸ‘

Interesting that they don't preserve the transparency at smaller sizes

garyjacobs commented 6 years ago

Cheers for the image URL updates. πŸ‘

Turns out the transparency being stripped is by design from imgur. If a png is over a certain size it gets converted to jpg.

TrueRGB commented 6 years ago

Hey!

I recently started using this API, and I noticed that the only way to get the "name" of the mission was to use the payload ID. This isn't optimal since some of the payload IDs are very long and some don't really match what the mission was called. For example, "Falcon Heavy Test Flight" would be more fitting than just "Tesla Roadster".

Is there any way a mission_name could be implemented in the API, or am I just missing something?

jakewmeyer commented 6 years ago

@TrueRGB Sure!

Like you mentioned, sometimes the payload doesn't always line up with the colloquial "mission name". Are there any other special cases that don't make sense to you?

Just want to make sure we're on the same page with what the names should be πŸ‘

TrueRGB commented 6 years ago

Yes, some mission name ideas:

I'm sure someone can come up with better names for the missions, it's difficult because some of them don't really have an official name. A mission_name would be more of a convenience than a necessity, but it would be nice either way.

jakewmeyer commented 6 years ago

@TrueRGB Added to all past and upcoming flights πŸ‘ Should be live

maxxm2017 commented 6 years ago

Thanks for all the great info! I'm very new to this, but want to start experimenting for an idea I have utilizing this data. Is there something (or can you add) some more detailed info for the next upcoming launch? For example, the "latest launch" information is fantastic for the most recent launch (patches, mission description, etc.), but the "upcoming" launches all seem to have Null for this information (even for Bangabandhu-1 which is currently scheduled to launch tomorrow), I would think this would have some more info? Maybe I'm missing something?

Thanks for the help!!

psidex commented 6 years ago

@maxxm2017 What have you tried? https://api.spacexdata.com/v2/launches/upcoming?order=asc will give you the next upcoming launches, in ascending order, and contains all the information known about the launches

maxxm2017 commented 6 years ago

Yes sir I did use that. I'm speaking specifically to the bottom of each launch section is null for a lot of it (except for reddit campaign thread):

mission_patch":null,"mission_patch_small":null,"reddit_campaign":"https://www.reddit.com/r/spacex/comments/8624iq/bangabandhu1_launch_campaign_thread/","reddit_launch":null,"reddit_recovery":null,"reddit_media":null,"presskit":null,"article_link":null,"video_link":null},"details":null},

jakewmeyer commented 6 years ago

@maxxm2017 Information is added as soon as it becomes available, and a good portion of it isn't available until the day or two before the launch.

maxxm2017 commented 6 years ago

@jakewmeyer, appreciate the information. Was looking at it the day before the Bangabandhu-1 mission and the data wasn't there. Now it was supposed to launch yesterday (scrubbed to today), but still no mission detail information ,etc. I do see that the patch has been updated, along with some other data! Again, total noob so sorry if they're nonsense questions. Was hoping that mission detail information would be available a bit earlier, but I understand that it posts when it becomes available. Thanks for all the great work!

trimeta commented 6 years ago

For Falcon Heavy missions, is the center core guaranteed to be the first element of the rocket.first_stage.cores section? If not, how can we reliably pull data from the center core for Heavy missions?

jonghough commented 6 years ago

It would be nice to get some images, either photos or diagrams of each of the rockets, in the API. For example

{"id":"falcon9",
 "name":"Falcon 9",...
 "link_to_img":"https:// ... .png
}
jeroenboumans commented 6 years ago

@jakewmeyer, I agree to the fact that a bit more deeper information can be added to the API, for example on the About SpaceX API call. Based on comparing the API endpoint to the spacex website the timeline could be a nice addition to the API endpoints, for example /v2/info/history. In other words more detailed information on sub-endpoints.

@jonghough, However adding images/visuals is application dependent. As I'm building a SpaceX companion app at the moment I'm hosting the images myself using prefixes in the image names like falcon9_ of falconheavy_. These can be linked via vehicle IDs. I personally think the API should provide only structured structural information.

jakewmeyer commented 6 years ago

@trimeta Yes, the center core is guaranteed to be the first element in the array.

jakewmeyer commented 6 years ago

@jeroenboumans History on the API? Or history on SpaceX?

jakewmeyer commented 6 years ago

@jonghough Not opposed to the idea, since we do provide image links for patches and such. However, keep in mind that you might need different sized photos on different platforms.

Like @jeroenboumans suggested, bringing your own photos and linking them to information in the API might be the better solution, so you can custom fit your images to your specific application.

If you still want me to add it, we can decide on some standardized images and go from there πŸ‘

jeroenboumans commented 6 years ago

@jakewmeyer the history of SpaceX which can be found in the Making History section. Would be nice if this could be added :)

jakewmeyer commented 6 years ago

@jeroenboumans Any opinions on the best way to structure it?

jeroenboumans commented 6 years ago

Hi @jakewmeyer ,

I'd say use a format like this: An event model containing data like: title, event date (yyyy-mm-dd), description, original blog url/reddit url about the event. All sortable by date (ASC/DESC), probably groupable by year like the timetable on spacex.com. Maybe add categories, or vehicles IDs concerned to the event used for filtering.

Just some quick endpoints I'm thinking of.

Looking forward if something like this could be added! :) πŸ‘

alshapton commented 6 years ago

Two ideas here: i) would there be any value in building up a set of dates when launches were delayed ? i.e. if the launch is delayed, then the original date is stored as a separate property, and the new date is included. Should that date be delayed again, it should be shuffled down further....... e.g:

"launch_date_utc": "2018-05-15T20:14:00Z", {"delayed_launches": [ "2018-05-12T06:17:00Z",
"2018-04-19T21:22:00Z" ] }

ii) in preparation for the crewed launches, space for the crew names, and maybe in time, other information:

"crew": [ { { "commander": "Robert Louis Behnken", "links": { "wikipedia_bio": "https://en.wikipedia.org/wiki/Robert_Louis_Behnken", } }, { "co-pilot": "Sunita Williams", "links": { "wikipedia_bio": "https://en.wikipedia.org/wiki/Sunita_Williams" }
} { "engineer": " Douglas Hurley", "links": { "wikipedia_bio": "https://en.wikipedia.org/wiki/Douglas_Hurley" }
} ] ........ etc

Thoughts ?

I'd be happy to have a bash at one or both of these if there's a call for them.....

jeroenboumans commented 6 years ago

@alshapton I don't think the delayed_launchdates can be used for expanding more information about the launch. I do think a log with information about the flight in general can be more interesting. For example checkout the Timeline section on this reddit topic (which had a delayed launch). As we can see in that example, the delayed launch time is just an event on the full launch log. @jakewmeyer interesting enough for the API?

@alshapton I like the idea about showing crew members in the API data :) πŸ‘In the future that could mean it is possible to select all flights of a crew member or something like that.

alshapton commented 6 years ago

@jeroenboumans I'll have a crack at the crew stuff.... πŸ‘

alshapton commented 6 years ago

Adding to my previous comment (probably directed @jakewmeyer here) - I'm looking to modify the schema of the db - I can do that in a dev environment, however, how should I submit that for inclusion in the change request, such that the schema change will go along with the code (bearing in mind it should be a non-breaking change ?

jakewmeyer commented 6 years ago

@alshapton Previously I've added most of these changes myself, usually through json files submitted and subsequently added to the database. Only thing that would need to change in the code is adding to the tests to check for the presence of the additions, and adding it to the query string launch query builder.

As long as we're not removing anything, it should be a non breaking change πŸ‘

jakewmeyer commented 6 years ago

@jeroenboumans Go ahead and add a new issue for the history data, and we can get started on it

jeroenboumans commented 6 years ago

Thanks @jakewmeyer, just created the issue in #89

sebbekarlsson commented 6 years ago

Where are you getting the data from? @jakewmeyer

jakewmeyer commented 6 years ago

@sebbekarlsson Few sources, mostly the following:

  1. https://www.reddit.com/r/spacex/wiki/index
  2. https://en.wikipedia.org/wiki/List_of_Falcon_9_and_Falcon_Heavy_launches
  3. https://spaceflightnow.com/

Launch updates sometimes come from Elon or SpaceX's twitter pages too

dnjef commented 6 years ago

Probably the wrong place, but consider transferring the current backend to TypeScript

It's a superset with types.

I could make a pull request with the current backend running on typescript?

jakewmeyer commented 6 years ago

@CPP-MASTERRACE Considered it in the past, but I think it would just add an unnecessary amount of overhead and complexity for a small project like this, especially for new people who might not know TypeScript but still want to contribute.

dnjef commented 6 years ago

@jakewmeyer IMO it really wouldn't add any complexity or overhead, just make the code more readable and structured. The syntax is basically the same (with types). If you have slack or gitter I could show you a really well structured API and if you don't understand it within 5 minutes you've proven your point.

jakewmeyer commented 6 years ago

@CPP-MASTERRACE If you're up for it, feel free to submit the PR πŸ‘

samcat116 commented 6 years ago

Any way you could easily add more launch photos from the official SpaceX Flickr? They seem to upload photos pretty quickly after a launch. Unfortunately they don't separate each launch into a separate album, but you could just serve all the URLs for the various photos for a certain launch. Also not sure how the Flicker API works in terms of photo sizes.

jakewmeyer commented 6 years ago

@samcat116 I can, but we would need to decide on the best size image to use for the links. It could look something like this.

{
  "launch_photos": [
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_k.jpg",
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_k.jpg",
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_k.jpg",
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_k.jpg"
  ]
}
samcat116 commented 6 years ago

Do we want to give the largest size by default? Maybe the normal size is more appropriate.

{
  "launch_photos": [
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b.jpg",
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b.jpg",
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b.jpg",
    "https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b.jpg"
  ]
}
jeroenboumans commented 6 years ago

@samcat116 @jakewmeyer how about serving an image object per launch photo containing the sizes like this?

{
    "launch_photos": [
        {
            "xsmall":"https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b_1.jpg",
            "small":"https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b_2.jpg",
            "medium":"https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b_3.jpg",
            "large":"https://farm1.staticflickr.com/911/42025499722_ded6ed7d74_b_4.jpg"
        },
        {
            .... // more photo objects
        }
  ]
}
samcat116 commented 6 years ago

@jeroenboumans @jakewmeyer That would work fine, just would be a lot of links. I would also add the thumbnail size to the four you already have.

jeroenboumans commented 6 years ago

@samcat116 I guess I was a little rash in my response. Flickr does indeed support sizes like mentioned here. I think specifying the Uri only would indeed work since their image url format works like this: http://www.flickr.com/photos/USER/PHOTO/sizes/SIZE.

samcat116 commented 6 years ago

I was looking at the format here. I think that specifying only a single size would work, that way each launch would only have like 12 links, instead of like 48. Plus people can always change the link to get the size they want.

jeroenboumans commented 6 years ago

@samcat116 yep, that was the direction I was thinking about in my last post. Think we're on the same line here :) πŸ‘

samcat116 commented 6 years ago

So I guess what @jakewmeyer was originally thinking would work best. Might be better to not serve the largest size by default though.

jeroenboumans commented 6 years ago

I've also added #93 , a request for adding the BFR specs to the rockets overview :)

jakewmeyer commented 6 years ago

@samcat116 What size works best as a middle ground?

samcat116 commented 6 years ago

@jakewmeyer I think the ' -b ' size would make sense in most situations. I think thats 1024 on the longest side.

jakewmeyer commented 6 years ago

@samcat116 Doesn't look like the -b option will work for most of the photos. Flickr keeps returning the image as unavailable when using it

TsaiZinan commented 6 years ago

Thanks for your API. It helps me a lot in learning web. I found that the URLs of mission_patch and mission_patch_small in flight 48 (Iridium NEXT Mission 3) are the same which present as the large size image.