[metadata]
asset_id: api/cost-management/retail-prices/azure-retail-prices
author: vikramdesai01
breadcrumb_path: ../../../breadcrumb/toc.json
cmProducts: https://authoring-docs-microsoft.poolparty.biz/devrel/1d9b4802-f23d-41f1-9e27-65deeceacb8d
color-scheme: light dark
depot_name: Azure.AzureRestApi
description: This article provides operations information to help you to programmatically get Azure service retail prices.
enable_rest_try_it: true
feedback_system: None
git_commit_id: de6b152c15ece5c9525b925fce0240f31547c02a
gitcommit: https://github.com/MicrosoftDocs/azure-docs-rest-apis/blob/de6b152c15ece5c9525b925fce0240f31547c02a/docs-ref-conceptual/cost-management/retail-prices/azure-retail-prices.md
github_feedback_content_git_url: https://github.com/MicrosoftDocs/azure-docs-rest-apis/blob/main/docs-ref-conceptual/cost-management/retail-prices/azure-retail-prices.md
item_type: Content
locale: en-us
manager: smmark
markdown_url: https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices?accept=text/markdown
moniker_definition_rel: ../../../.monikers.Azure.AzureRestApi.json
ms.author: vikramdesai
ms.date: 2024-08-06T00:00:00Z
ms.devlang: rest-api
ms.reviewer: minminx
ms.service: cost-management-billing
ms.subservice: cost-management
ms.topic: reference
og:description: This article provides operations information to help you to programmatically get Azure service retail prices.
og:image: https://learn.microsoft.com/en-us/media/open-graph-image.png
og:image:alt: Microsoft Learn
og:title: Azure Retail Prices REST API overview
og:type: website
og:url: https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices
original_content_git_url: https://github.com/MicrosoftDocs/azure-docs-rest-apis/blob/live/docs-ref-conceptual/cost-management/retail-prices/azure-retail-prices.md
page_type: conceptual
platform_id: f1a204ca-4d20-9b35-3028-1f75a9c07268
previous_tlsh_hash: 69915AC1740ED321BF451E076ADACE8495F146EE6EB21EDC14266BB7A00D5E369F9015BACE5AB15453B292530292FC0D46C5BFBE4C3437E68307DAAD41291313E1FDB360AC
products: https://authoring-docs-microsoft.poolparty.biz/devrel/1d9b4802-f23d-41f1-9e27-65deeceacb8d
rest_product: Azure
schema: Conceptual
scope: Azure,REST
site_name: Docs
source_path: docs-ref-conceptual/cost-management/retail-prices/azure-retail-prices.md
spProducts: https://authoring-docs-microsoft.poolparty.biz/devrel/820483fb-3aa1-4b86-bc99-9a906a24f579
toc_rel: ../../azure/toc.json
twitter:card: summary_large_image
twitter:site: @MicrosoftLearn
uhfHeaderId: azure
updated_at: 2026-01-06T22:15:00Z
viewport: width=device-width, initial-scale=1.0
word_count: 1291

[canonical-links]
https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices

[document-links]
AI Disclaimer: https://learn.microsoft.com/en-us/principles-for-ai-generated-content
Azure savings plans documentation: /en-us/azure/cost-management-billing/savings-plan/
Blog: https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog
Consumer Health Privacy: https://go.microsoft.com/fwlink/?linkid=2259814
Contribute: https://learn.microsoft.com/en-us/contribute
Cost Management APIs: ../
Download Microsoft Edge: https://go.microsoft.com/fwlink/p/?LinkID=2092881
Edit: https://github.com/MicrosoftDocs/azure-docs-rest-apis/blob/main/docs-ref-conceptual/cost-management/retail-prices/azure-retail-prices.md
More info about Internet Explorer and Microsoft Edge: https://learn.microsoft.com/en-us/lifecycle/faq/internet-explorer-microsoft-edge
Previous Versions: https://learn.microsoft.com/en-us/previous-versions/
Privacy: https://go.microsoft.com/fwlink/?LinkId=521839
Supported currencies: /en-us/azure/cost-management-billing/microsoft-customer-agreement/microsoft-customer-agreement-faq#how-is-azure-priced-under-the-microsoft-customer-agreement
Terms of Use: https://learn.microsoft.com/en-us/legal/termsofuse
Trademarks: https://www.microsoft.com/legal/intellectualproperty/Trademarks/
Your Privacy Choices: https://aka.ms/yourcaliforniaprivacychoices
https://prices.azure.com/api/retail/prices: https://prices.azure.com/api/retail/prices
https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview: https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview

