Простой доступ к API фундаментальных данных для акций, облигаций, ETF с разных бирж и стран. Почти все основные биржи России, США, ЕС, Индии и Азии.
Чтобы получить фундаментальные данные для выбранного тикера, нужно использовать входную точку "fundamental":
https://pt.porti.ru/xapi/company/fundamental?code=MOEX:GAZP&token=〈ТОКЕН〉&format=json
curl --location "https://pt.porti.ru/xapi/company/fundamental?code=MOEX:GAZP&token=〈ТОКЕН〉&format=json"
import requests
url = f'https://pt.porti.ru/xapi/company/fundamental?code=MOEX:GAZP&token=〈ТОКЕН〉&format=json'
data = requests.get(url).json()
print(data)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://pt.porti.ru/xapi/company/fundamental?code=MOEX:GAZP&token=〈ТОКЕН〉&format=json',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$data = curl_exec($curl);
curl_close($curl);
try {
$data = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
var_dump($data);
} catch (Exception $e) {
echo 'Error. '.$e->getMessage();
}
library(httr)
library(jsonlite)
url <- 'https://pt.porti.ru/xapi/company/fundamental?code=MOEX:GAZP&token=〈ТОКЕН〉&format=json'
response <- GET(url)
if (http_type(response) == "application/json") {
content <- content(response, "text", encoding = "UTF-8")
cat(content)
} else {
cat("Error while receiving data\n")
}
Пример полученных данных с использованием этого API:
{
common: {
code: "MOEX:GAZP",
title: "Газпром",
description: "Публичное акционерное общество «Газпром»....",
figi: "BBG004730RP0",
currency: "rub",
report_currency: "rub",
industry: "Oil & Gas Integrated",
sector: "Energy",
category: "Нефтегаз",
ipodate: "1999-10-05",
link: "https://www.gazprom.com",
address: {
Street: "16 Nametkina Street",
City: "Moscow 117997",
Country: "Russia",
Phone: "7 495 719 3001",
Index: "117997",
Countryiso: "RU"
},
rating: {
credit_rating_qualify_akra: "AAA(RU)",
credit_rating_qualify_expert: "ruAAA",
credit_rating_qualify_fitch: "BBB",
credit_rating_qualify_moody: "Baa2",
credit_rating_qualify_sp: "BBB"
},
isin: "RU0007661625",
exchanges: [
"MOEX"
],
{
annual: {
balance: {
"2024": {
amortization: "1378.0",
assets: "30698",
cash: "279.9",
cost_of_production: "4812",
debt: "6715",
interest_expense: "715.4",
inventory: "1305.559",
liabilities: "13037.293",
long_term_debt: "5292.754",
net_assets: "16711",
net_debt: "5723",
receivables: "3373.19",
short_term_debt: "1422.056000",
total_current_assets: "4368.456"
},
}
}
}
}
Параметры:
token (обязательный) - токен получаемый при оформлении подписки (подписка API )
code (обязательный) - тикер актива цены которого нужно получить. Можно использовать полный формат: MOEX:GAZP (рекомендуется, так как один и тот же тикер может принадлежать разным активам с разных бирж), так и краткий формат: GAZP
format (не обязательный) - допустимые значения: json, csv, excel. json - представление данных в формате json, csv - текстовый формат с разделителем, excel - файл в формате Excel.
Чтобы получить для облигаций и ETF надо использовать похожее API.
Для облигаций:
https://pt.porti.ru/xapi/bond/fundamental?code=SU26248RMFS3&token=〈ТОКЕН〉&format=json
Для ETF:
https://pt.porti.ru/xapi/etf/fundamental?code=MOEX:LQDT&token=〈ТОКЕН〉&format=json