What is the :9 at the end of the URL for?
Have you tried it on the command line as suggested above? See Retrieve Messages | The Things Stack for LoRaWAN
Always best to do the simplest thing first, so leave out the limit & after clauses until you’ve got it working.
If you want something to compare & contrast with, here’s a version in Python: TheThingsStack-Integration-Starters/DataStorage-to-Tab-Python3 at main · descartes/TheThingsStack-Integration-Starters · GitHub
Please do not open a new topic on the same subject. Please do use the tools on the toolbar to format the code so it’s readable - the </> for code - see How do I format my forum post? [HowTo]