How to use API to communicate between two peers?

I’m trying to make a web extension that creates a user profile based on web activity that I can share with peers. I’m currently in the process of learning how to use the YaCy API to share this user profile between two peers. I wanted to ask a few questions about how I might be able to do this:

  1. What would be the best language/method of calling the YaCy API?

  2. Can I use the APImessage call? It is on the deprecated wiki and trying to figure out how it works through the files in the htroot hasn’t yielded anything yet