NASA Moved the Picture of the Day and My Widget Didn't Notice
My homepage kept saying "NASA media is temporarily unavailable." The API wasn't down. It was answering with a polite, perfectly valid placeholder.
The Astronomy Picture of the Day card on my homepage started showing a fallback message: "NASA media is temporarily unavailable." I already had a backup for this. The route tries api.nasa.gov first and falls back to a community mirror if NASA errors out. So two sources had to be failing at once, which seemed unlikely.
They weren't failing. Both returned HTTP 200 with valid JSON: a title of "NASA Science", an empty explanation, media_type "video", and a url of about:blank. APOD has moved to science.nasa.gov, and the old API now answers with a stub instead of an error. My fallback only kicked in when a request threw, and a 200 with junk inside doesn't throw. The mirror copies the same upstream, so it returned the same stub.
The fix had two parts. First, validate the payload instead of trusting the status code: an APOD with no real http(s) URL, or titled "NASA Science", counts as a failure and moves on to the next source. Second, add a last source that reads today's entry straight from the science.nasa.gov APOD page and its article metadata.
The lesson I keep relearning with third-party APIs: a 200 tells you the request worked, not that the data is any good. Check that the thing you need is actually in there.