Skip to main content

ensemblai

Python client and CLI for EnsemblAI — software ecosystem intelligence for PyPI and npm: download analytics, month-over-month growth, dependency structure, and corporate ownership across millions of packages with multi-year daily history.

Requires a Pro-plan API key. Create an account, subscribe, and mint a key at https://www.ensemblai.com/settings/api-keys. Prefer an AI agent? Connect Claude Code, Cursor, or Codex to the MCP server instead — see https://www.ensemblai.com/docs/agents.

Why this and not the registry API

The free endpoints have hard ceilings, measured against the live services on 2026-09-14: api.npmjs.org silently truncates any range request to 18 months (HTTP 200, correct shape, the series just starts later), its bulk endpoint caps at 128 packages and rejects @scoped names, and pypistats.org serves exactly 180 days. Neither has search or aggregation, so "most downloaded in X" or "how is all of AI/ML trending" cannot be asked at all. EnsemblAI stores the full history (npm from 2015, PyPI from 2018) and pre-computes the rest: leaderboards, month-over-month growth, whole-segment series across 20 domains and 80 categories, ownership for 2,900+ companies, and dependency graphs, for both ecosystems.

The counts are cleaned, and the cleaning is a parameter rather than a promise: PyPI downloads count distribution files only (the metadata-sidecar fetches that inflate raw logs by up to ~40% are excluded for all time, so year-over-year is on one basis), CI traffic is stored separately (ci_downloads / non_ci_downloads, sortable by ci_percentage), and country_grouping (ALL / US / ALL_EX_US) isolates region-skewed traffic. Full methodology: https://www.ensemblai.com/llms.txt.

Install

pip install ensemblai        # or: uv pip install ensemblai

Quickstart

from ensemblai import Client

ea = Client()  # reads ENSEMBLAI_API_KEY from the environment

numpy = ea.package("numpy")
print(numpy["package_name"], numpy.get("latest_downloads"))

for row in ea.top(limit=10, ecosystem="npm"):
    print(row)

trend = ea.time_series(["requests", "httpx"], granularity="monthly")

Pass the key explicitly if you'd rather not use the environment:

ea = Client(api_key="ek_live_...", ecosystem="npm")

CLI

export ENSEMBLAI_API_KEY=ek_live_...

ensemblai pkg numpy
ensemblai top --eco npm --limit 10
ensemblai search "http client"
ensemblai compare requests httpx aiohttp
ensemblai companies --limit 20

Methods

Method REST endpoint Returns
package(name) GET /v1/packages/{name} one package's full profile
search(query, limit=) GET /v1/packages matching packages
top(limit=) GET /v1/leaderboards/downloads 30-day download leaderboard
compare(names) POST /v1/packages/batch side-by-side metrics
time_series(packages, granularity=) GET /v1/analytics/time-series download history (weekly is Pro+)
companies(limit=) GET /v1/companies corporate owners by footprint
reference(kind) GET /v1/reference/{kind} valid filter values
get(path, **params) any escape hatch for the full API

The full surface is documented in the OpenAPI schema.

Configuration

Variable Default Purpose
ENSEMBLAI_API_KEY — your Pro API key (required)
ENSEMBLAI_BASE_URL https://api.ensemblai.com override the API host

License

MIT

Metadata

Release files for ensemblai 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ensemblai 0.1.2
File Size Uploaded Provenance Actions
ensemblai-0.1.2.tar.gz 6.2 kB Without provenance Details for ensemblai-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ensemblai 0.1.2
File Interpreter ABI Platform Actions
ensemblai-0.1.2-py3-none-any.whl Python 3 none any Details for ensemblai-0.1.2-py3-none-any.whl

Total release size: 13.1 kB

Release files / ensemblai-0.1.2.tar.gz

Download URL ensemblai-0.1.2.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
92f7d49bd43dc4cac8db9cfb6582c086c261bab79e772b5962be9fe36d984fe3
BLAKE2b-256 checksum
How to use checksums
e955dd01d61f0d2c943af68bc3cc5de48c161f2ec09e8ffdc0b7c1eb8d2f14eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / ensemblai-0.1.2-py3-none-any.whl

Download URL ensemblai-0.1.2-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43df50820876664aedd69a1b3301452c795c981591bf8807954436787bed01e2
BLAKE2b-256 checksum
How to use checksums
3ebb92219f029a0211307da93fcaa1ddc99d95fc4fef5fdd2ded8a24db7391b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for ensemblai 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page