https://infracost.io logo
#help
Title
# help
h

happy-father-98665

12/18/2023, 7:37 AM
hey team, I am trying to use the Infracost pricing api to get cost of node instance. But I am facing few mismatch in the pricing publicly available and the pricing being returned by the api. Can anyone please help me with this? Request:
Copy code
query {
  products(
    filter: {
      vendorName: "gcp"
      region: "europe-west4"
      attributeFilters: [{ key: "machineType", value: "a2-highgpu-1g" }]
    }
  ) {
    prices {
      USD
    }
  }
}
Response:
Copy code
{
  "data": {
    "products": [
      {
        "prices": [
          {
            "USD": "0.814064"
          },
          {
            "USD": "0.32565"
          }
        ]
      }
    ]
  }
}
But according to GCP https://gcloud-compute.com/a2-highgpu-1g.html it should be around
3.6734
and `1.2058`USD
l

little-author-61621

12/18/2023, 2:16 PM
Thanks @happy-father-98665, yeah this looks wrong. I’ll have a look into it.
@happy-father-98665 we have a fix for this released now, let me know if you are still seeing issues.
h

happy-father-98665

01/07/2024, 7:43 PM
Thanks a lot @little-author-61621 I checked, but I am still getting the same response for the above query. Can you please check if the changes are released for this endpoint
<https://pricing.api.infracost.io/graphql>
l

little-author-61621

01/08/2024, 9:04 PM
@happy-father-98665 it’s working for me now. If you use the following query with the
service
and
productFamily
filters as well it improve the performance:
Copy code
query {
  products(
    filter: {
      vendorName: "gcp"
      region: "europe-west4"
      service: "Compute Engine"
      productFamily: "Compute Instance"
      attributeFilters: [{ key: "machineType", value: "a2-highgpu-1g" }]
    }
  ) {
    prices {
      USD
    }
  }
}
h

happy-father-98665

01/08/2024, 9:06 PM
Thanks a lot @little-author-61621, now its working for me as well
3 Views