I suggest making use of the powerful Linux side of the Yun. Use a Process object from the Bridge library to make a curl call to your API. The Process object can call curl directly, or better yet it can call a Python (or other language) script to preprocess/format/postprocess the data rather than do everything in the sketch.
Remember, the Yun is much more than an little 8-bit Atmel processor running your sketch - the Linux side is a powerful Linux system at your disposal, it is so much more than a simple network interface.