sharepoint online – How can I get parent guid of an item?

I have a list with items in SharePoint Online. There many items and their structure look like a tree.

list/
    itemA/
    itemB/
          itemBa/
                 itemX
          itemBb/
                 itemY
          itemBc/
    itemC/

How can I get a guid of the itemBa by REST or GraphAPI? (for example)