I built something similar a while back.
But instead of pulling the data out of Notes, I took it from SMTP mail.
I don't know if it still works this way, but when I did it, if you used a non-iCloud email address to sync Notes, it saved the data as pain text in email messages that could be easily parsed.