In case of GET "/rest/V1/products/{sku}" endpoint, in response you should see something like this:
{
"id": 9,
"sku": "24-WB02",
"name": "Compete Track Tote",
...
"extension_attributes": {
"website_ids": [
1
],
"category_links": [
{
"position": 0,
"category_id": "3"
},
{
"position": 0,
"category_id": "4"
}
]
},
"product_links": [],
"options": [],
"media_gallery_entries": [ ],
"tier_prices": [],
"custom_attributes": []
}
So you need just decode response and check [extension_attributes][category_links] list.