This message was deleted.
# contributors
b
This message was deleted.
w
Running a distinct on mongo is probably easier, we use to have bash scripts that we used to find the product family but no one used them after we switched to using mongo queries:
Copy code
#!/bin/sh
echo "List of Product Families for $1:"
gq <https://pricing.api.infracost.io/graphql> -H "x-api-key: $INFRACOST_API_KEY" -q "
query {
    products (
    filter: {
      vendorName: \"aws\"
      region: \"us-east-1\"
      service: \"$1\"
    }
  ){
        productFamily
    }
}" | jq '.data.products | map ({ (.productFamily): .__typename} ) | add' | jq "keys"
l
^ bear in mind that the API results are limited to 1000 rows, so if that won't even necessarily find all distinct values
🤓 1
p
So I was lucky! I always set the region and get all product families and search for possible combinations 😂