Skip to main content

Axion Python SDK

A comprehensive Python client for the Axion financial market data, technical analysis, visualization, and machine learning - built for quantitative research in Jupyter notebooks and Python scripts.

Installation

pip install axionquant-sdk

Quick Start

Get your free API key

from axion import Axion, ta, visualize, utils as axion_utils

client = Axion(api_key="your_api_key_here")

# Fetch stock prices and convert to DataFrame
prices = client.stocks.prices("AAPL", from_date="2024-01-01")
df = axion_utils.df(prices)

# Run technical analysis
roc = ta.roc(df, 'close')

# Visualize
visualize.candles(df)

Modules

The SDK is organized into five importable modules:

from axion import Axion        # API client
from axion import ta           # Technical analysis
from axion import visualize    # Charting & visualization
from axion import utils        # Data utilities
from axion import models       # ML / prediction models

Axion Client

Initialize with your API key:

client = Axion(api_key="your_api_key_here")

Stocks

client.stocks.tickers(country="america")
client.stocks.ticker("AAPL")              # Single ticker lookup
client.stocks.quote("AAPL")
client.stocks.prices("AAPL", from_date="2024-01-01", to_date="2024-12-31", frame="daily")
client.stocks.gainers(days=5, limit=10)  # Top gainers
client.stocks.losers(days=5, limit=10)   # Top losers

Crypto

client.crypto.tickers(type="coin")
client.crypto.ticker("BTC")              # Single ticker lookup
client.crypto.quote("BTC")
client.crypto.prices("BTC", from_date="2024-01-01", frame="weekly")
client.crypto.gainers(days=5, limit=10)
client.crypto.losers(days=5, limit=10)

Forex

client.forex.tickers()
client.forex.ticker("EURUSD")            # Single ticker lookup
client.forex.quote("EURUSD")
client.forex.prices("EURUSD", from_date="2024-01-01")
client.forex.gainers(limit=5)
client.forex.losers(limit=5)

Futures

client.futures.tickers(exchange="CME")
client.futures.ticker("ES")              # Single ticker lookup
client.futures.quote("ES")
client.futures.prices("ES", from_date="2024-01-01")
client.futures.gainers(limit=5)
client.futures.losers(limit=5)

Indices

client.indices.tickers()
client.indices.ticker("SPX")             # Single ticker lookup
client.indices.quote("SPX")
client.indices.prices("SPX", from_date="2024-01-01")
client.indices.components("SPX")         # Index constituents
client.indices.exposure("AAPL")          # Which indices hold AAPL
client.indices.gainers(limit=5)
client.indices.losers(limit=5)

Company Profiles

client.profiles.profile("AAPL")       # Business summary
client.profiles.info("AAPL")          # Company info
client.profiles.statistics("AAPL")    # Key ratios
client.profiles.summary("AAPL")       # Market data summary
client.profiles.recommendation("AAPL") # Analyst recommendations
client.profiles.calendar("AAPL")      # Earnings dates / dividends

Earnings

client.earnings.history("AAPL")
client.earnings.trend("AAPL")
client.earnings.index("AAPL")
client.earnings.report("AAPL", year="2024", quarter="Q1")
client.earnings.transcript("AAPL", year="2024", quarter="Q1")        # Earnings call transcript
client.earnings.transcript_sentiment("base64_encoded_id")             # Transcript sentiment

Financials

# Financial statements
client.financials.balance_sheet("AAPL")
client.financials.income_statement("AAPL")
client.financials.cash_flow_statement("AAPL")

# Historical financial metrics
client.financials.revenue("AAPL", periods=8)
client.financials.net_income("AAPL")
client.financials.free_cash_flow("AAPL")
client.financials.total_assets("AAPL")
client.financials.total_liabilities("AAPL")
client.financials.current_assets("AAPL")
client.financials.current_liabilities("AAPL")
client.financials.stockholders_equity("AAPL")
client.financials.operating_cash_flow("AAPL")
client.financials.capital_expenditures("AAPL")
client.financials.shares_outstanding_basic("AAPL")
client.financials.shares_outstanding_diluted("AAPL")
client.financials.metrics("AAPL")     # Calculated ratios
client.financials.snapshot("AAPL")    # Full data snapshot

# Historical valuation ratios
client.financials.eps("AAPL", from_date="2024-01-01", to_date="2024-12-31")
client.financials.pe("AAPL")
client.financials.market_cap("AAPL")
client.financials.roe("AAPL")
client.financials.enterprise_value("AAPL")
client.financials.ebitda("AAPL")
client.financials.debt_to_equity("AAPL")

