Hello,
You would want to use the following (Gets all the resource groups for a subscription by tag):
GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups?api-version=2021-04-01&$filter=tagname eq 'tagvalue'
Cited from https://learn.microsoft.com/en-us/rest/api/resources/resource-groups/list
If this is helpful please accept answer.