I'm changing correctly the api key in the example ...
# help
g
I'm changing correctly the api key in the example curl request. I also checked my API KEY is not legacy (starts with ICO)
w
The API is available, can you plz check the curl as sometimes the single or double quotes get changed when pasted in the terminal
Copy code
curl <https://pricing.api.infracost.io/graphql> \
  -X POST \
  -H 'X-Api-Key: ico-xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  --data '
  {"query": "{ products(filter: {vendorName: \"aws\", service: \"AmazonEC2\", productFamily: \"Compute Instance\", region: \"us-east-1\", attributeFilters: [{key: \"instanceType\", value: \"m3.large\"}, {key: \"operatingSystem\", value: \"Linux\"}, {key: \"tenancy\", value: \"Shared\"}, {key: \"capacitystatus\", value: \"Used\"}, {key: \"preInstalledSw\", value: \"NA\"}]}) { prices(filter: {purchaseOption: \"on_demand\"}) { USD } } } "}
  '
Response:
Copy code
{
  "data": {
    "products": [
      {
        "prices": [
          {
            "USD": "0.1330000000"
          }
        ]
      }
    ]
  }
}
g
I got it working, just not in the terminal, I did it in code. Thank you