leviathan-docs

Leviathan API

Leviathan is a powerful asynchronous stock and financial data API built with FastAPI. It integrates multiple data sources to provide essential financial metrics and company information.

Description

Features


Endpoints Overview

Stock Endpoints /api/v1/stock

Method Endpoint Description
GET / Basic welcome message
GET /total-shares Get total outstanding shares
GET /pe-ratio Get Price-to-Earnings ratio
GET /price-book-ratio Get Price-to-Book ratio
GET /price Get current (delayed) stock price
GET /insider-trades Retrieve insider trading activity
GET /corporate-actions Retrieve corporate events (dividends, splits, etc.)
GET /capital-increase Details about capital increases
GET /ipos Recent and upcoming IPOs
GET /upcoming-events General upcoming financial events
GET /quote Latest stock quote
GET /historical-prices Historical pricing data
GET /key-ratios Financial ratios over time
GET /share-stats Share structure and volume stats
GET /company-profile Overview of company profile
GET /news Latest stock news headlines (MENA only)
GET /detailed-news Latest stock news full text articles (MENA only)
GET /subsidiaries Subsidiaries of a stock and their ownership percentage (MENA only)

Financial Endpoints /api/v1/financials

Method Endpoint Description
GET / Basic welcome message
GET /all All financial statements
GET /balance-sheets Historical balance sheets
GET /cash-flow Cash flow statements
GET /income-statement Income statements

Usage

Base URL

https://leviathan-uchb.onrender.com

Example Request

curl "https://leviathan-uchb.onrender.com/api/v1/stock/price?exchange=EGX&symbol=SWDY"

Response:

{
  "exchange": "EGX",
  "symbol": "SWDY",
  "response": {
    "stockPrice": 79.89
  },
  "date": "2025-05-16T21:21:53.066762"
}

Swagger UI and Docs

https://leviathan-uchb.onrender.com/docs


Supported Exchanges

The following table shows the available worldwide exchanges with their corresponding time delays (for quotes), locations, and market identifier codes.

Location Market Identifier Code Exchange Delay in Quotes (in Minutes)
United StatesAMEXNYSE American15
United StatesXNASNasdaq Stock Market (Last Sale Price)Real-time
United StatesXNYSNew York Stock Exchange15
United StatesARCXNYSE ARCA15
United StatesOTCMOTCM15
United StatesXOTCOTCBB15
United StatesN/ANasdaq Global IndicesReal-time
United StatesN/ADow Jones IndicesReal-time
United StatesN/AS&P Indices10
United StatesN/ACME S&P Indices10
United StatesXCMEChicago Mercantile Exchange10
United StatesNYMSNew York Mercantile Exchange10
United StatesCECSCommodity Exchange (COMEX)10
United StatesN/AOptions Price Reporting Authority (OPRA)15
ArgentinaXBUEBolsa de Comercio de Buenos Aires20
AustraliaXASXAustralian Securities Exchange20
AustraliaN/AS&P ASX IndicesReal-time
AustriaXWBOWiener Boerse AG15
BelgiumXBRUEuronext Brussels15
BrazilBVMFB3 - Brazil Stock Exchange15
CanadaXCNQCanadian National Stock Exchange15
CanadaXTSEToronto Stock Exchange15
CanadaXTSXTSX Venture Exchange15
ChileXSGOSantiago Stock Exchange20
ChinaXSHGShanghai Stock Exchange15
ChinaXSHEShenzhen Stock Exchange15
ColumbiaXBOGBolsa de Valores de ColombiaEnd of Day
CyprusXCYSCyprus Stock Exchange15
DenmarkXCSENasdaq Copenhagen15
EgyptXCAIEgyptian Exchange15
EstoniaXTALNasdaq Tallinn15
FinlandXHELNasdaq Helsinki15
FranceXPAREuronext Paris15
GermanyXFRADeutsche Boerse AG15
GermanyXETRXetra15
GreeceXATHAthens Exchange15
Hong KongXHKGHong Kong Stock Exchange15
IcelandXICENasdaq Iceland15
IndiaXBOMBombay Stock Exchange15
IndiaXNSENational Stock Exchange of India5 minute snapshot
IndonesiaXIDXIndonesia Stock ExchangeEnd of Day
IrelandXDUBEuronext Dublin15
IsraelXTAETel Aviv Stock ExchangeEnd of Day
ItalyXMILBorsa Italiana15
JapanXTKSTokyo Stock Exchange20
KoreaXKRXKorea Stock Exchange20
LatviaXRISNasdaq Riga15
LithuaniaXLINNasdaq Vilnius15
MalaysiaXKLSBursa Malaysia15
MalaysiaN/AFTSE Bursa Malaysia Indices15
MexicoXMEXMexican Stock Exchange20
New ZealandXNZENew Zealand Stock Exchange20
NorwayXOSLOslo Bors Asa15
PeruXLIMBolsa de Valores de LimaEnd of Day
PhilippinesXPHSPhilippine Stock Exchange15
PolandXWARWarsaw Stock Exchange15
PortugalXLISEuronext Lisbon15
RomaniaXBSEBucharest Stock Exchange15
RussiaMISXMoscow Exchange15
Saudi ArabiaXSAUSaudi Stock Exchange15
SingaporeXSESSingapore Exchange10
South AfricaXJSEJohannesburg Stock Exchange15
South AfricaN/AFTSE JSE Indices15
SpainBMEXBolsas y Mercados Espanoles15
SwedenXSTONasdaq Stockholm15
SwitzerlandXSWXSwiss Exchange15
TaiwanXTAITaiwan Stock Exchange20
ThailandXBKKStock Exchange of Thailand15
The NetherlandsXAMSEuronext Amsterdam15
TurkeyXISTBorsa IstanbulEnd of Day
UkraineXUAXUkrainian Stock ExchangeEnd of Day
United Arab EmiratesXADSAbu Dhabi Securities Exchange15
United Arab EmiratesXDFMDubai Financial Market15
United KingdomXLONLondon Stock Exchange15
United KingdomN/AFTSE International15
VenezuelaBVCACaracas Stock ExchangeEnd of Day
VietnamXSTCHochiminh Stock Exchange15

Tech Stack


Coming Soon


Author

Leviathan API by Ahmed Ramadan

Connect on LinkedIn

If you have any questions or feedback, feel free to email me TheAhmedRmdan@gmail.com