Are there any API's for Amazon Web Services PRICING?

Viewed 19967

Are there any API's that have up-to-date pricing on Amazon Web Services? Something that can be queried, for example, for the latest price S3 for a given region, or EC2, etc.

thanks

12 Answers

For the people who wanted to use the data from the amazon api who uses things like "t1.micro" here is a translation array

type_translation = {
    'm1.small' : ['stdODI', 'sm'],
    'm1.medium' : ['stdODI', 'med'],
    'm1.large' : ['stdODI', 'lg'],
    'm1.xlarge' : ['stdODI', 'xl'],
    't1.micro' : ['uODI', 'u'],
    'm2.xlarge' : ['hiMemODI', 'xl'],
    'm2.2xlarge' : ['hiMemODI', 'xxl'],
    'm2.4xlarge' : ['hiMemODI', 'xxxxl'],
    'c1.medium' : ['hiCPUODI', 'med'],
    'c1.xlarge' : ['hiCPUODI', 'xl'],
    'cc1.4xlarge' : ['clusterComputeI', 'xxxxl'],
    'cc2.8xlarge' : ['clusterComputeI', 'xxxxxxxxl'],
    'cg1.4xlarge' : ['clusterGPUI', 'xxxxl'],
    'hi1.4xlarge' : ['hiIoODI', 'xxxx1']
}
region_translation = {
    'us-east-1' : 'us-east',
    'us-west-2' : 'us-west-2',
    'us-west-1' : 'us-west',
    'eu-west-1' : 'eu-ireland',
    'ap-southeast-1' : 'apac-sin',
    'ap-northeast-1' : 'apac-tokyo',
    'sa-east-1' : 'sa-east-1'
}

I've create a quick & dirty API in Python for accessing the pricing data in those JSON files and converting it to the relevant values (the right translations and the right instance types).

You can get the code here: https://github.com/erans/ec2instancespricing

And read a bit more about it here: http://forecastcloudy.net/2012/04/03/quick-dirty-api-for-accessing-amazon-web-services-aws-ec2-pricing-data/

You can use this file as a module and call the functions to get a Python dictionary with the results, or you can use it as a command line tool to get the output is a human readable table, JSON or CSV to use in combination with other command line tools.

Related