Hi @Jesus Chao ,
Thanks for reaching out!
You can use below the API to get the site by searching the sitename,
https://graph.microsoft.com/v1.0/sites?search="NameofSite"
In PowerShell use the below command,
Get-MgSite -Search "NameofSite"
To get server-relative URL for a site resource, you can construct a request as GET /sites/{hostname}:/{server-relative-path
}, refer access-a-site-by-server-relative-url
Listing all the sites is supported only in application permissions, reference link: List Sites.
Hope this helps.
If the reply is helpful, please click Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".