I don't think there is a direct way to do this until MySQL 5.7, when that information is available in the performance_schema.replication_execute_status_by_coordinator
table.
If you are on an older version (which you almost certainly are) then you'll probably need to execute SHOW SLAVE STATUS
and parse the output in the language of your choice to extract the fields you are interested in.