Undocumented: OCI Pricelist API

By | January 22, 2020

I am working on a project that needs to know the prices of the OCI Services. After some digging (thank you Google), I stumbled on this webpage: https://www.oracle.com/cloud/ucpricing.html

This page gives a great overview of all the services and the prices (list prices, without special discounts). I noticed the page loads the prices, so thru some reverse AJEX engineering I came across the webservice responsible for providing the data. The below examples return JSON data!

Pricing details on a single Service

To request the pricing information for a single service, you can use the service partNumer. For example partnumber B88514 is for Compute – Virtual Machine Standard – X7. https://itra.oraclecloud.com/itas/.anon/myservices/api/v1/products?partNumber=B88514

besides using the service partnumber, you can also use the product ID if you know it:
https://itra.oraclecloud.com/itas/.anon/myservices/api/v1/products/10089

Pricing details on all services

You can use the parentProductPartNumber to get pricing details on all services. Below the example using the B88206 product group for universal credits.

https://itra.oraclecloud.com/itas/.anon/myservices/api/v1/products?parentProductPartNumber=B88206&limit=500

Specifying the currency

If you want to be able to control the currency of the reported prices, you have to provide a special header field in the request, example:

X-Oracle-Accept-CurrencyCode: USD
or
X-Oracle-Accept-CurrencyCode: EUR

Example in python:

import requests

url = "https://itra.oraclecloud.com/itas/.anon/myservices/api/v1/products?parentProductPartNumber=B88206&limit=300"
resp = requests.get(url, headers={'X-Oracle-Accept-CurrencyCode': 'EUR'})

for item in resp.json()['items']:
print ("{} - {}".format(item["displayName"], item["prices"]))

8 thoughts on “Undocumented: OCI Pricelist API

  1. Jon-Eric Eliker

    Hi Richard. I wonder if you have found an API call for a Cloud Account that includes SKUs? I have been searching for this finding that the usage report APIs include SKUs but I hope to find one related to entitlements. After all, the usage report only shows the usage and SKU if you have actually used a portion of the resource—I would like to report on what SKUs _might_ get used. Thank you for your thoughts.

    Reply
  2. Jon-Eric Eliker

    Not exactly. Probably closer to this https://docs.oracle.com/en/cloud/get-started/subscriptions-cloud/meter/op-api-v1-usagecost-accountid-get.html and this https://docs.oracle.com/en/cloud/get-started/subscriptions-cloud/meter/op-api-v1-checkquota-accountid-get.html together. 🙂

    You’ll see in those examples where gsiProductId is part of the usage cost results and the full list of services/resources/quantities is available from the quota quota results. I’m hoping to find something to report all “product IDs” available in a quota whereas the default result has only resource “names” (e.g. I want B90425 not just PIC_COMPUTE_STANDARD_E2).

    Thank you for your reply!

    Reply
  3. Pingback: OCI Rate Card Utility – Oracle Cloud Blog

  4. Clarence Ondieki

    Hi Richard,

    This is great, thank you for building this. I was interested in also getting specs of the services in addition to the pricing, ie for compute, get ocpu, memory, network bandwidth etc. I can see these are not exposed on the api endpoint. Can you share the webservice so we can verify if we can pull those as well? Thank you!

    Reply
  5. Andrew Pickles

    Hi Richard – have you noticed that the API has not been updated since November and does not bring back new products such as Exadata X8M and flexible load balancers ?

    The UC Pricing page at Oracle seams to be have the latest information so can you see if the API URI has changed or not ? I don’t have the skills to reverse engineer the link.

    Thanks

    Reply
      1. Andrew Pickles

        Cool that seams to be the Prices assigned to each Part code.
        Can you see the list of Products and Part Codes in another URI location?

        It would be just much easier if they updated the API and made it available in one place.

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.