You can query a NPM package with the NPM public API. E.g. to query the package react:
curl "https://api.npms.io/v2/package/react"
This works fine. See https://api-docs.npms.io/#api-Package-GetPackageInfo
But how do you query a package that is scoped, i.e prefixed with an "@"?
curl 'https://api.npms.io/v2/package/@types/react-router-dom'
This doesn't work.
You just need to URL-encode the name:
https://api.npms.io/v2/package/%40types%2Freact-router-dom
The crucial part seems to be encoding the
/, so the name isn't treated as two path segments, rather than the@itself: