in reply to Script to scrap data (2nd part)

This is not a script writing service.

Please tell us where you have problems. Also show the code you have already written.

For converting a browser request to a Perl script, see for example curl-to-LWP, which lets you copy a request from your browser (as cURL command) and converts that into a Perl script.

Please note that simply posting that Perl script here will not be enough - I expect you to put time into understanding the script and also understanding the modules you are using.

Then, take a look at JSON (and/or Mojolicious::JSON, Cpanel::JSON::XS), and Text::CSV_XS.