AxPrism API client — institutional XBRL data, Shariah compliance screening, SEC/EDGAR, ESEF, Tadawul/Bursa/IDX
Project description
axprism
Official Python SDK for the AxPrism API — institutional XBRL data, Shariah compliance screening (AAOIFI, MSCI Islamic, DJIM, FTSE, Saudi CMA), SEC/EDGAR, ESEF, EDINET, and the Tadawul / Bursa Malaysia / IDX exchanges.
Installation
Coming soon to PyPI.
pip install axprismwill work once the package is published. For now, install from a local checkout of this repo:
# From the repo root:
pip install ./sdk/python
# …or for development (editable install):
pip install -e ./sdk/python
Requires Python 3.8+ and requests.
Authentication
AxPrism authenticates with the X-API-Key header. Get a key at
axprism.com/keys. A public read-only demo key is
available for trying the API: axmd_demo_try_axprism_2024.
from axprism import AxPrism
client = AxPrism(api_key="axmd_live_...")
Quick Start
from axprism import AxPrism
client = AxPrism(api_key="axmd_demo_try_axprism_2024")
# Shariah compliance screening
result = client.compliance("AAPL", standard="aaoifi")
print(result.verdict) # "halal"
print(result.ratios.debt.ratio) # 0.026
print(result.ratios.debt.passes) # True
# Screen a full portfolio (with purification)
portfolio = client.portfolio([
{"ticker": "AAPL", "weight": 35, "shares": 120, "dividend_per_share": 0.96},
{"ticker": "MSFT", "weight": 25, "shares": 80, "dividend_per_share": 3.32},
])
print(portfolio.summary.halal_weight)
print(portfolio.purification.total_usd)
# Normalized financial statements (values are display strings; use as_number=True for floats)
fin = client.financials("AAPL", statement="IS", period="annual", currency="USD")
print(fin.get_metric("Revenue")) # "$416,161,000,000"
print(f"Revenue: ${fin.get_metric('Revenue', as_number=True):,.0f}")
# Price history
hist = client.prices("AAPL", start="2024-01-01", limit=252)
print(hist.prices[0].close)
Endpoint coverage
The SDK provides typed, ergonomic methods across all key groups. For any of the
API's 165+ operations not given a dedicated method, use the generic
client.request(method, path, params=..., json=...) escape hatch.
| Group | Methods |
|---|---|
| Compliance | compliance, compliance_multi, compliance_trend, compliance_history, compliance_point_in_time, compliance_audit, sukuk, portfolio, screen_compliance, purification, is_halal |
| Financials | financials, ttm, batch_metric, compare, facts, segments, nongaap, restatements, restatement_events, concept_history, concepts_search, screener |
| Profile / symbols | profile, market_cap, symbols, exchanges, company_resolve |
| Market data | prices, estimates, news, insiders, holders_13f, etf_holdings, options_chain, corporate_actions, esg, calendar, fx_rates |
| Disclosures / text | disclosures.search, disclosures.recent, disclosures.facets, text.search, text.stats, text.index |
| International | tadawul.*, bursa.*, idx.* (symbols, profile, financials, sectors, shariah) |
| Filings | filing_index, filing_as_reported, filing_footnote_graph, filing_diff, filing_textblocks |
| Webhooks | webhooks.list, webhooks.events, webhooks.create, webhooks.delete |
| Bulk / export | bulk_financials (CSV), excel_workbook (XLSX bytes) |
| Coverage | coverage_core50, coverage_summary, benchmark_financials_50 |
| Account | me, usage, pricing, rulesets, metrics_catalog, keys.* |
International exchanges
client.tadawul.symbols(limit=10) # Saudi Tadawul registry
client.tadawul.financials("2222") # Saudi Aramco
client.bursa.shariah() # Bursa Malaysia SC list
client.idx.profile("BBCA") # Indonesia Stock Exchange
Disclosure & text search
client.disclosures.search("supply chain risk", ticker="AAPL", forms=["10-K", "10-Q"])
client.disclosures.recent("AAPL", limit=10)
client.text.search("revenue recognition", ticker="MSFT")
Pagination
for hit in client.paginate("/api/v1/disclosures/search",
{"q": "climate", "ticker": "AAPL"},
items_key="results", max_items=200):
print(hit)
Error Handling & Retries
The client retries automatically on 429 (honoring Retry-After) and transient
5xx errors with exponential backoff (configurable via max_retries and
backoff_factor).
from axprism import AxPrism, AuthError, RateLimitError, TierError, NotFoundError
client = AxPrism(api_key="...", max_retries=3, backoff_factor=0.5)
try:
result = client.compliance("AAPL")
except AuthError:
print("Invalid API key (401)")
except TierError as e: # 402 / 403
print(f"Need {e.required_tier}. Upgrade at {e.upgrade_url}")
except RateLimitError as e: # 429
print(f"Quota exceeded: {e.used_today}/{e.daily_limit}")
except NotFoundError: # 404
print("Ticker not found")
Examples & tests
examples/quickstart.py— runnable script using the demo key.tests/test_live.py— read-only live tests (pytest).
Documentation
- API Reference: axprism.com/api-reference
- Pricing: axprism.com/pricing
- Support: support@axprism.com
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file axprism-0.2.0.tar.gz.
File metadata
- Download URL: axprism-0.2.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62ee1850a03f9d85f628f7c9ff862f38d7fc61c563c781825fcc9a1970b0b745
|
|
| MD5 |
57831a33c216f7efd402382ac495d87d
|
|
| BLAKE2b-256 |
e7fa42576ccffedbbd222d6f97e97a344baaed3c72c018b53aaacd0ca9142708
|
File details
Details for the file axprism-0.2.0-py3-none-any.whl.
File metadata
- Download URL: axprism-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64a17d5d00c1b11ea7bb044c18486e71c8f8391ee3c50533d096e43e3b7ef61d
|
|
| MD5 |
8857f3d5880db26fddfd4f4488cc6454
|
|
| BLAKE2b-256 |
c57e2e8235bc2a1c691e3ab8b70afae45a8bf14b483d35f9721525f5a11fec56
|