With the SFAPI, use a query like this:
query GetProduct($id: ID!) {
product(id: $id) {
collections(first: 250) {
nodes {
title
description
# ...more data as needed
}
}
}
}
And the variable:
{
"id": "gid://shopify/Product/123"
}
On the admin panel, you can install the GraphiQL app to test both Storefront and Admin api: https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/api-exploration/graphiql-storefront-api