client.financials.dcf_value("AAPL")   # DCF valuation (fair price, margin of safety)
client.financials.dcf_rate("AAPL")    # Discount rate / WACC calculation

Insiders & Ownership

client.insiders.individuals("AAPL")   # Insider holders
client.insiders.institutions("AAPL")  # Institutional ownership
client.insiders.funds("AAPL")         # Fund ownership
client.insiders.ownership("AAPL")     # Major holders breakdown
client.insiders.transactions("AAPL")  # Insider transactions
client.insiders.activity("AAPL")      # Net share purchase activity

SEC Filings

client.filings.filings("AAPL", limit=10, form="10-K")
client.filings.forms("AAPL", form_type="10-Q", year="2024", quarter="Q2")
client.filings.search(year="2024", quarter="Q1", form="10-K", ticker="AAPL")
client.filings.desc_forms()           # List available form types
client.filings.document_text("document_id")     # Raw filing text
client.filings.document_sentiment("document_id") # Filing sentiment

Economic Data

client.econ.find("semiconductor spending")  # AI-powered FRED search
client.econ.search("unemployment rate")
client.econ.dataset("UNRATE")
client.econ.calendar(
    from_date="2024-01-01",
    to_date="2024-12-31",
    country="US",
    min_importance=3,
    currency="USD",
    category="employment"
)

ETFs

client.etfs.tickers()
client.etfs.ticker("SPY")              # Single ticker lookup
client.etfs.fund("SPY")
client.etfs.holdings("SPY")
client.etfs.holdings_all("SPY")
client.etfs.exposure("SPY")
client.etfs.weights("SPY")             # Sector & region weights
client.etfs.quote("SPY")
client.etfs.gainers(limit=5)
client.etfs.losers(limit=5)

News

client.news.general()
client.news.company("AAPL")
client.news.country("US")
client.news.category("technology")

Sentiment

client.sentiment.all("AAPL")
client.sentiment.social("AAPL")
client.sentiment.news("AAPL")
client.sentiment.analyst("AAPL")

ESG

client.esg.data("AAPL")

Credit Ratings

client.credit.search("Apple Inc")
client.credit.ratings("entity_id")

Supply Chain

client.supply_chain.customers("AAPL")
client.supply_chain.suppliers("AAPL")
client.supply_chain.peers("AAPL")

Web Traffic

client.web_traffic.traffic("AAPL")

Technical Analysis (ta)

All functions accept a pandas DataFrame and return a Series (or tuple of Series).

import axion.ta as ta

# Trend
ta.sma(df, column="close", period=14)
ta.ema(df, column="close", period=14)
ta.dema(df, column="close", period=14)
ta.ssma(df, column="close", period=14)
ta.trima(df, column="close", period=14)
ta.kama(df, column="close", period=14)

# Momentum & Oscillators
ta.rsi(df, column="close", period=14)
ta.macd(df)                            # returns (macd_line, signal, histogram)
ta.roc(df, column="close", period=10)
ta.mom(df, column="close", period=10)
ta.cmo(df, column="close", period=20)
ta.stochastic_oscillator(df)           # returns (K, D)
ta.williams_r(df, period=14)
ta.adx(df, period=14)

# Volatility & Channels
ta.atr(df, period=14)
ta.bbands(df)                          # returns (upper, mid, lower)
ta.kc(df)                              # Keltner Channels

# Volume
ta.obv(df)
ta.vpt(df)
ta.vwap(df)

# Trend Direction
ta.vi(df, period=14)                   # Vortex Indicator (VI+, VI-)
ta.ichi(df)                            # Ichimoku Cloud
ta.sar(df)                             # Parabolic SAR
ta.fib(df)                             # Fibonacci Pivot Points

Visualization (visualize)

All chart functions accept a pandas DataFrame and render an interactive Plotly chart.

import axion.visualize as visualize

visualize.candles(df)                            # Candlestick chart
visualize.line(df, x="time", y="close")          # Line chart
visualize.bar(df, x="time", y="volume")          # Bar chart
visualize.barh(df, x="value", y="label")         # Horizontal bar
visualize.scatter(df, x="time", y="close")       # Scatter plot
visualize.fit(df, x="revenue", y="price")        # Scatter + OLS trendline
visualize.area(df, x="time", y="value", group="sector")
visualize.pie(df, values="marketCap", labels="ticker")
visualize.radar(df, values="score", labels="category")
visualize.heatmap(df, x="col1", y="col2")
visualize.cov(df)                                # Correlation heatmap
visualize.polls(df)                              # Multi-series line chart
visualize.spread(dfs, x="time", y="close")       # Two assets + spread
visualize.tree(df)                               # Treemap (sector/industry/symbol)