[content]
Azure Retail Prices REST API overview | Microsoft Learn
Skip to main content
Skip to Ask Learn chat experience
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
Table of contents
Exit editor mode
Ask Learn
Ask Learn
Reading mode
Table of contents
Read in English
Add
Add to Plans
Edit
Copy Markdown
Print
Note
Access to this page requires authorization. You can try
signing in
or
changing directories
.
Access to this page requires authorization. You can try
changing directories
.
Azure Retail Prices overview
Feedback
Summarize this article for me
In this article
Azure customers have been looking for a programmatic way to retrieve retail prices for all Azure services. Now you can use the Retail Rates Prices API to get retail prices for all Azure services. Previously, the only way that you could retrieve prices for Azure services was to either use the Azure Pricing Calculator or use the Azure portal. This API gives you an unauthenticated experience to get retail rates for all Azure services. Use the API to explore prices for Azure services against different regions and different SKUs. The programmatic API can also help you create your own tools for internal analysis and price comparison across SKUs and regions.
Important
The currency that Microsoft uses to price all Azure services is USD. Prices shown in USD currency are Microsoft retail prices. Other non-USD prices returned by the API are for your reference to help you estimate budget expenses.
Preview version
You can use the new 2023-01-01-preview API version at
https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview
. The preview version is backward compatible with previous API versions. The URL returns the full set of meters, including primary meters and nonprimary meters.
Using either
https://prices.azure.com/api/retail/prices
or
https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview
returns the full set of meters.
Rates for savings plans are only available with the
https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview
version.
Primary meter filtering
You can limit responses to retrieve only primary meter prices with:
https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview&meterRegion='primary'
Primary meter filtering is supported with
2021-10-01
and later API versions including
2023-01-01
.
Filter value is case sensitive
In previous API versions, the filter value wasn't case sensitive. However, in the
2023-01-01-preview
version and later, the value is case sensitive.
For example:
https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines'
works.
In earlier API versions,
Virtual Machines
and
virtual machines
worked.
Now, only
Virtual Machines
works.
Azure saving plan support
As previously mentioned, Azure savings plan retail prices are only supported with the preview version (
https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview
). For the meters eligible for a savings plan, results have a corresponding section for savings plan. When you commit to a savings plan, you get a cheaper price than the
OnDemand
price. For more information about Azure savings plans, see
Azure savings plans documentation
.
Here's an example API response with savings plan information:
{ "currencyCode": "USD", "tierMinimumUnits": 0.0, "retailPrice": 2.305, "unitPrice": 2.305, "armRegionName": "southindia", "location": "IN South", "effectiveStartDate": "2019-05-14T00:00:00Z", "meterId": "0084b086-37bf-4bee-b27f-6eb0f9ee4954", "meterName": "M8ms", "productId": "DZH318Z0BQ4W", "skuId": "DZH318Z0BQ4W/00BQ", "availabilityId": null, "productName": "Virtual Machines MS Series", "skuName": "M8ms", "serviceName": "Virtual Machines", "serviceId": "DZH313Z7MMC8", "serviceFamily": "Compute", "unitOfMeasure": "1 Hour", "type": "Consumption", "isPrimaryMeterRegion": true, "armSkuName": "Standard_M8ms", "savingsPlan": [ { "unitPrice": 0.8065195, "retailPrice": 0.8065195, "term": "3 Years" }, { "unitPrice": 1.5902195, "retailPrice": 1.5902195, "term": "1 Year" } ] },
API endpoint
https://prices.azure.com/api/retail/prices
API sample calls
Here are some examples:
Example calls filtered for only virtual machines:
https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines'
Example calls filtered for only reservations:
https://prices.azure.com/api/retail/prices?$filter=priceType eq 'Reservation'
Example calls filtered for reserved instance virtual machines:
https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines' and priceType eq 'Reservation'
Example calls filtered for compute resources:
https://prices.azure.com/api/retail/prices?$filter=serviceFamily eq 'Compute'
You can append the currency code to the API endpoint, as shown in the API sample call. For a complete list of supported currencies, see
Supported currencies
.
Example calls filtered for compute with currency in euro:
https://prices.azure.com/api/retail/prices?currencyCode='EUR'&$filter=serviceFamily eq 'Compute'
API response examples
Here's a sample API response, without reservation prices.
{ "currencyCode": "USD", "tierMinimumUnits": 0.0, "retailPrice": 0.176346, "unitPrice": 0.176346, "armRegionName": "westeurope", "location": "EU West", "effectiveStartDate": "2020-08-01T00:00:00Z", "meterId": "000a794b-bdb0-58be-a0cd-0c3a0f222923", "meterName": "F16s Spot", "productId": "DZH318Z0BQPS", "skuId": "DZH318Z0BQPS/00TG", "productName": "Virtual Machines FS Series Windows", "skuName": "F16s Spot", "serviceName": "Virtual Machines", "serviceId": "DZH313Z7MMC8", "serviceFamily": "Compute", "unitOfMeasure": "1 Hour", "type": "DevTestConsumption", "isPrimaryMeterRegion": true, "armSkuName": "Standard_F16s" }
Here's a sample API response with reservation prices and term in the response.
{ "currencyCode": "USD", "tierMinimumUnits": 0.0, "reservationTerm": "1 Year", "retailPrice": 25007.0, "unitPrice": 25007.0, "armRegionName": "southcentralus", "location": "US South Central", "effectiveStartDate": "2020-08-01T00:00:00Z", "meterId": "0016083a-928f-56fd-8eeb-39287dcf676d", "meterName": "E64 v4", "productId": "DZH318Z0D1L7", "skuId": "DZH318Z0D1L7/018J", "productName": "Virtual Machines Ev4 Series", "skuName": "E64 v4", "serviceName": "Virtual Machines", "serviceId": "DZH313Z7MMC8", "serviceFamily": "Compute", "unitOfMeasure": "1 Hour", "type": "Reservation", "isPrimaryMeterRegion": true, "armSkuName": "Standard_E64_v4" }
Here's a sample response with a non-USD currency.
{ "currencyCode": "EUR", "tierMinimumUnits": 0, "retailPrice": 0.6176, "unitPrice": 0.6176, "armRegionName": "westeurope", "location": "EU West", "effectiveStartDate": "2021-04-01T00:00:00Z", "meterId": "000a794b-bdb0-58be-a0cd-0c3a0f222923", "meterName": "F16s Spot", "productId": "DZH318Z0BQPS", "skuId": "DZH318Z0BQPS/00TG", "productName": "Virtual Machines FS Series Windows", "skuName": "F16s Spot", "serviceName": "Virtual Machines", "serviceId": "DZH313Z7MMC8", "serviceFamily": "Compute", "unitOfMeasure": "1 Hour", "type": "Consumption", "isPrimaryMeterRegion": true, "armSkuName": "Standard_F16s" }
API response pagination
The API response provides pagination. For each API request, a maximum of 1,000 records are returned. At the end of the API response, it has the link to next page. For example:
"NextPageLink": https://prices.azure.com:443/api/retail/prices?$filter=serviceName%20eq%20%27Virtual%20Machines%27&$skip=1000
API property details
Here's all the property details that are a part of the API response.
Field
Example Values
Definition
currencyCode
USD
The currency in which rates are defined and returns prices in USD unless specified.
tierMinimumUnits
0
Minimum units of consumption to avail the price
reservationTerm
1 year
Reservation term – one year or three years
retailPrice
0.176346
Microsoft Retail Prices without discount
unitPrice
0.176346
Same as
retailPrice
armRegionName
westeurope
Azure Resource Manager region where the service is available. This version only supports prices on Commercial Cloud.
Location
EU West
Azure data center where the resource is deployed
effectiveStartDate
2020-08-01T00:00:00Z
Optional field. Shows the date when the retail prices are effective.
meterId
000a794b-bdb0-58be-a0cd-0c3a0f222923
Unique identifier of the resource
meterName
F16s Spot
Name of the meter
productid
DZH318Z0BQPS
UniqueID of the product
skuId
DZH318Z0BQPS/00TG
UniqueID for the SKU
productName
Virtual Machines FS Series Windows
Product name
skuName
F16s Spot
SKU name
serviceName
Virtual Machines
Name of the service
serviceId
DZH313Z7MMC8
UniqueID of the service
serviceFamily
Compute
Service family of the SKU
unitOfMeasure
1 Hour
How usage is measured for the service
Type
DevTestConsumption
Meter consumption type. Other types are
Reservation
and
Consumption
.
isPrimaryMeterRegion
True
Indicates whether the meter region is set as a primary meter or not. Primary meters are used for charges and billing.
armSkuName
Standard_F16s
SKU name registered in Azure
term
3 Years
Term length for an Azure savings plan, associated with
savingsPlan
information.
API filters
Filters are supported for the following fields:
armRegionName
Location
meterId
meterName
productid
skuId
productName
skuName
serviceName
serviceId
serviceFamily
priceType
armSkuName
You append the filters to the API endpoint, as shown in the API sample calls.
Supported serviceFamily values
The following information is the list of supported
serviceFamily
values. The information is subject to change.
Analytics Azure Arc Azure Communication Services Azure Security Azure Stack Compute Containers Data Databases Developer Tools Dynamics Gaming Integration Internet of Things Management and Governance Microsoft Syntex Mixed Reality Networking Other Power Platform Quantum Computing Security Storage Telecommunications Web Windows Virtual Desktop
Programmatic Example
The following simple python application employs the API to query the retail spot pricing of a virtual machine of the standard NP20 SKU in the South Central US region. The application filters the output of the query and presents the desired information in a table format.
#!/usr/bin/env python3 import requests import json from tabulate import tabulate def build_pricing_table(json_data, table_data): for item in json_data['Items']: meter = item['meterName'] table_data.append([item['armSkuName'], item['retailPrice'], item['unitOfMeasure'], item['armRegionName'], meter, item['productName']]) def main(): table_data = [] table_data.append(['SKU', 'Retail Price', 'Unit of Measure', 'Region', 'Meter', 'Product Name']) api_url = "https://prices.azure.com/api/retail/prices?api-version=2021-10-01-preview" query = "armRegionName eq 'southcentralus' and armSkuName eq 'Standard_NP20s' and priceType eq 'Consumption' and contains(meterName, 'Spot')" response = requests.get(api_url, params={'$filter': query}) json_data = json.loads(response.text) build_pricing_table(json_data, table_data) nextPage = json_data['NextPageLink'] while(nextPage): response = requests.get(nextPage) json_data = json.loads(response.text) nextPage = json_data['NextPageLink'] build_pricing_table(json_data, table_data) print(tabulate(table_data, headers='firstrow', tablefmt='psql')) if __name__ == "__main__": main()
Running this code produces the following output:
+----------------+----------------+-------------------+----------------+------------+------------------------------------+ | SKU | Retail Price | Unit of Measure | Region | Meter | Product Name | |----------------+----------------+-------------------+----------------+------------+------------------------------------| | Standard_NP20s | 0.828503 | 1 Hour | southcentralus | NP20s Spot | Virtual Machines NP Series Windows | | Standard_NP20s | 0.448207 | 1 Hour | southcentralus | NP20s Spot | Virtual Machines NP Series | +----------------+----------------+-------------------+----------------+------------+------------------------------------+
Next steps
Learn about other
Cost Management APIs
.
Additional resources
Last updated on
2024-08-07
In this article
en-us
Your Privacy Choices
Theme
Light
Dark
High contrast
AI Disclaimer
Previous Versions
Blog
Contribute
Privacy
Consumer Health Privacy
Terms of Use
Trademarks
© Microsoft 2026
