Export chart JSON for many charts

I want to self host my plotly charts so that I can load the charts on my website faster and avoid the 500 views per chart/day limit. I think I can do this by exporting the JSON from the plot.ly website, and hosting plotly.js on my website.

My question is what is the most efficient way to export the JSON for all the charts - Iā€™d like to do this from the command line or python if possible because there are a lot of charts.