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 72 domains and 519 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.1

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.1
File Size Uploaded Provenance Actions
ensemblai-0.1.1.tar.gz 6.3 kB Without provenance Details for ensemblai-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 13.2 kB

Release files / ensemblai-0.1.1.tar.gz

Download URL ensemblai-0.1.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1256599a2f4ed512a0d354258dd92e2433d51881689fc6f6af7522c9190719e0
BLAKE2b-256 checksum
How to use checksums
641ea8029669094a7ab0db53d5dead5d2347f2ed31322e55f9333efdb8b58c75
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.1-py3-none-any.whl

Download URL ensemblai-0.1.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51981dd8d47708d81dfb067bb6f0be9db73e9656d99b2453dd2339f3fadb77fe
BLAKE2b-256 checksum
How to use checksums
02df41872bd691020500dc3bc0880d0068e2ad7f68b41ad71ceb4d14af4472a0
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.1

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