Python Client
The profitelligence package is a typed client over this API. It parses the pipe-delimited CSV for you, so a notebook gets rows and numbers instead of a string to split.
pip install profitelligenceimport profitelligence as prof
prof.api_key("pk_live_...") # or set PROFITELLIGENCE_API_KEY
prices = prof.company.ohlc("AAPL", days=90) # 90 rows, typed
prices[0].close # 305.69, a float
prices.df # a DataFrame, with [pandas]You can also call with no key. Guests reach the free endpoints on the top 500 symbols, which is enough to try the package before you sign up.
When you want your own tier, generate a key in Account settings, or pick a plan first. Keep it out of version control — the package reads PROFITELLIGENCE_API_KEY from the environment.
Namespaces
Nine namespaces cover all 68 endpoints. Every method is generated from the same reference this site is built from, so the package describes exactly the API you see here.
Scroll the table sideways →
| Namespace | Data | Endpoints |
|---|---|---|
prof.company | Profiles, prices, technical signals, corporate actions | 9 |
prof.filings | 8-K summaries and filing patterns | 3 |
prof.form4 | Insider transactions, clusters, insider profiles | 21 |
prof.institutional | 13F holdings, managers, crowded trades | 11 |
prof.financials | Income statement, balance sheet, cash flow | 4 |
prof.fred | Economic series from the Federal Reserve | 6 |
prof.discovery | Search, spotlights, interesting companies | 4 |
prof.graph | The knowledge graph | 3 |
prof.analytics | Correlations, opportunity scores, strategies | 7 |
Each method carries its endpoint's documentation. In a notebook, prof.form4.clusters? shows the arguments, the tier the call needs, and the columns it returns.
Tables
CSV endpoints return a Table: named columns, typed values, and one row object per record. It is a normal Python sequence.
prices = prof.company.ohlc("AAPL,MSFT", days=180)
prices.columns # ['symbol', 'time', 'open', 'high', 'low', 'close']
prices[0].close # 305.69 a float
prices[0].time # date(2026, 8, 17) a date
prices.column("close") # the whole column
prices.to_dicts() # plain dictionaries A column is typed as a whole. If one value will not parse as a number, the column stays text rather than becoming a mix you cannot do arithmetic on. An empty cell is None, never 0 and never "".
For pandas, install the extra. Date columns arrive as datetime64, so resampling and plotting work with no further conversion.
pip install 'profitelligence[pandas]'frame = prof.company.ohlc("AAPL", days=365).df
frame.set_index("time").close.resample("W").last()JSON endpoints — the page routes, FRED, search, and the knowledge graph — return the decoded body as it stands.
Errors
The client raises rather than returning a body you have to check.
try:
scores = prof.analytics.opportunities()
except prof.UpgradeRequired as error:
print(error.message) # the plan this endpoint needs
except prof.RateLimited as error:
print(error.retry_after) # seconds until the window resets| Error | Means |
|---|---|
AuthenticationError | The key is absent, wrong, or revoked |
UpgradeRequired | Your plan does not include this endpoint or this symbol |
RateLimited | The window is spent. Carries window, limit, remaining, reset |
BadRequest | An argument is missing or out of range |
NoData | The API looked and found nothing to return |
ServerError | The API failed. The client already retried twice |
Timeout | No answer inside the timeout |
All of them inherit ProfitelligenceError. A rate limit is never retried for you. Server errors and timeouts are retried twice, with backoff.
error,<message>. Read raw, that looks like success and parses to nothing. The client raises BadRequest or NoData instead, so an empty result never passes for a real one. A genuinely empty result — a header row with no data rows — stays an empty Table. In a service
Build a client and hold it. One client is one connection pool.
from profitelligence import Client
with Client(api_key="pk_live_...", timeout=60) as prof:
holdings = prof.institutional.manager_top_holdings("0001067983")The client is read-only. Nothing in it writes to your account, and nothing places a trade. It reports what filings and market data show.