Any way of constructing a json file

I need to construct a .json file from data in the pages

Specially the file must return Content-Type header is application/json so possibly the extension might be .json ?!

Anyway of doing that inside of zola or needs a special build prcess