# Flexible multi-series chart
visualize.graph(df, x="time", bars=["volume"], lines=["close", "sma"])

Utilities (utils)

import axion.utils as axion_utils

# Date helpers
axion_utils.d("1 month ago")           # Natural language → "YYYY-MM-DD"
axion_utils.to_timestamp("2024-01-01")
axion_utils.nearest_day("2024-01-06")  # Nearest market open day

# Date shorthand constants
axion_utils.today / axion_utils.yesterday / axion_utils.weekago
axion_utils.monthago / axion_utils.yearago / axion_utils.yearfrom

# Frame shorthand constants
axion_utils.d   # daily
axion_utils.w   # weekly
axion_utils.m   # monthly
axion_utils.y   # yearly

# DataFrame helpers
axion_utils.df(items)                  # Create DataFrame from list of dicts
axion_utils.pds(list_of_lists)         # Convert 2D list of dicts → list of DataFrames
axion_utils.stack(dfs)                 # Concat DataFrames vertically
axion_utils.stitch(dfs, col="time")    # Merge different data types on shared column
axion_utils.snap(dfs, names, overwrite) # Merge same-type DataFrames side-by-side
axion_utils.filter(df, col, items)     # Filter rows by column values
axion_utils.dedup(lst)                 # Remove duplicates from list
axion_utils.simmer(arr)                # Flatten 2D list to 1D
axion_utils.resample(df, "2024-01-01 2024-12-31")

# Analysis helpers
axion_utils.relativity(df, cols)       # Add pct_change columns
axion_utils.indexed(prices)            # Average a dict of price DataFrames
axion_utils.composite(dfs)             # Combine and average financials/facts
axion_utils.contrast(dfs, joins)       # Reshape for side-by-side graphing
axion_utils.compare(dfs, joins)        # Cross-DataFrame % diff comparison
axion_utils.gainers(prices, frame)     # Top gainers from price dict
axion_utils.losers(prices, frame)      # Top losers from price dict
axion_utils.overlap(dfs, col)          # Intersection of column values
axion_utils.difference(dfs, col)       # Non-overlapping values

# Concurrency
axion_utils.work(df, callback, ref)    # Threaded execution with progress bar

# Caching / Persistence
axion_utils.cache(id, fn)              # Load from cache or run function
axion_utils.save(id, obj)             # Manually save object to cache
axion_utils.read(id)                  # Read object from cache
axion_utils.scribe(df, id, cb)        # Cache + work helper combined

ML Models (models)

import axion.models as models

# Linear regression forecast
preds = models.linearRegression(df, x="time", target="close", n_preds=10)

# Multi-feature linear regression
preds = models.multiLinearRegression(df, x="time", target="close",
                                     features=["volume", "rsi"], n_preds=10)

# Beta relative to benchmark
b = models.beta(df, x="stock_return", y="market_return")

# LSTM deep learning forecast
preds = models.lstm(df, x="time", target="close",
                    features=["volume", "rsi"], n_preds=10)

Date Formats & Time Frames

All API date parameters use YYYY-MM-DD format. Supported price frames: daily, weekly, monthly, quarterly, yearly.

Error Handling

try:
    data = client.stocks.prices("INVALID")
except Exception as e:
    print(f"Error: {e}")

Common errors: HTTP Error, Connection Error, Timeout Error, Authentication Error.

Get Started

For detailed API documentation, support, or to obtain an API key, visit the Axion website.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axionquant_sdk-1.1.9.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axionquant_sdk-1.1.9-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file axionquant_sdk-1.1.9.tar.gz.

File metadata

  • Download URL: axionquant_sdk-1.1.9.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for axionquant_sdk-1.1.9.tar.gz
Algorithm Hash digest
SHA256 6b2e30f760df6a3a16eca4811d9378f046eb448e21aa28450de425c88a15a148
MD5 7564c4165bd82e1c6f845c3c6835e6b8
BLAKE2b-256 c509d18125e64ba72dfb5726cf90dc4cb59f84ba62a874b49bc1af050458f124

See more details on using hashes here.

File details

Details for the file axionquant_sdk-1.1.9-py3-none-any.whl.

File metadata

  • Download URL: axionquant_sdk-1.1.9-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for axionquant_sdk-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8b7954a78cc6fc2b62c00be2880cc44c5b3f3da92d1240129b75de575b45a7fb
MD5 e3dc4d350bc6f9eda4473a689101d1ce
BLAKE2b-256 2e7117f5accbd31fa15fcf62da05e8e36f8aed1382b3b010983d592ed1ee6a32

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

This release

1.1.9 This release

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page