Using Python for AGI scripting

I think you can do what you want in the dialplan directly, without AGI. Asterisk has curl and JSON parsing functions available.

Take a look at CURL, CURLOPT, and JSON_DECODE : Dialplan Functions - Asterisk Documentation

Here’s a small sample written by @lgaetz : Asterisk JSON_DECODE function