My idea, but please remember – it is only idea, which wasn’t tested –
1) create a custom post template
2) create a new hidden post and assign this new custom post template
3) then render the JSON in the template using @website.contentStructure global variable: https://getpublii.com/dev/website-global-variable/ and use feed-json.hbs as an inspiration
Of course you will get JSON inside HTML file, but as I suppose – you just need raw JSON data.
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!