Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>UPDATE:</strong></p> <p>AWS has pricing API nowadays: <a href="https://aws.amazon.com/blogs/aws/new-aws-price-list-api/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/aws/new-aws-price-list-api/</a></p> <p><strong>Original answer:</strong></p> <p>This is something I have asked for (via AWS evangelists and surveys) previously, but hasn't been forthcoming. I guess the AWS folks have more interesting innovations on their horizon.</p> <p>As pointed out by @brokenbeatnik, there is an API for spot-price history. API docs here: <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSpotPriceHistory.html" rel="nofollow noreferrer">http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSpotPriceHistory.html</a></p> <p>I find it odd that the spot-price history has an <em>official</em> API, but that they didn't do this for on-demand services at the same time. Anyway, to answer the question, <strong>yes you can query the <em>advertised</em> AWS pricing</strong>...</p> <p>The best I can come up with is from examining the (client-side) source of the various services' pricing pages. Therein you'll find that the tables are built in JS and populated with JSON data, data that you can GET yourself. E.g.:</p> <ul> <li><a href="http://aws.amazon.com/ec2/pricing/pricing-on-demand-instances.json" rel="nofollow noreferrer">http://aws.amazon.com/ec2/pricing/pricing-on-demand-instances.json</a></li> <li><a href="http://aws.amazon.com/s3/pricing/pricing-storage.json" rel="nofollow noreferrer">http://aws.amazon.com/s3/pricing/pricing-storage.json</a></li> </ul> <p>That's only half the battle though, next you have to pick apart the object format to get at the values you want, e.g., in Python this gets the Hi-CPU On-Demand Extra-Large Linux Instance pricing for Virginia:</p> <pre><code>&gt;&gt;&gt; import json &gt;&gt;&gt; import urllib2 &gt;&gt;&gt; response = urllib2.urlopen('http://aws.amazon.com/ec2/pricing/pricing-on-demand-instances.json') &gt;&gt;&gt; pricejson = response.read() &gt;&gt;&gt; pricing = json.loads(pricejson) &gt;&gt;&gt; pricing['config']['regions'][0]['instanceTypes'][3]['sizes'][1]['valueColumns'][0]['prices']['USD'] u'0.68' </code></pre> <p>Disclaimer: Obviously this is not an AWS sanctioned API and as such I wouldn't recommend expecting stability of the data format or even continued existence of the source. But it's there, and it beats transcribing the pricing data into static config/source files!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload