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.5k stars 935 forks source link

Seems like Starlink API is outdated #1343

Open anna-hos opened 1 year ago

anna-hos commented 1 year ago

Hi all! I have tried using this request https://api.spacexdata.com/v4/starlink and latest launch date is 2022-10-28, however Space Track has more fresh data on other satellites. Could someone check this, please?

frankcholula commented 1 year ago

looks like it. This should be the latest data

As of 20 July 2023:[[3]](https://en.wikipedia.org/wiki/List_of_Starlink_and_Starshield_launches#cite_note-JM-stats-3)

Satellites launched: 4837
Satellites failed or deorbited: 372
Satellites in orbit: 4497
Satellites working: 4465
Satellites operational: 3741

but I'm only getting 3526 total (included the decayed ones)

Update Yep, just confirmed with the spacetrack API, v4 is outdated. e.g. This is 57246 launched on 2023-07-07 and it's not stored in the backend MongoDB.

from spacetrack import SpaceTrackClient
import json

username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"

st = SpaceTrackClient(identity=username, password=password)
norad_ids = [57246]
starlink_tle_data = st.tle_latest(
    norad_cat_id=norad_ids, orderby="epoch desc", limit=1, format="json"
)
starlink_tle_data = json.loads(starlink_tle_data)
for data in starlink_tle_data:
    print(data)

here's the response

{
    "ORDINAL": "1",
    "COMMENT": "GENERATED VIA SPACETRACK.ORG API",
    "ORIGINATOR": "18 SPCS",
    "NORAD_CAT_ID": "57246",
    "OBJECT_NAME": "STARLINK-5049",
    "OBJECT_TYPE": "PAYLOAD",
    "CLASSIFICATION_TYPE": "U",
    "INTLDES": "23094AE",
    "EPOCH": "2023-07-21 04:00:00",
    "EPOCH_MICROSECONDS": "999936",
    "MEAN_MOTION": "15.78912491",
    "ECCENTRICITY": "0.000143",
    "INCLINATION": "42.9935",
    "RA_OF_ASC_NODE": "236.5235",
    "ARG_OF_PERICENTER": "270.1818",
    "MEAN_ANOMALY": "119.7865",
    "EPHEMERIS_TYPE": "0",
    "ELEMENT_SET_NO": "999",
    "REV_AT_EPOCH": "231",
    "BSTAR": "-0.0058808",
    "MEAN_MOTION_DOT": "-0.00960194",
    "MEAN_MOTION_DDOT": "0",
    "FILE": "3962978",
    "TLE_LINE0": "0 STARLINK-5049",
    "TLE_LINE1": "1 57246U 23094AE  23202.16667824 -.00960194  00000-0 -58808-2 0  9993",
    "TLE_LINE2": "2 57246  42.9935 236.5235 0001430 270.1818 119.7865 15.78912491  2319",
    "OBJECT_ID": "2023-094AE",
    "OBJECT_NUMBER": "57246",
    "SEMIMAJOR_AXIS": "6711.658",
    "PERIOD": "91.202",
    "APOGEE": "334.482",
    "PERIGEE": "332.563",
    "DECAYED": "0"
}

and from the dataset

image
pieteradejong commented 1 year ago

I've had similar issues. Two thoughts: