Get Key Ratiosโ
API to retrieve the key financial ratios for a company identified by its ISIN. Each ratio includes the company's current value alongside a sector benchmark value, enabling relative valuation comparisons. Ratios returned include P/E, P/B, ROA, ROE, ROCE, and EV/EBITDA.
Path Parametersโ
| Name | Required | Type | Description |
|---|---|---|---|
| isin | true | string | International Securities Identification Number (ISIN) of the company. Example: INE002A01018. |
Requestโ
curl --location 'https://api.upstox.com/v2/fundamentals/INE002A01018/key-ratios' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
For additional samples in various languages, please refer to the Sample code section on this page.
Responses
- 200
- 4XX
Response Bodyโ
{
"status": "success",
"data": [
{ "name": "P/E", "company_value": "20.15", "sector_value": "12.46" },
{ "name": "P/B", "company_value": "2.13", "sector_value": "1.53" },
{ "name": "ROA", "company_value": "4.39%", "sector_value": "7.54%" },
{ "name": "ROE", "company_value": "8.94%", "sector_value": "16.46%" },
{ "name": "ROCE", "company_value": "10.39%", "sector_value": "16.9%" },
{ "name": "EV/EBITDA", "company_value": "10.25", "sector_value": "6.94" }
]
}
| Name | Type | Description |
|---|---|---|
| status | string | A string indicating the outcome of the request. Possible values: success, error. |
| data | array | List of key financial ratio entries. |
| data[].name | string | Name of the financial ratio. Possible values: P/E, P/B, ROA, ROE, ROCE, EV/EBITDA. |
| data[].company_value | string | Current value of the ratio for the requested company. |
| data[].sector_value | string | Sector benchmark value for the same ratio. |
Ratio definitions:
| Ratio | Description |
|---|---|
| P/E | Price-to-Earnings ratio โ market price per share divided by earnings per share. |
| P/B | Price-to-Book ratio โ market price per share divided by book value per share. |
| ROA | Return on Assets โ net income as a percentage of total assets. |
| ROE | Return on Equity โ net income as a percentage of shareholders' equity. |
| ROCE | Return on Capital Employed โ EBIT as a percentage of capital employed. |
| EV/EBITDA | Enterprise Value divided by Earnings Before Interest, Taxes, Depreciation, and Amortisation. |
Error codesโ
| Error code | Description |
|---|---|
| UDAPI1206 | Invalid ISIN - The provided ISIN is invalid. |
Sample Codeโ
- Python
- Node.js
- Java
- PHP
import requests
url = 'https://api.upstox.com/v2/fundamentals/INE002A01018/key-ratios'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
axios.get('https://api.upstox.com/v2/fundamentals/INE002A01018/key-ratios', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
}).then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetKeyRatios {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://api.upstox.com/v2/fundamentals/INE002A01018/key-ratios"))
.header("Accept", "application/json")
.header("Authorization", "Bearer {your_access_token}")
.GET()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = 'https://api.upstox.com/v2/fundamentals/INE002A01018/key-ratios';
$headers = [
'Accept: application/json',
'Authorization: Bearer {your_access_token}'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_errno($ch) ? print('Error: ' . curl_error($ch)) : print($response);
curl_close($ch);
?>
Loading...