Последние сделки инсайдеров для выбранной биржи

Чтобы получить последние сделки, нужно использовать входную точку "insider-transaction":

https://tr.porti.ru/xapi/macro/insider-transaction?code=MOEX&token=⟨ТОКЕН⟩&format=json
curl --location "https://tr.porti.ru/xapi/macro/insider-transaction?code=MOEX&token=⟨ТОКЕН⟩&format=json"
import requests url = f'https://tr.porti.ru/xapi/macro/insider-transaction?code=MOEX&token=⟨ТОКЕН⟩&format=json' data = requests.get(url).json() print(data)
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://tr.porti.ru/xapi/macro/insider-transaction?code=MOEX&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://tr.porti.ru/xapi/macro/insider-transaction?code=MOEX&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:
{ time: "1726002000", disclosure_time: "1726088400", type: "1", price: "190.27", volume: "424302", count: "2230", insider: "ВУШ Холдинг", insider_role: "Эмитент", link: "https://www.e-disclosure.ru/portal/event.aspx?EventId=voGV9olPW0-C-CHeQPWzQGYA-B-B", shares_percentage_before: "0.64", shares_percentage_after: "0.64", holders: [ { code: "MOEX:WUSH", title: "Вуш Холдинг | WHOOSH", type: "company" } ] }, { time: "1725310800", disclosure_time: "1725915600", type: "1", price: "86.78", volume: "1562040", count: "18000", insider: "Страховая Компания "Ренессанс Жизнь"", insider_role: "Стратегический инвестор", link: "https://www.e-disclosure.ru/portal/event.aspx?EventId=VRFJk0FxJkKATHmGbutQzA-B-B", shares_percentage_before: "10.53", shares_percentage_after: "10.54", holders: [ { code: "MOEX:RENI", title: "Ренессанс Страхование", type: "company" } ] }
Параметры:
  1. token (обязательный) - токен получаемый при оформлении подписки (подписка API)
  2. code (обязательный) - код биржи для которой получаются сделки, например MOEX
  3. format (не обязательный) - допустимые значения: json, csv. json - представление данных в формате json, csv - текстовый формат с разделителем.