Link to cast file when loading in javascript

how do I get from a link like untitled - asciinema.org to the original .cast json (line-demimited)? Is there a link like https://asciinema.org/a/bAY9c2ZFtSSAHhiXZdinHOmtP.json that would allow me to simply fetch it?

I see that both .json and .cast work for returning the .cast data, so this can be closed.

Yup. The link is displayed in the Download popup. If the file is asciicast v1 then it uses .json, if newer then it uses .cast. Both work though when requesting the file, as you figured out