Hi @harryK9
Hope you are doing well.
You can use Microsoft Search API to search across multiple SharePoint Sites.
However, if you are looking for a way to limit your search to few mentioned sites, then you can refer this below sample request.
POST /search/query
{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "sample AND (Path:https://contoso.sharepoint.com/sites/sitename1 OR Path:https://contoso.sharepoint.com/sites/sitename2 OR Path:https://contoso.sharepoint.com/sites/sitename3)"
}
}
]
}
You can also refer to this answer posted by me.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.