こういうのを Node.js でやりたい時は
$ curl -sLI http://shortened_url | grep -i Location
axios の get に以下のようなオプションを渡してあげるとよい
const axios = require('axios') async function main () { const res = await axios.get('https://t.co/q0wn9eZvvY', { maxRedirects: 0, validateStatus: null }) console.log(res.headers.location) } main()