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

gifted-ice-56627

12/01/2023, 6:51 PM
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

white-airport-8778

12/01/2023, 9:44 PM
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

gifted-ice-56627

12/05/2023, 8:12 PM
I got it working, just not in the terminal, I did it in code. Thank you