So you mean you want to list all addresses for one specific "Gemeinde", and get EGID for addresses there?
If so, this request should do the trick
https://api3.geo.admin.ch/rest/services/api/MapServer/find?layer=ch.swisstopo.amtliches-gebaeudeadressverzeichnis&searchText=Opfikon&searchField=com_nameI don't think you can filter by district, though. Fields that are available to search are the one returned by an identify/find request on the layer, in this case that would be
{
"adr_egaid": 100017991,
"bdg_egid": 24370,
"adr_edid": 0,
"str_esid": 10079688,
"stn_label": "Grätzlistrasse",
"adr_number": "39",
"zip_label": "8152 Opfikon",
"com_fosnr": 66,
"com_name": "Opfikon",
"adr_status": "1",
"adr_official": true,
"bdg_category": "2",
"adr_modified": "20241115",
"label": 100017991
}
The EGID should be contained in the field "bdg_egid"
Is that what you were looking for?
Cheers,