How to retrieve segment size

I want to create a petition form, where a bar will fill up as people sign, however i need the current segment size for that. Is it possible to get the size of a segment from Mautic with PHP, to display in WodPress?

you can do a mysql query using php to get the size

do a select on lead_lists_leads and the field is leadlist_id to equal your segment number